syzbot


KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (3)

Status: auto-closed as invalid on 2022/02/22 09:23
Subsystems: wireguard
[Documentation on labels]
Reported-by: syzbot+ed414b05fe54c96947f8@syzkaller.appspotmail.com
First crash: 1067d, last: 1045d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (3) 1 (2) 2022/02/08 09:22
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (7) wireguard 1 320d 317d 0/28 auto-obsoleted due to no activity on 2024/02/12 20:57
upstream KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (5) wireguard 2 457d 454d 0/28 auto-obsoleted due to no activity on 2023/09/29 02:04
upstream KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (6) wireguard 3 363d 358d 0/28 auto-obsoleted due to no activity on 2024/01/01 00:52
upstream KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll wireguard 3 1549d 1569d 0/28 auto-closed as invalid on 2020/10/01 18:48
upstream KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (4) wireguard 1 571d 571d 0/28 auto-obsoleted due to no activity on 2023/06/06 16:15
upstream KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (8) wireguard 2 217d 241d 0/28 auto-obsoleted due to no activity on 2024/05/26 12:41
upstream KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll (2) wireguard 1 1482d 1444d 0/28 auto-closed as invalid on 2020/12/25 11:24

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

read to 0xffff88813238a9e0 of 8 bytes by interrupt on cpu 1:
 update_rx_stats drivers/net/wireguard/receive.c:28 [inline]
 wg_packet_consume_data_done drivers/net/wireguard/receive.c:365 [inline]
 wg_packet_rx_poll+0xf6b/0x11f0 drivers/net/wireguard/receive.c:481
 __napi_poll+0x65/0x3f0 net/core/dev.c:6365
 napi_poll net/core/dev.c:6432 [inline]
 net_rx_action+0x29e/0x650 net/core/dev.c:6519
 __do_softirq+0x158/0x2de kernel/softirq.c:558
 do_softirq+0xb1/0xf0 kernel/softirq.c:459
 __local_bh_enable_ip+0x68/0x70 kernel/softirq.c:383
 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline]
 _raw_spin_unlock_bh+0x33/0x40 kernel/locking/spinlock.c:210
 spin_unlock_bh include/linux/spinlock.h:394 [inline]
 ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline]
 wg_packet_decrypt_worker+0x73c/0x780 drivers/net/wireguard/receive.c:506
 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307
 worker_thread+0x616/0xa70 kernel/workqueue.c:2454
 kthread+0x2c7/0x2e0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30

write to 0xffff88813238a9e0 of 8 bytes by task 5035 on cpu 0:
 update_rx_stats drivers/net/wireguard/receive.c:28 [inline]
 wg_receive_handshake_packet drivers/net/wireguard/receive.c:205 [inline]
 wg_packet_handshake_receive_worker+0x54a/0x6e0 drivers/net/wireguard/receive.c:220
 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307
 worker_thread+0x616/0xa70 kernel/workqueue.c:2454
 kthread+0x2c7/0x2e0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30

value changed: 0x0000000000000aa8 -> 0x0000000000000ac8

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 5035 Comm: kworker/0:60 Not tainted 5.16.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: wg-kex-wg2 wg_packet_handshake_receive_worker
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/01/14 02:56 upstream 455e73a07f6e b8d780ab .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll
2021/12/23 01:46 upstream bc491fb12513 6caa12e4 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_handshake_receive_worker / wg_packet_rx_poll
* Struck through repros no longer work on HEAD.