syzbot


KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets (3)

Status: upstream: reported on 2022/02/08 08:32
Subsystems: wireguard
[Documentation on labels]
Reported-by: syzbot+6ba34f16b98fe40daef1@syzkaller.appspotmail.com
First crash: 908d, last: 1d01h
Discussions (9)
Title Replies (including bot) Last reply
[syzbot] Monthly wireguard report (May 2024) 0 (1) 2024/05/02 12:38
[syzbot] Monthly wireguard report (Feb 2024) 0 (1) 2024/02/21 10:58
[syzbot] Monthly wireguard report (Jan 2024) 0 (1) 2024/01/17 22:20
[syzbot] Monthly wireguard report (Dec 2023) 0 (1) 2023/12/02 14:45
[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_send_staged_packets / wg_packet_send_staged_packets (3) 0 (1) 2022/02/08 08:32
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets wireguard 15 1421d 1459d 0/26 closed as invalid on 2020/06/18 14:24
upstream KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets (2) wireguard 108 1124d 1291d 0/26 auto-closed as invalid on 2021/05/13 03:09

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

write to 0xffff888115e02b28 of 4 bytes by interrupt on cpu 1:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:130 [inline]
 wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:173 [inline]
 wg_packet_create_data drivers/net/wireguard/send.c:320 [inline]
 wg_packet_send_staged_packets+0x6f9/0xae0 drivers/net/wireguard/send.c:388
 wg_packet_send_keepalive+0xe2/0x100 drivers/net/wireguard/send.c:239
 wg_expired_send_persistent_keepalive+0x3c/0x50 drivers/net/wireguard/timers.c:141
 call_timer_fn+0x3a/0x300 kernel/time/timer.c:1793
 expire_timers kernel/time/timer.c:1844 [inline]
 __run_timers kernel/time/timer.c:2418 [inline]
 __run_timer_base+0x417/0x640 kernel/time/timer.c:2429
 run_timer_base kernel/time/timer.c:2438 [inline]
 run_timer_softirq+0x31/0x70 kernel/time/timer.c:2448
 __do_softirq+0xc8/0x285 kernel/softirq.c:554
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu kernel/softirq.c:633 [inline]
 irq_exit_rcu+0x3c/0x90 kernel/softirq.c:645
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0x73/0x80 arch/x86/kernel/apic/apic.c:1043
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
 __preempt_count_dec_and_test arch/x86/include/asm/preempt.h:94 [inline]
 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:160 [inline]
 _raw_spin_unlock_irq+0x2f/0x50 kernel/locking/spinlock.c:202
 spin_unlock_irq include/linux/spinlock.h:401 [inline]
 get_signal+0xc8e/0x1080 kernel/signal.c:2914
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x59/0x130 kernel/entry/common.c:218
 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888115e02b28 of 4 bytes by interrupt on cpu 0:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:127 [inline]
 wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:173 [inline]
 wg_packet_create_data drivers/net/wireguard/send.c:320 [inline]
 wg_packet_send_staged_packets+0x614/0xae0 drivers/net/wireguard/send.c:388
 wg_packet_send_keepalive+0xe2/0x100 drivers/net/wireguard/send.c:239
 wg_expired_send_persistent_keepalive+0x3c/0x50 drivers/net/wireguard/timers.c:141
 call_timer_fn+0x3a/0x300 kernel/time/timer.c:1793
 expire_timers kernel/time/timer.c:1844 [inline]
 __run_timers kernel/time/timer.c:2418 [inline]
 __run_timer_base+0x417/0x640 kernel/time/timer.c:2429
 run_timer_base kernel/time/timer.c:2438 [inline]
 run_timer_softirq+0x31/0x70 kernel/time/timer.c:2448
 __do_softirq+0xc8/0x285 kernel/softirq.c:554
 invoke_softirq kernel/softirq.c:428 [inline]
 __irq_exit_rcu kernel/softirq.c:633 [inline]
 irq_exit_rcu+0x3c/0x90 kernel/softirq.c:645
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
 sysvec_apic_timer_interrupt+0x73/0x80 arch/x86/kernel/apic/apic.c:1043
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
 kcsan_setup_watchpoint+0x404/0x410 kernel/kcsan/core.c:705
 instrument_copy_to_user include/linux/instrumented.h:113 [inline]
 _copy_to_user+0x66/0xa0 lib/usercopy.c:40
 copy_to_user include/linux/uaccess.h:191 [inline]
 copy_siginfo_to_user+0x24/0x90 kernel/signal.c:3380
 x64_setup_rt_frame+0x29a/0x570 arch/x86/kernel/signal_64.c:194
 setup_rt_frame arch/x86/kernel/signal.c:223 [inline]
 handle_signal arch/x86/kernel/signal.c:267 [inline]
 arch_do_signal_or_restart+0x287/0x4b0 arch/x86/kernel/signal.c:312
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline]
 syscall_exit_to_user_mode+0x59/0x130 kernel/entry/common.c:218
 do_syscall_64+0xda/0x1d0 arch/x86/entry/common.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000000 -> 0x00000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 7283 Comm: syz-executor.3 Tainted: G        W          6.9.0-rc6-syzkaller-00290-gb9158815de52 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
