syzbot


KCSAN: data-race in wg_packet_receive / wg_packet_receive (6)

Status: auto-obsoleted due to no activity on 2023/04/07 02:56
Subsystems: wireguard
[Documentation on labels]
First crash: 470d, last: 432d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (5) wireguard 1 525d 525d 0/26 auto-obsoleted due to no activity on 2023/01/02 14:24
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive wireguard 2 878d 895d 0/26 auto-closed as invalid on 2022/01/05 08:53
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (4) wireguard 2 597d 600d 0/26 auto-obsoleted due to no activity on 2022/10/12 22:27
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (7) wireguard 1 76d 74d 0/26 auto-obsoleted due to no activity on 2024/03/16 22:23
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (3) wireguard 2 691d 695d 0/26 auto-closed as invalid on 2022/07/11 09:31
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (2) wireguard 1 747d 747d 0/26 auto-closed as invalid on 2022/05/15 18:55

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

write to 0xffff888137344bc8 of 4 bytes by interrupt on cpu 1:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:133 [inline]
 wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:176 [inline]
 wg_packet_consume_data drivers/net/wireguard/receive.c:526 [inline]
 wg_packet_receive+0xcca/0x11a0 drivers/net/wireguard/receive.c:576
 wg_receive+0x4e/0x70 drivers/net/wireguard/socket.c:326
 udpv6_queue_rcv_one_skb+0x922/0xa30 net/ipv6/udp.c:731
 udpv6_queue_rcv_skb+0x2b8/0x2f0 net/ipv6/udp.c:792
 udp6_unicast_rcv_skb+0x16b/0x180 net/ipv6/udp.c:935
 __udp6_lib_rcv+0x809/0x970 net/ipv6/udp.c:1020
 udpv6_rcv+0x4f/0x60 net/ipv6/udp.c:1133
 ip6_protocol_deliver_rcu+0x93c/0xfb0 net/ipv6/ip6_input.c:439
 ip6_input_finish net/ipv6/ip6_input.c:484 [inline]
 NF_HOOK include/linux/netfilter.h:302 [inline]
 ip6_input+0xbf/0x1b0 net/ipv6/ip6_input.c:493
 dst_input include/net/dst.h:454 [inline]
 ip6_rcv_finish+0x1e2/0x2e0 net/ipv6/ip6_input.c:79
 NF_HOOK include/linux/netfilter.h:302 [inline]
 ipv6_rcv+0x74/0x150 net/ipv6/ip6_input.c:309
 __netif_receive_skb_one_core net/core/dev.c:5474 [inline]
 __netif_receive_skb+0x90/0x1b0 net/core/dev.c:5588
 process_backlog+0x21f/0x380 net/core/dev.c:5916
 __napi_poll+0x60/0x3b0 net/core/dev.c:6477
 napi_poll net/core/dev.c:6544 [inline]
 net_rx_action+0x328/0x6c0 net/core/dev.c:6655
 __do_softirq+0xe4/0x2b0 kernel/softirq.c:571
 do_softirq+0xb5/0xf0 kernel/softirq.c:472
 __local_bh_enable_ip+0x73/0x80 kernel/softirq.c:396
 __raw_read_unlock_bh include/linux/rwlock_api_smp.h:257 [inline]
 _raw_read_unlock_bh+0x1b/0x20 kernel/locking/spinlock.c:284
 wg_socket_send_skb_to_peer+0x109/0x130 drivers/net/wireguard/socket.c:184
 wg_packet_create_data_done drivers/net/wireguard/send.c:251 [inline]
 wg_packet_tx_worker+0x128/0x320 drivers/net/wireguard/send.c:276
 process_one_work+0x3e6/0x750 kernel/workqueue.c:2289
 worker_thread+0x5ef/0xa10 kernel/workqueue.c:2436
 kthread+0x1ac/0x1e0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

read to 0xffff888137344bc8 of 4 bytes by interrupt on cpu 0:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:129 [inline]
 wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:176 [inline]
 wg_packet_consume_data drivers/net/wireguard/receive.c:526 [inline]
 wg_packet_receive+0xc4f/0x11a0 drivers/net/wireguard/receive.c:576
 wg_receive+0x4e/0x70 drivers/net/wireguard/socket.c:326
 udp_queue_rcv_one_skb+0xa49/0xb30 net/ipv4/udp.c:2164
 udp_queue_rcv_skb+0x2b3/0x2f0 net/ipv4/udp.c:2241
 udp_unicast_rcv_skb+0x198/0x1c0 net/ipv4/udp.c:2401
 __udp4_lib_rcv+0xa8d/0xec0 net/ipv4/udp.c:2473
 udp_rcv+0x4f/0x60 net/ipv4/udp.c:2655
 ip_protocol_deliver_rcu+0x356/0x6f0 net/ipv4/ip_input.c:205
 ip_local_deliver_finish+0x13d/0x1b0 net/ipv4/ip_input.c:233
 NF_HOOK include/linux/netfilter.h:302 [inline]
 ip_local_deliver+0xec/0x1c0 net/ipv4/ip_input.c:254
 dst_input include/net/dst.h:454 [inline]
 ip_rcv_finish net/ipv4/ip_input.c:449 [inline]
 NF_HOOK include/linux/netfilter.h:302 [inline]
 ip_rcv+0x197/0x270 net/ipv4/ip_input.c:569
 __netif_receive_skb_one_core net/core/dev.c:5474 [inline]
 __netif_receive_skb+0x90/0x1b0 net/core/dev.c:5588
 process_backlog+0x21f/0x380 net/core/dev.c:5916
 __napi_poll+0x60/0x3b0 net/core/dev.c:6477
 napi_poll net/core/dev.c:6544 [inline]
 net_rx_action+0x328/0x6c0 net/core/dev.c:6655
 __do_softirq+0xe4/0x2b0 kernel/softirq.c:571
 do_softirq+0xb5/0xf0 kernel/softirq.c:472
 __local_bh_enable_ip+0x73/0x80 kernel/softirq.c:396
 __raw_read_unlock_bh include/linux/rwlock_api_smp.h:257 [inline]
 _raw_read_unlock_bh+0x1b/0x20 kernel/locking/spinlock.c:284
 wg_socket_send_skb_to_peer+0x109/0x130 drivers/net/wireguard/socket.c:184
 wg_packet_create_data_done drivers/net/wireguard/send.c:251 [inline]
 wg_packet_tx_worker+0x128/0x320 drivers/net/wireguard/send.c:276
 process_one_work+0x3e6/0x750 kernel/workqueue.c:2289
 worker_thread+0x5ef/0xa10 kernel/workqueue.c:2436
 kthread+0x1ac/0x1e0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

value changed: 0x00000000 -> 0x00000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 8770 Comm: kworker/0:0 Not tainted 6.2.0-rc8-syzkaller-00151-g925cf0457d7e-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Workqueue: wg-crypt-wg2 wg_packet_tx_worker
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/19 17:47 upstream 925cf0457d7e bcdf85f8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_receive / wg_packet_receive
2023/01/13 02:04 upstream e8f60cd7db24 96166539 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_receive / wg_packet_receive
* Struck through repros no longer work on HEAD.