Eric Dumazet
fce92af1c2
ipv4: annotate data-races around fi->fib_dead
...
syzbot complained about a data-race in fib_table_lookup() [1]
Add appropriate annotations to document it.
[1]
BUG: KCSAN: data-race in fib_release_info / fib_table_lookup
write to 0xffff888150f31744 of 1 bytes by task 1189 on cpu 0:
fib_release_info+0x3a0/0x460 net/ipv4/fib_semantics.c:281
fib_table_delete+0x8d2/0x900 net/ipv4/fib_trie.c:1777
fib_magic+0x1c1/0x1f0 net/ipv4/fib_frontend.c:1106
fib_del_ifaddr+0x8cf/0xa60 net/ipv4/fib_frontend.c:1317
fib_inetaddr_event+0x77/0x200 net/ipv4/fib_frontend.c:1448
notifier_call_chain kernel/notifier.c:93 [inline]
blocking_notifier_call_chain+0x90/0x200 kernel/notifier.c:388
__inet_del_ifa+0x4df/0x800 net/ipv4/devinet.c:432
inet_del_ifa net/ipv4/devinet.c:469 [inline]
inetdev_destroy net/ipv4/devinet.c:322 [inline]
inetdev_event+0x553/0xaf0 net/ipv4/devinet.c:1606
notifier_call_chain kernel/notifier.c:93 [inline]
raw_notifier_call_chain+0x6b/0x1c0 kernel/notifier.c:461
call_netdevice_notifiers_info net/core/dev.c:1962 [inline]
call_netdevice_notifiers_mtu+0xd2/0x130 net/core/dev.c:2037
dev_set_mtu_ext+0x30b/0x3e0 net/core/dev.c:8673
do_setlink+0x5be/0x2430 net/core/rtnetlink.c:2837
rtnl_setlink+0x255/0x300 net/core/rtnetlink.c:3177
rtnetlink_rcv_msg+0x807/0x8c0 net/core/rtnetlink.c:6445
netlink_rcv_skb+0x126/0x220 net/netlink/af_netlink.c:2549
rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6463
netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline]
netlink_unicast+0x56f/0x640 net/netlink/af_netlink.c:1365
netlink_sendmsg+0x665/0x770 net/netlink/af_netlink.c:1914
sock_sendmsg_nosec net/socket.c:725 [inline]
sock_sendmsg net/socket.c:748 [inline]
sock_write_iter+0x1aa/0x230 net/socket.c:1129
do_iter_write+0x4b4/0x7b0 fs/read_write.c:860
vfs_writev+0x1a8/0x320 fs/read_write.c:933
do_writev+0xf8/0x220 fs/read_write.c:976
__do_sys_writev fs/read_write.c:1049 [inline]
__se_sys_writev fs/read_write.c:1046 [inline]
__x64_sys_writev+0x45/0x50 fs/read_write.c:1046
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
read to 0xffff888150f31744 of 1 bytes by task 21839 on cpu 1:
fib_table_lookup+0x2bf/0xd50 net/ipv4/fib_trie.c:1585
fib_lookup include/net/ip_fib.h:383 [inline]
ip_route_output_key_hash_rcu+0x38c/0x12c0 net/ipv4/route.c:2751
ip_route_output_key_hash net/ipv4/route.c:2641 [inline]
__ip_route_output_key include/net/route.h:134 [inline]
ip_route_output_flow+0xa6/0x150 net/ipv4/route.c:2869
send4+0x1e7/0x500 drivers/net/wireguard/socket.c:61
wg_socket_send_skb_to_peer+0x94/0x130 drivers/net/wireguard/socket.c:175
wg_socket_send_buffer_to_peer+0xd6/0x100 drivers/net/wireguard/socket.c:200
wg_packet_send_handshake_initiation drivers/net/wireguard/send.c:40 [inline]
wg_packet_handshake_send_worker+0x10c/0x150 drivers/net/wireguard/send.c:51
process_one_work+0x434/0x860 kernel/workqueue.c:2600
worker_thread+0x5f2/0xa10 kernel/workqueue.c:2751
kthread+0x1d7/0x210 kernel/kthread.c:389
ret_from_fork+0x2e/0x40 arch/x86/kernel/process.c:145
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
value changed: 0x00 -> 0x01
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 21839 Comm: kworker/u4:18 Tainted: G W 6.5.0-syzkaller #0
Fixes: dccd9ecc3744 ("ipv4: Do not use dead fib_info entries.")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20230830095520.1046984-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-08-31 11:58:18 +02:00
..
2023-05-31 13:06:57 +02:00
2023-08-16 11:09:17 +01:00
2023-08-24 10:51:39 -07:00
2023-02-13 18:35:15 +08:00
2023-03-15 00:37:32 -07:00
2023-07-18 17:31:10 -07:00
2023-08-16 11:09:17 +01:00
2023-08-20 11:40:49 +01:00
2023-08-21 07:35:59 +01:00
2023-06-22 18:40:38 -07:00
2023-07-19 11:03:03 +01:00
2023-03-16 17:26:31 -07:00
2022-02-17 11:44:20 -08:00
2021-09-28 17:32:56 -07:00
2022-04-30 15:12:58 +01:00
2023-08-31 11:58:18 +02:00
2023-08-31 11:58:18 +02:00
2023-04-12 16:40:39 -07:00
2023-04-12 16:40:39 -07:00
2023-05-26 10:30:14 +01:00
2023-05-26 10:30:14 +01:00
2021-05-17 15:29:35 -07:00
2023-06-10 00:11:41 -07:00
2023-03-31 21:37:06 -07:00
2023-08-16 11:09:17 +01:00
2023-07-20 12:34:18 -07:00
2023-08-16 11:09:18 +01:00
2022-10-31 20:14:27 -07:00
2023-07-31 13:53:10 -07:00
2023-08-16 11:09:17 +01:00
2022-07-08 12:10:33 +01:00
2023-08-30 09:44:09 +01:00
2023-05-16 20:46:30 -07:00
2023-07-19 12:27:09 +01:00
2023-02-01 20:54:27 -08:00
2022-01-29 17:53:07 +00:00
2023-08-30 09:44:09 +01:00
2023-08-28 10:27:03 +01:00
2023-08-04 18:24:52 -07:00
2023-04-13 16:43:38 -07:00
2023-07-11 11:06:08 +02:00
2022-09-29 07:18:00 +02:00
2023-05-22 11:17:55 +01:00
2023-04-12 16:40:39 -07:00
2022-06-24 11:34:38 +01:00
2023-08-30 09:44:09 +01:00
2022-11-16 13:02:04 +00:00
2023-04-12 16:40:39 -07:00
2023-01-23 21:37:25 -08:00
2022-05-16 13:03:29 +02:00
2023-08-15 18:54:53 -07:00
2023-08-16 11:09:17 +01:00
2023-01-26 10:52:18 +01:00
2021-05-17 15:29:35 -07:00
2023-04-06 12:01:20 -07:00
2023-08-16 11:09:17 +01:00
2023-08-16 11:09:17 +01:00
2023-06-06 21:13:03 -07:00
2023-06-17 09:53:53 +01:00
2023-02-02 00:25:14 +01:00
2022-04-06 12:05:41 -07:00
2023-06-24 15:50:13 -07:00
2022-10-16 15:27:07 -07:00
2023-03-22 22:53:00 -07:00
2023-02-02 00:25:14 +01:00
2023-02-02 00:25:14 +01:00
2022-09-20 10:21:49 -07:00
2023-08-16 11:09:18 +01:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2023-08-16 11:09:17 +01:00
2023-08-24 10:51:39 -07:00
2022-04-06 12:05:41 -07:00
2023-08-04 15:33:39 -07:00
2023-08-16 11:09:17 +01:00
2022-04-06 12:05:41 -07:00
2023-06-10 00:11:41 -07:00
2023-08-18 19:29:36 -07:00
2022-12-20 03:13:45 +01:00
2022-04-28 13:02:01 -07:00
2023-03-18 12:23:34 +00:00
2022-04-06 12:05:41 -07:00
2023-08-18 12:44:56 -07:00
2023-01-19 09:26:16 -08:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2022-04-06 12:05:41 -07:00
2023-08-16 11:09:18 +01:00
2021-05-17 15:29:35 -07:00
2023-03-03 17:25:15 +01:00
2022-11-16 09:43:35 +00:00
2023-06-24 15:50:13 -07:00
2023-07-29 17:10:27 +01:00
2023-08-16 11:09:17 +01:00
2022-11-29 08:44:24 -08:00
2023-08-16 11:09:17 +01:00
2023-06-24 15:50:13 -07:00
2023-06-09 08:16:34 +02:00
2023-08-22 13:19:02 +02:00
2022-06-08 10:10:13 -07:00
2022-09-29 07:18:00 +02:00