Eric Dumazet
aec9cfdd09
ipv4: ensure rcu_read_lock() in ipv4_link_failure()
[ Upstream commit c543cb4a5f ]
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: ed0de45a10 ("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:34:41 +02:00
..
2019-02-20 10:18:34 +01:00
2018-09-29 03:07:32 -07:00
2018-04-13 19:48:31 +02:00
2018-04-13 19:48:32 +02:00
2019-03-13 14:04:54 -07:00
2018-01-02 20:35:10 +01:00
2018-04-13 19:48:31 +02:00
2019-01-31 08:12:33 +01:00
2018-10-18 09:13:22 +02:00
2019-01-31 08:12:33 +01:00
2019-04-27 09:34:40 +02:00
2017-11-18 11:22:20 +01:00
2019-03-13 14:04:53 -07:00
2018-07-28 07:49:11 +02:00
2019-03-19 13:14:10 +01:00
2019-01-31 08:12:33 +01:00
2017-11-18 11:22:22 +01:00
2018-05-16 10:08:41 +02:00
2019-02-23 09:05:59 +01:00
2019-02-06 17:33:26 +01:00
2019-04-17 08:36:45 +02:00
2019-04-17 08:36:45 +02:00
2018-07-28 07:49:11 +02:00
2019-01-23 08:10:54 +01:00
2018-11-23 08:20:34 +01:00
2018-12-08 13:05:05 +01:00
2019-03-13 14:04:55 -07:00
2018-08-03 07:55:24 +02:00
2017-11-18 11:22:23 +01:00
2019-01-09 16:16:39 +01:00
2017-07-05 14:40:28 +02:00
2018-05-19 10:26:57 +02:00
2018-10-18 09:13:25 +02:00
2018-01-02 20:35:12 +01:00
2019-04-27 09:34:41 +02:00
2019-03-19 13:14:09 +01:00
2018-07-25 11:24:00 +02:00
2018-08-06 16:23:01 +02:00
2017-06-14 15:05:52 +02:00
2019-04-17 08:36:45 +02:00
2017-02-04 09:47:10 +01:00
2018-05-30 07:50:33 +02:00
2019-04-27 09:34:40 +02:00
2019-02-23 09:05:59 +01:00
2017-05-14 14:00:21 +02:00
2018-09-15 09:42:56 +02:00
2018-05-30 07:50:22 +02:00
2018-01-31 12:55:55 +01:00
2018-12-17 09:38:31 +01:00
2018-09-15 09:43:01 +02:00
2018-01-02 20:35:13 +01:00
2018-01-31 12:55:54 +01:00
2017-12-25 14:23:45 +01:00
2019-02-23 09:05:59 +01:00
2018-01-31 12:55:55 +01:00
2018-11-10 07:42:58 -08:00
2018-05-30 07:50:36 +02:00