Eric Dumazet
93ed54b15b
ipv4: fix suspicious RCU usage in fib_dump_info_fnhe()
sysbot reported that we lack appropriate rcu_read_lock()
protection in fib_dump_info_fnhe()
net/ipv4/route.c:2875 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
1 lock held by syz-executor609/8966:
#0: 00000000b7dbe288 (rtnl_mutex){+.+.}, at: netlink_dump+0xe7/0xfb0 net/netlink/af_netlink.c:2199
stack backtrace:
CPU: 0 PID: 8966 Comm: syz-executor609 Not tainted 5.2.0-rc5+ #43
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__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:5250
fib_dump_info_fnhe+0x9d9/0x1080 net/ipv4/route.c:2875
fn_trie_dump_leaf net/ipv4/fib_trie.c:2141 [inline]
fib_table_dump+0x64a/0xd00 net/ipv4/fib_trie.c:2175
inet_dump_fib+0x83c/0xa90 net/ipv4/fib_frontend.c:1004
rtnl_dump_all+0x295/0x490 net/core/rtnetlink.c:3445
netlink_dump+0x558/0xfb0 net/netlink/af_netlink.c:2244
__netlink_dump_start+0x5b1/0x7d0 net/netlink/af_netlink.c:2352
netlink_dump_start include/linux/netlink.h:226 [inline]
rtnetlink_rcv_msg+0x73d/0xb00 net/core/rtnetlink.c:5182
netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477
rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5237
netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1328
netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1917
sock_sendmsg_nosec net/socket.c:646 [inline]
sock_sendmsg+0xd7/0x130 net/socket.c:665
sock_write_iter+0x27c/0x3e0 net/socket.c:994
call_write_iter include/linux/fs.h:1872 [inline]
new_sync_write+0x4d3/0x770 fs/read_write.c:483
__vfs_write+0xe1/0x110 fs/read_write.c:496
vfs_write+0x20c/0x580 fs/read_write.c:558
ksys_write+0x14f/0x290 fs/read_write.c:611
__do_sys_write fs/read_write.c:623 [inline]
__se_sys_write fs/read_write.c:620 [inline]
__x64_sys_write+0x73/0xb0 fs/read_write.c:620
do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4401b9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffc8e134978 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004401b9
RDX: 000000000000001c RSI: 0000000020000000 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000000000010 R11: 0000000000000246 R12: 0000000000401a40
R13: 0000000000401ad0 R14: 0000000000000000 R15: 0000000000000000
Fixes: ee28906fd7 ("ipv4: Dump route exceptions if requested")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Stefano Brivio <sbrivio@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-26 09:07:39 -07:00
..
2019-05-21 12:33:38 -07:00
2019-06-25 01:32:59 +02:00
2019-05-31 08:34:32 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2019-05-21 11:28:45 +02:00
2019-05-30 11:26:32 -07:00
2019-06-24 09:02:47 -07:00
2019-06-05 17:37:15 +02:00
2019-05-21 10:50:45 +02:00
2019-06-24 10:18:48 -07:00
2019-06-04 19:26:49 -07:00
2019-06-07 11:00:14 -07:00
2019-06-17 20:20:36 -07:00
2019-06-24 10:18:48 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-07 11:00:14 -07:00
2019-06-07 11:00:14 -07:00
2019-06-22 08:59:24 -04:00
2019-05-30 11:26:32 -07:00
2019-06-19 11:37:47 -04:00
2019-06-07 11:00:14 -07:00
2019-05-21 10:50:45 +02:00
2019-02-08 21:50:15 -08:00
2019-04-08 15:22:40 -07:00
2019-06-19 11:37:47 -04:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-06-21 18:35:51 +02:00
2019-06-17 20:20:36 -07:00
2019-05-25 11:00:50 -07:00
2019-06-18 20:48:45 -04:00
2019-06-05 17:30:29 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-02-01 15:24:13 -08:00
2019-05-30 11:26:32 -07:00
2019-05-07 17:22:09 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 10:50:46 +02:00
2019-05-28 21:37:30 -07:00
2019-05-21 10:50:45 +02:00
2019-01-28 11:32:58 +01:00
2019-05-21 10:50:45 +02:00
2019-06-10 10:44:57 -07:00
2019-05-30 11:26:32 -07:00
2019-06-17 20:20:36 -07:00
2019-05-30 11:26:32 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2019-06-26 09:07:39 -07:00
2019-05-30 11:26:32 -07:00
2019-06-22 16:30:37 -07:00
2019-01-24 22:27:27 -08:00
2019-05-21 10:50:45 +02:00
2019-05-16 01:36:13 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2018-10-10 22:26:00 -07:00
2019-05-30 11:26:32 -07:00
2019-06-22 16:30:37 -07:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-06-17 20:20:36 -07:00
2019-06-17 20:20:36 -07:00
2019-05-21 10:50:45 +02:00
2019-05-01 11:47:54 -04:00
2019-06-12 13:05:43 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2019-06-22 08:59:24 -04:00
2019-05-21 10:50:45 +02:00
2018-09-21 19:37:59 -07:00
2019-05-21 10:50:45 +02:00
2019-06-15 18:47:31 -07:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2019-06-22 16:30:37 -07:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:32 -07:00
2019-01-17 15:01:08 -08:00
2019-06-22 08:59:24 -04:00
2019-05-21 10:50:45 +02:00
2019-06-17 20:20:36 -07:00
2019-05-30 11:26:32 -07:00
2018-09-04 10:26:30 +02:00
2019-05-30 11:26:32 -07:00
2019-04-30 09:26:13 -04:00
2019-05-30 11:26:32 -07:00
2019-05-21 10:50:45 +02:00