Wei Wang
d0e60206be
ipv6: use rcu_dereference_bh() in ipv6_route_seq_next()
This patch replaces rcu_deference() with rcu_dereference_bh() in
ipv6_route_seq_next() to avoid the following warning:
[ 19.431685] WARNING: suspicious RCU usage
[ 19.433451] 4.14.0-rc3-00914-g66f5d6c #118 Not tainted
[ 19.435509] -----------------------------
[ 19.437267] net/ipv6/ip6_fib.c:2259 suspicious
rcu_dereference_check() usage!
[ 19.440790]
[ 19.440790] other info that might help us debug this:
[ 19.440790]
[ 19.444734]
[ 19.444734] rcu_scheduler_active = 2, debug_locks = 1
[ 19.447757] 2 locks held by odhcpd/3720:
[ 19.449480] #0: (&p->lock){+.+.}, at: [<ffffffffb1231f7d>]
seq_read+0x3c/0x333
[ 19.452720] #1: (rcu_read_lock_bh){....}, at: [<ffffffffb1d2b984>]
ipv6_route_seq_start+0x5/0xfd
[ 19.456323]
[ 19.456323] stack backtrace:
[ 19.458812] CPU: 0 PID: 3720 Comm: odhcpd Not tainted
4.14.0-rc3-00914-g66f5d6c #118
[ 19.462042] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
BIOS 1.10.2-1 04/01/2014
[ 19.465414] Call Trace:
[ 19.466788] dump_stack+0x86/0xc0
[ 19.468358] lockdep_rcu_suspicious+0xea/0xf3
[ 19.470183] ipv6_route_seq_next+0x71/0x164
[ 19.471963] seq_read+0x244/0x333
[ 19.473522] proc_reg_read+0x48/0x67
[ 19.475152] ? proc_reg_write+0x67/0x67
[ 19.476862] __vfs_read+0x26/0x10b
[ 19.478463] ? __might_fault+0x37/0x84
[ 19.480148] vfs_read+0xba/0x146
[ 19.481690] SyS_read+0x51/0x8e
[ 19.483197] do_int80_syscall_32+0x66/0x15a
[ 19.484969] entry_INT80_compat+0x32/0x50
[ 19.486707] RIP: 0023:0xf7f0be8e
[ 19.488244] RSP: 002b:00000000ffa75d04 EFLAGS: 00000246 ORIG_RAX:
0000000000000003
[ 19.491431] RAX: ffffffffffffffda RBX: 0000000000000009 RCX:
0000000008056068
[ 19.493886] RDX: 0000000000001000 RSI: 0000000008056008 RDI:
0000000000001000
[ 19.496331] RBP: 00000000000001ff R08: 0000000000000000 R09:
0000000000000000
[ 19.498768] R10: 0000000000000000 R11: 0000000000000000 R12:
0000000000000000
[ 19.501217] R13: 0000000000000000 R14: 0000000000000000 R15:
0000000000000000
Fixes: 66f5d6ce53
("ipv6: replace rwlock with rcu and spinlock in fib6_table")
Reported-by: Xiaolong Ye <xiaolong.ye@intel.com>
Signed-off-by: Wei Wang <weiwan@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-09 19:59:42 -07:00
..
2017-07-31 19:10:44 +02:00
2017-09-08 18:55:27 +02:00
2017-06-09 12:26:07 -04:00
2017-10-08 21:16:31 -07:00
2017-10-09 10:47:30 -07:00
2017-08-24 18:05:43 -07:00
2017-06-23 14:17:31 -04:00
2017-07-04 01:29:04 -07:00
2017-07-04 22:35:16 +01:00
2017-07-01 07:39:08 -07:00
2017-09-01 17:42:05 -07:00
2017-09-01 17:42:05 -07:00
2017-10-05 21:53:02 -07:00
2015-09-02 15:31:00 -07:00
2017-08-07 14:16:21 -07:00
2017-09-01 20:33:42 -07:00
2017-08-08 21:40:08 -07:00
2017-05-21 13:42:36 -04:00
2017-10-06 09:52:31 -07:00
2017-01-28 10:33:06 -05:00
2017-08-07 11:39:22 -07:00
2016-06-14 15:26:42 -04:00
2017-10-09 19:59:42 -07:00
2016-12-24 11:46:01 -08:00
2017-10-05 18:19:22 -07:00
2016-06-18 22:11:38 -07:00
2017-04-20 10:35:33 -04:00
2017-06-04 21:41:10 -04:00
2016-04-07 16:53:29 -04:00
2017-08-10 09:52:12 -07:00
2017-10-05 18:19:22 -07:00
2016-11-02 15:18:36 -04:00
2017-10-05 18:19:22 -07:00
2017-08-09 16:57:38 -07:00
2016-11-04 14:45:23 -04:00
2017-09-30 05:30:52 +01:00
2017-08-25 17:10:24 -07:00
2017-08-07 14:16:22 -07:00
2015-08-13 17:08:39 -07:00
2017-07-04 01:29:04 -07:00
2016-12-25 17:21:23 +01:00
2017-08-29 16:10:50 -07:00
2016-11-04 14:45:23 -04:00
2017-08-22 10:23:26 -07:00
2017-10-06 09:52:31 -07:00
2017-06-12 09:53:14 -04:00
2017-03-24 13:17:07 -07:00
2017-08-07 11:39:22 -07:00
2017-09-03 11:01:05 -07:00
2017-10-09 10:29:39 -07:00
2017-09-01 18:35:23 -07:00
2017-08-25 17:10:23 -07:00
2017-09-11 14:34:10 -07:00
2017-08-07 14:16:22 -07:00
2017-09-19 16:32:23 -07:00
2017-07-18 11:22:51 -07:00
2017-08-24 18:05:43 -07:00
2017-09-08 16:07:17 -07:00
2015-02-28 16:56:51 -05:00
2015-11-03 10:52:13 -05:00
2017-05-18 10:23:33 -04:00
2017-08-08 21:39:01 -07:00
2017-09-18 11:43:03 -07:00
2016-11-24 15:32:14 -05:00
2017-08-02 11:00:15 +02:00
2017-06-16 11:48:39 -04:00
2017-06-02 13:57:27 -04:00
2017-06-02 13:57:27 -04:00
2017-04-14 10:07:39 +02:00
2017-04-14 10:06:10 +02:00
2017-08-11 07:03:00 +02:00
2017-02-09 10:22:17 +01:00
2014-08-24 22:37:52 -07:00
2017-07-04 01:29:04 -07:00