syzbot


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

Status: auto-closed as invalid on 2022/05/15 18:55
Subsystems: wireguard
[Documentation on labels]
First crash: 739d, last: 739d
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 517d 517d 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 869d 886d 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 589d 591d 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 68d 66d 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 682d 687d 0/26 auto-closed as invalid on 2022/07/11 09:31
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (6) wireguard 2 424d 462d 0/26 auto-obsoleted due to no activity on 2023/04/07 02:56

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

write to 0xffff888134897cc8 of 4 bytes by interrupt on cpu 0:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:133 [inline]
 wg_packet_receive+0x7de/0xdb0 drivers/net/wireguard/receive.c:575
 wg_receive+0x4a/0x70 drivers/net/wireguard/socket.c:326
 udp_queue_rcv_one_skb+0x7ba/0x8c0 net/ipv4/udp.c:2163
 udp_queue_rcv_skb+0x2b1/0x2d0 net/ipv4/udp.c:2240
 udp_unicast_rcv_skb+0x198/0x1c0 net/ipv4/udp.c:2400
 __udp4_lib_rcv+0xa24/0xe90 net/ipv4/udp.c:2472
 udp_rcv+0x1d/0x20 net/ipv4/udp.c:2646
 ip_protocol_deliver_rcu+0x25a/0x4d0 net/ipv4/ip_input.c:205
 ip_local_deliver_finish+0x126/0x160 net/ipv4/ip_input.c:233
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ip_local_deliver+0x100/0x1b0 net/ipv4/ip_input.c:254
 dst_input include/net/dst.h:461 [inline]
 ip_rcv_finish net/ipv4/ip_input.c:437 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ip_rcv+0x1b1/0x260 net/ipv4/ip_input.c:556
 __netif_receive_skb_one_core net/core/dev.c:5405 [inline]
 __netif_receive_skb+0x8b/0x1b0 net/core/dev.c:5519
 process_backlog+0x23f/0x3b0 net/core/dev.c:5847
 __napi_poll+0x65/0x390 net/core/dev.c:6413
 napi_poll net/core/dev.c:6480 [inline]
 net_rx_action+0x29e/0x650 net/core/dev.c:6567
 __do_softirq+0x158/0x2e3 kernel/softirq.c:558
 do_softirq+0xb1/0xf0 kernel/softirq.c:459
 __local_bh_enable_ip+0x6f/0x80 kernel/softirq.c:383
 __raw_read_unlock_bh include/linux/rwlock_api_smp.h:257 [inline]
 _raw_read_unlock_bh+0x17/0x20 kernel/locking/spinlock.c:284
 wg_socket_send_skb_to_peer+0x107/0x120 drivers/net/wireguard/socket.c:184
 wg_socket_send_buffer_to_peer+0xd2/0xf0 drivers/net/wireguard/socket.c:200
 wg_packet_send_handshake_initiation drivers/net/wireguard/send.c:40 [inline]
 wg_packet_handshake_send_worker+0x109/0x150 drivers/net/wireguard/send.c:51
 process_one_work+0x3d3/0x720 kernel/workqueue.c:2289
 worker_thread+0x618/0xa70 kernel/workqueue.c:2436
 kthread+0x1a9/0x1e0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30

read to 0xffff888134897cc8 of 4 bytes by interrupt on cpu 1:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:129 [inline]
 wg_packet_receive+0x798/0xdb0 drivers/net/wireguard/receive.c:575
 wg_receive+0x4a/0x70 drivers/net/wireguard/socket.c:326
 udpv6_queue_rcv_one_skb+0xa62/0xb70 net/ipv6/udp.c:703
 udpv6_queue_rcv_skb+0x2c1/0x2e0 net/ipv6/udp.c:761
 udp6_unicast_rcv_skb+0x16b/0x190 net/ipv6/udp.c:904
 __udp6_lib_rcv+0x7ec/0x910 net/ipv6/udp.c:989
 udpv6_rcv+0x1d/0x20 net/ipv6/udp.c:1097
 ip6_protocol_deliver_rcu+0x882/0xd10 net/ipv6/ip6_input.c:422
 ip6_input_finish net/ipv6/ip6_input.c:464 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ip6_input+0xca/0x180 net/ipv6/ip6_input.c:473
 dst_input include/net/dst.h:461 [inline]
 ip6_rcv_finish+0x1de/0x270 net/ipv6/ip6_input.c:76
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ipv6_rcv+0x85/0x140 net/ipv6/ip6_input.c:297
 __netif_receive_skb_one_core net/core/dev.c:5405 [inline]
 __netif_receive_skb+0x8b/0x1b0 net/core/dev.c:5519
 process_backlog+0x23f/0x3b0 net/core/dev.c:5847
 __napi_poll+0x65/0x390 net/core/dev.c:6413
 napi_poll net/core/dev.c:6480 [inline]
 net_rx_action+0x29e/0x650 net/core/dev.c:6567
 __do_softirq+0x158/0x2e3 kernel/softirq.c:558
 do_softirq+0xb1/0xf0 kernel/softirq.c:459
 __local_bh_enable_ip+0x6f/0x80 kernel/softirq.c:383
 __raw_read_unlock_bh include/linux/rwlock_api_smp.h:257 [inline]
 _raw_read_unlock_bh+0x17/0x20 kernel/locking/spinlock.c:284
 wg_socket_send_skb_to_peer+0x107/0x120 drivers/net/wireguard/socket.c:184
 wg_socket_send_buffer_to_peer+0xd2/0xf0 drivers/net/wireguard/socket.c:200
 wg_packet_send_handshake_initiation drivers/net/wireguard/send.c:40 [inline]
 wg_packet_handshake_send_worker+0x109/0x150 drivers/net/wireguard/send.c:51
 process_one_work+0x3d3/0x720 kernel/workqueue.c:2289
 worker_thread+0x618/0xa70 kernel/workqueue.c:2436
 kthread+0x1a9/0x1e0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30

value changed: 0x00000000 -> 0x00000001

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 44 Comm: kworker/u4:2 Not tainted 5.18.0-rc1-syzkaller-00350-g1862a69c9174-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: wg-kex-wg0 wg_packet_handshake_send_worker
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/10 18:46 upstream 1862a69c9174 e22c3da3 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in wg_packet_receive / wg_packet_receive
* Struck through repros no longer work on HEAD.