==================================================================

Crashes (942):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/05 20:19 upstream b9158815de52 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/05/04 22:15 upstream 7367539ad4b0 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/05/03 22:30 upstream ddb4c3f25b7b dd26401e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/05/02 06:47 upstream 0106679839f7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/05/01 07:42 upstream 18daea77cca6 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/29 01:20 upstream e67572cd2204 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/28 14:12 upstream 2c8159388952 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/27 22:02 upstream 5d12ed4bea43 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/26 23:18 upstream c942a0cd3603 059e9963 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/25 21:30 upstream e33c4963bf53 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/25 05:11 upstream e88c4cfcb7b8 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/24 06:06 upstream 9d1ddab261f3 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/23 10:51 upstream 71b1543c83d6 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/23 04:27 upstream a2c63a3f3d68 36c961ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/22 11:22 upstream ed30a4a51bb1 36c961ad .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/22 00:42 upstream 48cf398f15fc af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/21 07:32 upstream 977b1ef51866 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/20 10:20 upstream 13a2e429f644 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/20 00:24 upstream 3cdb45594619 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/18 23:44 upstream 2668e3ae2ef3 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/18 04:40 upstream 4b6b51322118 acc528cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/17 15:44 upstream 96fca68c4fbf acc528cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/16 12:01 upstream 96fca68c4fbf 0d592ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/16 01:35 upstream 0bbac3facb5d b9af7e61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/15 10:19 upstream 0bbac3facb5d c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/15 05:56 upstream 399f4dae683a c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/14 05:15 upstream 7efd0a74039f c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/12 21:49 upstream 5939d45155bb c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/10 22:30 upstream 2c71fdf02a95 4320ec32 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/09 15:28 upstream 20cb38a7af88 f3234354 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/07 09:11 upstream f2f80ac80987 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/06 12:26 upstream 104db052b62d ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/05 04:52 upstream c88b9b4cde17 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/04 22:24 upstream c85af715cac0 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/02 20:53 upstream 026e680b0a08 eb2966c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/02 08:01 upstream 026e680b0a08 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/04/01 04:27 upstream 18737353cca0 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/03/30 15:05 upstream 486291a0e624 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/03/30 08:10 upstream 4535e1a4174c 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/03/28 09:20 upstream 8d025e2092e2 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/03/28 07:40 upstream 498e47cd1d1f 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/03/26 07:54 upstream 928a87efa423 bcd9b39f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2024/03/25 20:13 upstream 4cece7649650 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2022/02/08 02:40 upstream 2ade8eef993c a7dab638 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2022/01/11 04:05 upstream 133d9c53c9dc ddb0ab8c .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
2021/11/10 04:03 upstream cb690f5238d7 55fa030c .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_send_staged_packets / wg_packet_send_staged_packets
* Struck through repros no longer work on HEAD.