syzbot


KCSAN: data-race in ip_tunnel_get_stats64 / wg_packet_rx_poll

Status: auto-closed as invalid on 2020/10/31 14:13
Subsystems: wireguard
[Documentation on labels]
First crash: 1604d, last: 1584d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in ip_tunnel_get_stats64 / wg_packet_rx_poll

write to 0xffffe8ffffd731e0 of 8 bytes by interrupt on cpu 1:
 update_rx_stats drivers/net/wireguard/receive.c:26 [inline]
 wg_packet_consume_data_done drivers/net/wireguard/receive.c:364 [inline]
 wg_packet_rx_poll+0x1024/0x1300 drivers/net/wireguard/receive.c:482
 napi_poll+0x178/0x4f0 net/core/dev.c:6688
 net_rx_action+0x1ba/0x530 net/core/dev.c:6758
 __do_softirq+0x198/0x360 kernel/softirq.c:298
 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:706
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline]
 do_softirq_own_stack+0x5d/0x80 arch/x86/kernel/irq_64.c:77
 do_softirq+0x86/0xb0 kernel/softirq.c:343
 __local_bh_enable_ip+0x63/0x70 kernel/softirq.c:195
 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:176 [inline]
 _raw_spin_unlock_bh+0x33/0x40 kernel/locking/spinlock.c:207
 spin_unlock_bh include/linux/spinlock.h:399 [inline]
 ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline]
 wg_packet_decrypt_worker+0x6e7/0x720 drivers/net/wireguard/receive.c:507
 process_one_work+0x3e1/0x9a0 kernel/workqueue.c:2269
 worker_thread+0x665/0xbe0 kernel/workqueue.c:2415
 kthread+0x20d/0x230 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

read to 0xffffe8ffffd731e0 of 8 bytes by task 8749 on cpu 0:
 ip_tunnel_get_stats64+0xc2/0x1c0 net/ipv4/ip_tunnel_core.c:448
 dev_get_stats+0x65/0x180 net/core/dev.c:10163
 rtnl_fill_stats+0x45/0x320 net/core/rtnetlink.c:1209
 rtnl_fill_ifinfo+0xe92/0x2430 net/core/rtnetlink.c:1781
 rtmsg_ifinfo_build_skb+0xa8/0x130 net/core/rtnetlink.c:3808
 rtmsg_ifinfo_event net/core/rtnetlink.c:3840 [inline]
 rtmsg_ifinfo+0x58/0xc0 net/core/rtnetlink.c:3849
 __dev_notify_flags+0x63/0x390 net/core/dev.c:8319
 dev_change_flags+0xa2/0xc0 net/core/dev.c:8361
 do_setlink+0x736/0x2220 net/core/rtnetlink.c:2706
 __rtnl_newlink net/core/rtnetlink.c:3374 [inline]
 rtnl_newlink+0xe62/0x1340 net/core/rtnetlink.c:3500
 rtnetlink_rcv_msg+0x71b/0x7b0 net/core/rtnetlink.c:5563
 netlink_rcv_skb+0x13e/0x240 net/netlink/af_netlink.c:2470
 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5581
 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline]
 netlink_unicast+0x5e2/0x6b0 net/netlink/af_netlink.c:1330
 netlink_sendmsg+0x6d8/0x7a0 net/netlink/af_netlink.c:1919
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg net/socket.c:671 [inline]
 __sys_sendto+0x2ae/0x380 net/socket.c:1992
 __do_sys_sendto net/socket.c:2004 [inline]
 __se_sys_sendto net/socket.c:2000 [inline]
 __x64_sys_sendto+0x74/0x90 net/socket.c:2000
 do_syscall_64+0x39/0x80 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 8749 Comm: syz-executor.4 Not tainted 5.9.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/09/26 14:06 upstream 7c7ec3226f5f 2d5ea0cb .config console log report info ci2-upstream-kcsan-gce
2020/09/06 05:37 upstream 9322c47b21b9 abf9ba4f .config console log report ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.