Eric Dumazet
0a7e8300b7
ipv4: ensure rcu_read_lock() in ipv4_link_failure()
...
[ Upstream commit c543cb4a5f07e09237ec0fc2c60c9f131b2c79ad ]
fib_compute_spec_dst() needs to be called under rcu protection.
syzbot reported :
WARNING: suspicious RCU usage
5.1.0-rc4+ #165 Not tainted
include/linux/inetdevice.h:220 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
1 lock held by swapper/0/0:
#0 : 0000000051b67925 ((&n->timer)){+.-.}, at: lockdep_copy_map include/linux/lockdep.h:170 [inline]
#0 : 0000000051b67925 ((&n->timer)){+.-.}, at: call_timer_fn+0xda/0x720 kernel/time/timer.c:1315
stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.1.0-rc4+ #165
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
lockdep_rcu_suspicious+0x153/0x15d kernel/locking/lockdep.c:5162
__in_dev_get_rcu include/linux/inetdevice.h:220 [inline]
fib_compute_spec_dst+0xbbd/0x1030 net/ipv4/fib_frontend.c:294
spec_dst_fill net/ipv4/ip_options.c:245 [inline]
__ip_options_compile+0x15a7/0x1a10 net/ipv4/ip_options.c:343
ipv4_link_failure+0x172/0x400 net/ipv4/route.c:1195
dst_link_failure include/net/dst.h:427 [inline]
arp_error_report+0xd1/0x1c0 net/ipv4/arp.c:297
neigh_invalidate+0x24b/0x570 net/core/neighbour.c:995
neigh_timer_handler+0xc35/0xf30 net/core/neighbour.c:1081
call_timer_fn+0x190/0x720 kernel/time/timer.c:1325
expire_timers kernel/time/timer.c:1362 [inline]
__run_timers kernel/time/timer.c:1681 [inline]
__run_timers kernel/time/timer.c:1649 [inline]
run_timer_softirq+0x652/0x1700 kernel/time/timer.c:1694
__do_softirq+0x266/0x95a kernel/softirq.c:293
invoke_softirq kernel/softirq.c:374 [inline]
irq_exit+0x180/0x1d0 kernel/softirq.c:414
exiting_irq arch/x86/include/asm/apic.h:536 [inline]
smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
Fixes: ed0de45a1008 ("ipv4: recompile ip options in ipv4_link_failure")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Stephen Suryaputra <ssuryaextr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-27 09:35:34 +02:00
..
2018-10-03 17:00:47 -07:00
2019-04-20 09:15:04 +02:00
2017-11-02 11:10:55 +01:00
2018-07-22 14:28:44 +02:00
2019-04-20 09:15:07 +02:00
2019-04-27 09:35:33 +02:00
2019-02-23 09:06:44 +01:00
2019-02-27 10:08:06 +01:00
2019-04-03 06:25:07 +02:00
2019-04-27 09:35:34 +02:00
2018-09-05 09:26:27 +02:00
2019-01-31 08:13:46 +01:00
2019-03-27 14:13:51 +09:00
2019-04-17 08:37:50 +02:00
2018-09-19 22:43:43 +02:00
2019-04-03 06:25:08 +02:00
2018-02-25 11:07:52 +01:00
2018-07-22 14:28:49 +02:00
2019-02-12 19:46:11 +01:00
2019-03-19 13:13:22 +01:00
2019-01-09 17:14:43 +01:00
2018-04-29 11:33:13 +02:00
2019-04-27 09:35:34 +02:00
2019-04-17 08:37:50 +02:00
2017-11-02 11:10:55 +01:00
2018-03-31 18:10:41 +02:00
2019-04-17 08:37:45 +02:00
2019-03-23 14:35:14 +01:00
2019-03-19 13:13:22 +01:00
2018-12-01 09:42:51 +01:00
2019-03-23 14:35:12 +01:00
2018-09-09 19:55:52 +02:00
2019-03-13 14:03:09 -07:00
2017-10-21 01:56:38 +01:00
2019-04-20 09:15:04 +02:00
2019-03-13 14:03:08 -07:00
2019-04-03 06:25:08 +02:00
2019-02-06 17:31:32 +01:00
2019-03-13 14:03:08 -07:00
2018-07-22 14:28:49 +02:00
2019-04-17 08:37:47 +02:00
2019-04-03 06:25:09 +02:00
2019-03-23 14:35:16 +01:00
2017-11-01 12:19:03 +09:00
2018-08-24 13:09:13 +02:00
2019-04-17 08:37:46 +02:00
2018-05-16 10:10:26 +02:00
2019-04-03 06:25:08 +02:00
2019-03-19 13:13:23 +01:00
2019-04-17 08:37:49 +02:00
2019-04-17 08:37:47 +02:00
2019-01-09 17:14:46 +01:00
2018-07-22 14:28:47 +02:00
2019-02-23 09:06:43 +01:00
2017-08-07 14:48:48 -07:00
2019-03-13 14:03:07 -07:00
2018-12-05 19:41:11 +01:00
2019-03-19 13:13:24 +01:00
2019-03-13 14:03:21 -07:00
2017-11-02 11:10:55 +01:00
2019-03-05 17:58:02 +01:00
2019-03-19 13:13:23 +01:00
2019-02-15 08:09:13 +01:00
2019-01-09 17:14:46 +01:00
2017-09-04 13:25:20 +02:00
2017-11-02 11:10:55 +01:00
2019-03-13 14:03:09 -07:00