[syzbot] [wireguard?] KCSAN: data-race in wg_packet_receive / wg_packet_receive (7)
syzbot
syzbot+fd07f3da9110f5f18b4f at syzkaller.appspotmail.com
Mon Feb 12 21:26:16 UTC 2024
Hello,
syzbot found the following issue on:
HEAD commit: a5b6244cf87c Merge tag 'block-6.8-2024-02-10' of git://git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=126f51e0180000
kernel config: https://syzkaller.appspot.com/x/.config?x=3cd0dc1b46a5bc5c
dashboard link: https://syzkaller.appspot.com/bug?extid=fd07f3da9110f5f18b4f
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c1a21353ecf6/disk-a5b6244c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/675fe8a43c32/vmlinux-a5b6244c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1848dc711f3f/bzImage-a5b6244c.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+fd07f3da9110f5f18b4f at syzkaller.appspotmail.com
==================================================================
BUG: KCSAN: data-race in wg_packet_receive / wg_packet_receive
read to 0xffff88812bad5c08 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_consume_data drivers/net/wireguard/receive.c:526 [inline]
wg_packet_receive+0xc51/0x12c0 drivers/net/wireguard/receive.c:576
wg_receive+0x4e/0x70 drivers/net/wireguard/socket.c:326
udp_queue_rcv_one_skb+0xad0/0xb60 net/ipv4/udp.c:2113
udp_queue_rcv_skb+0x20a/0x220 net/ipv4/udp.c:2191
udp_unicast_rcv_skb+0x1c2/0x1f0 net/ipv4/udp.c:2351
__udp4_lib_rcv+0xb93/0x1110 net/ipv4/udp.c:2427
udp_rcv+0x4f/0x60 net/ipv4/udp.c:2609
ip_protocol_deliver_rcu+0x356/0x6d0 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x13c/0x1b0 net/ipv4/ip_input.c:233
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_local_deliver+0xec/0x1c0 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:461 [inline]
ip_rcv_finish net/ipv4/ip_input.c:449 [inline]
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_rcv+0x18a/0x260 net/ipv4/ip_input.c:569
__netif_receive_skb_one_core net/core/dev.c:5534 [inline]
__netif_receive_skb+0x90/0x1b0 net/core/dev.c:5648
process_backlog+0x21f/0x380 net/core/dev.c:5976
__napi_poll+0x60/0x3c0 net/core/dev.c:6576
napi_poll net/core/dev.c:6645 [inline]
net_rx_action+0x32b/0x750 net/core/dev.c:6778
__do_softirq+0xc4/0x27b kernel/softirq.c:553
do_softirq+0x5e/0x90 kernel/softirq.c:454
__local_bh_enable_ip+0x66/0x70 kernel/softirq.c:381
__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+0x127/0x360 drivers/net/wireguard/send.c:276
process_one_work kernel/workqueue.c:2633 [inline]
process_scheduled_works+0x5b8/0xa40 kernel/workqueue.c:2706
worker_thread+0x525/0x730 kernel/workqueue.c:2787
kthread+0x1d7/0x210 kernel/kthread.c:388
ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
write to 0xffff88812bad5c08 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_consume_data drivers/net/wireguard/receive.c:526 [inline]
wg_packet_receive+0xd3a/0x12c0 drivers/net/wireguard/receive.c:576
wg_receive+0x4e/0x70 drivers/net/wireguard/socket.c:326
udpv6_queue_rcv_one_skb+0xb37/0xbc0 net/ipv6/udp.c:716
udpv6_queue_rcv_skb+0x20f/0x230 net/ipv6/udp.c:778
udp6_unicast_rcv_skb+0x195/0x1b0 net/ipv6/udp.c:921
__udp6_lib_rcv+0xa24/0xc80 net/ipv6/udp.c:1010
udpv6_rcv+0x4f/0x60 net/ipv6/udp.c:1124
ip6_protocol_deliver_rcu+0x92f/0xf30 net/ipv6/ip6_input.c:438
ip6_input_finish net/ipv6/ip6_input.c:483 [inline]
NF_HOOK include/linux/netfilter.h:314 [inline]
ip6_input+0xbd/0x1b0 net/ipv6/ip6_input.c:492
dst_input include/net/dst.h:461 [inline]
ip6_rcv_finish+0x1d9/0x2d0 net/ipv6/ip6_input.c:79
NF_HOOK include/linux/netfilter.h:314 [inline]
ipv6_rcv+0x74/0x150 net/ipv6/ip6_input.c:310
__netif_receive_skb_one_core net/core/dev.c:5534 [inline]
__netif_receive_skb+0x90/0x1b0 net/core/dev.c:5648
process_backlog+0x21f/0x380 net/core/dev.c:5976
__napi_poll+0x60/0x3c0 net/core/dev.c:6576
napi_poll net/core/dev.c:6645 [inline]
net_rx_action+0x32b/0x750 net/core/dev.c:6778
__do_softirq+0xc4/0x27b kernel/softirq.c:553
do_softirq+0x5e/0x90 kernel/softirq.c:454
__local_bh_enable_ip+0x66/0x70 kernel/softirq.c:381
__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+0x127/0x360 drivers/net/wireguard/send.c:276
process_one_work kernel/workqueue.c:2633 [inline]
process_scheduled_works+0x5b8/0xa40 kernel/workqueue.c:2706
worker_thread+0x525/0x730 kernel/workqueue.c:2787
kthread+0x1d7/0x210 kernel/kthread.c:388
ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
value changed: 0x00000000 -> 0x00000001
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 5475 Comm: kworker/1:6 Not tainted 6.8.0-rc3-syzkaller-00293-ga5b6244cf87c #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Workqueue: wg-crypt-wg0 wg_packet_tx_worker
==================================================================
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller at googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
More information about the WireGuard
mailing list