syzbot


KCSAN: data-race in wg_packet_receive / wg_packet_receive

Status: auto-closed as invalid on 2022/01/05 08:53
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 379d, last: 362d
similar bugs (3):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (4) 2 81d 83d 0/24 auto-obsoleted due to no activity on 2022/10/12 22:27
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (3) 2 175d 179d 0/24 auto-closed as invalid on 2022/07/11 09:31
upstream KCSAN: data-race in wg_packet_receive / wg_packet_receive (2) 1 231d 231d 0/24 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 0xffff88813e02bb48 of 4 bytes by interrupt on cpu 0:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:135 [inline]
 wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:178 [inline]
 wg_packet_consume_data drivers/net/wireguard/receive.c:532 [inline]
 wg_packet_receive+0x7cd/0xba0 drivers/net/wireguard/receive.c:576
 wg_receive+0x4a/0x70 drivers/net/wireguard/socket.c:325
 udp_queue_rcv_one_skb+0x7bc/0x8c0 net/ipv4/udp.c:2155
 udp_queue_rcv_skb+0x56b/0x590 net/ipv4/udp.c:2229
 udp_unicast_rcv_skb net/ipv4/udp.c:2389 [inline]
 __udp4_lib_rcv+0x1267/0x1ba0 net/ipv4/udp.c:2458
 udp_rcv+0x1d/0x20 net/ipv4/udp.c:2629
 ip_protocol_deliver_rcu+0x291/0x540 net/ipv4/ip_input.c:204
 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ip_local_deliver+0x1d6/0x2a0 net/ipv4/ip_input.c:252
 dst_input include/net/dst.h:460 [inline]
 ip_rcv_finish net/ipv4/ip_input.c:429 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ip_rcv+0x1a6/0x250 net/ipv4/ip_input.c:540
 __netif_receive_skb_one_core net/core/dev.c:5462 [inline]
 __netif_receive_skb+0x8b/0x1b0 net/core/dev.c:5576
 process_backlog+0x23f/0x3e0 net/core/dev.c:6452
 __napi_poll+0x65/0x3f0 net/core/dev.c:7020
 napi_poll net/core/dev.c:7087 [inline]
 net_rx_action+0x29e/0x650 net/core/dev.c:7174
 __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_read_unlock_bh include/linux/rwlock_api_smp.h:249 [inline]
 _raw_read_unlock_bh+0x17/0x20 kernel/locking/spinlock.c:284
 wg_socket_send_skb_to_peer+0x112/0x130 drivers/net/wireguard/socket.c:183
 wg_packet_create_data_done drivers/net/wireguard/send.c:251 [inline]
 wg_packet_tx_worker+0x142/0x360 drivers/net/wireguard/send.c:276
 process_one_work+0x3fc/0x980 kernel/workqueue.c:2298
 worker_thread+0x616/0xa70 kernel/workqueue.c:2445
 kthread+0x2c7/0x2e0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30

read to 0xffff88813e02bb48 of 4 bytes by interrupt on cpu 1:
 wg_cpumask_next_online drivers/net/wireguard/queueing.h:131 [inline]
 wg_queue_enqueue_per_device_and_peer drivers/net/wireguard/queueing.h:178 [inline]
 wg_packet_consume_data drivers/net/wireguard/receive.c:532 [inline]
 wg_packet_receive+0x789/0xba0 drivers/net/wireguard/receive.c:576
 wg_receive+0x4a/0x70 drivers/net/wireguard/socket.c:325
 udpv6_queue_rcv_one_skb+0xac2/0xbd0 net/ipv6/udp.c:701
 udpv6_queue_rcv_skb+0x56b/0x590 net/ipv6/udp.c:759
 udp6_unicast_rcv_skb net/ipv6/udp.c:902 [inline]
 __udp6_lib_rcv+0xca5/0x16d0 net/ipv6/udp.c:986
 udpv6_rcv+0x1d/0x20 net/ipv6/udp.c:1088
 ip6_protocol_deliver_rcu+0x8bf/0xdd0 net/ipv6/ip6_input.c:422
 ip6_input_finish net/ipv6/ip6_input.c:463 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ip6_input+0x73/0x120 net/ipv6/ip6_input.c:472
 dst_input include/net/dst.h:460 [inline]
 ip6_rcv_finish+0x1d6/0x260 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:5462 [inline]
 __netif_receive_skb+0x8b/0x1b0 net/core/dev.c:5576
 process_backlog+0x23f/0x3e0 net/core/dev.c:6452
 __napi_poll+0x65/0x3f0 net/core/dev.c:7020
 napi_poll net/core/dev.c:7087 [inline]
 net_rx_action+0x29e/0x650 net/core/dev.c:7174
 __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_read_unlock_bh include/linux/rwlock_api_smp.h:249 [inline]
 _raw_read_unlock_bh+0x17/0x20 kernel/locking/spinlock.c:284
 wg_socket_send_skb_to_peer+0x112/0x130 drivers/net/wireguard/socket.c:183
 wg_packet_create_data_done drivers/net/wireguard/send.c:251 [inline]
 wg_packet_tx_worker+0x142/0x360 drivers/net/wireguard/send.c:276
 process_one_work+0x3fc/0x980 kernel/workqueue.c:2298
 worker_thread+0x616/0xa70 kernel/workqueue.c:2445
 kthread+0x2c7/0x2e0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30

value changed: 0x00000001 -> 0x00000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 1918 Comm: kworker/1:5 Not tainted 5.16.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: wg-crypt-wg0 wg_packet_tx_worker
==================================================================

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/12/01 08:45 upstream 58e1100fdc59 5fa3eacc .config log report info KCSAN: data-race in wg_packet_receive / wg_packet_receive
ci2-upstream-kcsan-gce 2021/11/14 11:34 upstream c8c109546a19 75b04091 .config log report info KCSAN: data-race in wg_packet_receive / wg_packet_receive
* Struck through repros no longer work on HEAD.