syzbot


KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll (2)

Status: fixed on 2024/04/10 03:59
Subsystems: wireguard
[Documentation on labels]
Reported-by: syzbot+d1de830e4ecdaac83d89@syzkaller.appspotmail.com
Fix commit: bba045dc4d99 wireguard: receive: annotate data-race around receiving_counter.counter
First crash: 1124d, last: 264d
Discussions (18)
Title Replies (including bot) Last reply
[PATCH 5.10 225/238] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/03/24 23:40
[PATCH 5.15 300/317] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/03/24 23:34
[PATCH 6.1 421/451] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/03/24 23:11
[PATCH 6.6 609/638] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/03/24 23:00
[PATCH 6.7 680/713] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/03/24 22:46
[PATCH 6.8 682/715] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/03/24 22:34
[PATCH net 1/6] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/03/14 22:49
[syzbot] Monthly wireguard report (Feb 2024) 0 (1) 2024/02/21 10:58
[PATCH RESEND net v2] wireguard: receive: annotate data-race around receiving_counter.counter 2 (2) 2024/02/06 19:08
[PATCH net v2] wireguard: receive: annotate data-race around receiving_counter.counter 1 (1) 2024/01/16 12:59
[PATCH net] wireguard: receive: annotate data-race around receiving_counter.counter 3 (3) 2024/01/11 17:28
[syzbot] Monthly wireguard report (Dec 2023) 0 (1) 2023/12/02 14:45
[PATCH net] wireguard: receive: fix data-race around receiving_counter.counter 1 (1) 2023/08/23 17:38
[syzbot] Monthly wireguard report (Aug 2023) 0 (1) 2023/08/21 20:40
[syzbot] Monthly wireguard report (Jul 2023) 0 (1) 2023/07/14 09:49
Re: [syzbot] Monthly wireguard report (Apr 2023) 1 (1) 2023/05/02 09:03
[syzbot] Monthly wireguard report (Apr 2023) 0 (1) 2023/05/01 09:03
[syzbot] KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll (2) 0 (1) 2022/02/08 08:33
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll wireguard 253 1335d 1575d 0/28 auto-closed as invalid on 2021/05/20 04:01

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

write to 0xffff888112fff088 of 8 bytes by interrupt on cpu 0:
 counter_validate drivers/net/wireguard/receive.c:321 [inline]
 wg_packet_rx_poll+0x3ad/0xfc0 drivers/net/wireguard/receive.c:461
 __napi_poll+0x63/0x3c0 net/core/dev.c:6632
 napi_poll net/core/dev.c:6701 [inline]
 net_rx_action+0x324/0x720 net/core/dev.c:6813
 __do_softirq+0xc8/0x285 kernel/softirq.c:554
 do_softirq+0x5e/0x90 kernel/softirq.c:455
 __local_bh_enable_ip+0x6e/0x70 kernel/softirq.c:382
 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline]
 _raw_spin_unlock_bh+0x36/0x40 kernel/locking/spinlock.c:210
 spin_unlock_bh include/linux/spinlock.h:396 [inline]
 ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline]
 wg_packet_decrypt_worker+0x173/0x6f0 drivers/net/wireguard/receive.c:499
 process_one_work kernel/workqueue.c:3254 [inline]
 process_scheduled_works+0x465/0x990 kernel/workqueue.c:3335
 worker_thread+0x526/0x730 kernel/workqueue.c:3416
 kthread+0x1d1/0x210 kernel/kthread.c:388
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243

read to 0xffff888112fff088 of 8 bytes by task 3983 on cpu 1:
 decrypt_packet drivers/net/wireguard/receive.c:252 [inline]
 wg_packet_decrypt_worker+0x222/0x6f0 drivers/net/wireguard/receive.c:501
 process_one_work kernel/workqueue.c:3254 [inline]
 process_scheduled_works+0x465/0x990 kernel/workqueue.c:3335
 worker_thread+0x526/0x730 kernel/workqueue.c:3416
 kthread+0x1d1/0x210 kernel/kthread.c:388
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243

value changed: 0x00000000000000d6 -> 0x00000000000000d8

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 3983 Comm: kworker/1:7 Tainted: G        W          6.8.0-syzkaller-11752-gdba89d1b81df #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
Workqueue: wg-crypt-wg2 wg_packet_decrypt_worker
==================================================================

Crashes (721):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/03/21 10:17 upstream dba89d1b81df 6753db5c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/20 21:25 upstream a4145ce1e7bc 5b7d42ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/20 09:07 upstream a4145ce1e7bc a485f239 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/19 15:45 upstream b3603fcb79b1 e104824c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/18 19:17 upstream f6cef5f8c37f baa80228 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/18 03:05 upstream 906a93befec8 d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/17 07:19 upstream 741e9d668aa5 d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/17 01:12 upstream 66a27abac311 d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/16 04:57 upstream 82affc97affb d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/15 12:46 upstream e5eb28f6d1af d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/14 09:30 upstream 480e035fc4c7 8d8ee116 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/14 08:02 upstream 480e035fc4c7 f919f202 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/13 19:27 upstream 61387b8dcf1d f919f202 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/12 19:59 upstream 855684c7d938 c35c26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/12 03:13 upstream 045395d86acd 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/11 15:57 upstream e8f897f4afef 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/11 04:10 upstream fa4b851b4ad6 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/10 11:57 upstream 005f6f34bd47 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/09 22:56 upstream 09e5c48fea17 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/09 12:37 upstream 10d48d70e82d 6ee49f2e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/08 17:15 upstream 3aaa8ce7a335 8e75c913 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/08 08:56 upstream 3aaa8ce7a335 cf82cde1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/06 16:51 upstream 5847c9777c30 f39a7eed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/06 00:08 upstream 29cd507cbec2 f39a7eed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/05 16:09 upstream 90d35da658da f39a7eed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/05 03:20 upstream 90d35da658da 5fc53669 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/04 15:00 upstream 90d35da658da 3717835d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/02 22:17 upstream 5ad3cb0ed525 25905f5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/03/02 02:32 upstream 17ba56605bfd 25905f5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/29 20:05 upstream 805d849d7c3c 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/29 06:28 upstream e326df53af00 352ab904 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/28 02:26 upstream cf1182944c7c d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/27 20:46 upstream 45ec2f5f6ed3 d367cbe5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/27 04:59 upstream 45ec2f5f6ed3 05e69c83 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/26 01:52 upstream 70ff1fe626a1 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/24 01:03 upstream 603c04e27c3e 8d446f15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/22 10:25 upstream 39133352cbed 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/21 11:20 upstream 9fc1ccccfd8d 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/20 23:34 upstream fca7526b7d89 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/19 16:34 upstream b401b621758e 3af7dd65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/19 08:55 upstream b401b621758e 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2024/02/18 21:26 upstream c02197fc9076 578f7538 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2022/02/07 22:27 upstream 2ade8eef993c a7dab638 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
2021/11/11 20:10 upstream debe436e77c7 75b04091 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_decrypt_worker / wg_packet_rx_poll
* Struck through repros no longer work on HEAD.