syzbot


KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt (3)

Status: auto-closed as invalid on 2021/11/23 01:54
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 403d, last: 403d
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt 3 1118d 1128d 0/24 closed as invalid on 2019/11/19 13:44
upstream KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt (5) 1 140d 140d 0/24 auto-closed as invalid on 2022/08/13 10:50
upstream KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt (2) 4 1021d 1047d 0/24 auto-closed as invalid on 2020/04/19 05:34
upstream KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt (4) 1 218d 218d 0/24 auto-closed as invalid on 2022/05/27 01:16

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

write to 0xffff8881028e2ac8 of 2 bytes by task 478 on cpu 1:
 virtqueue_get_buf_ctx_split drivers/virtio/virtio_ring.c:791 [inline]
 virtqueue_get_buf_ctx+0x3a4/0x5d0 drivers/virtio/virtio_ring.c:1990
 virtqueue_get_buf+0x1b/0x20 drivers/virtio/virtio_ring.c:1996
 free_old_xmit_skbs+0x50/0x190 drivers/net/virtio_net.c:1463
 start_xmit+0xca/0xb10 drivers/net/virtio_net.c:1695
 __netdev_start_xmit include/linux/netdevice.h:4988 [inline]
 netdev_start_xmit include/linux/netdevice.h:5002 [inline]
 xmit_one+0xf9/0x270 net/core/dev.c:3576
 dev_hard_start_xmit+0x72/0x120 net/core/dev.c:3592
 sch_direct_xmit+0x1a8/0x5c0 net/sched/sch_generic.c:342
 __dev_xmit_skb+0x938/0x1490 net/core/dev.c:3803
 __dev_queue_xmit+0x4c3/0xaa0 net/core/dev.c:4170
 dev_queue_xmit+0x13/0x20 net/core/dev.c:4235
 neigh_hh_output include/net/neighbour.h:499 [inline]
 neigh_output include/net/neighbour.h:508 [inline]
 ip_finish_output2+0xa33/0xaa0 net/ipv4/ip_output.c:221
 ip_finish_output+0x3b5/0x510 net/ipv4/ip_output.c:309
 NF_HOOK_COND include/linux/netfilter.h:296 [inline]
 ip_output+0xf3/0x1a0 net/ipv4/ip_output.c:423
 dst_output include/net/dst.h:450 [inline]
 ip_local_out+0x164/0x220 net/ipv4/ip_output.c:126
 __ip_queue_xmit+0x9d3/0xa20 net/ipv4/ip_output.c:525
 ip_queue_xmit+0x34/0x40 net/ipv4/ip_output.c:539
 __tcp_transmit_skb+0x142a/0x1a00 net/ipv4/tcp_output.c:1405
 tcp_transmit_skb net/ipv4/tcp_output.c:1423 [inline]
 tcp_write_xmit+0x110a/0x3b90 net/ipv4/tcp_output.c:2690
 __tcp_push_pending_frames+0x68/0x1c0 net/ipv4/tcp_output.c:2874
 tcp_push_pending_frames include/net/tcp.h:1880 [inline]
 tcp_data_snd_check net/ipv4/tcp_input.c:5435 [inline]
 tcp_rcv_established+0x8a1/0x1320 net/ipv4/tcp_input.c:5930
 tcp_v4_do_rcv+0x261/0x4f0 net/ipv4/tcp_ipv4.c:1694
 sk_backlog_rcv include/net/sock.h:1027 [inline]
 __release_sock+0xf2/0x270 net/core/sock.c:2686
 release_sock+0x40/0x110 net/core/sock.c:3218
 tcp_sendmsg+0x36/0x40 net/ipv4/tcp.c:1462
 inet_sendmsg+0x5f/0x80 net/ipv4/af_inet.c:821
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 sock_write_iter+0x1a3/0x200 net/socket.c:1057
 call_write_iter include/linux/fs.h:2163 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x7bc/0x900 fs/read_write.c:594
 ksys_write+0xd9/0x190 fs/read_write.c:647
 __do_sys_write fs/read_write.c:659 [inline]
 __se_sys_write fs/read_write.c:656 [inline]
 __x64_sys_write+0x3e/0x50 fs/read_write.c:656
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

read to 0xffff8881028e2ac8 of 2 bytes by interrupt on cpu 0:
 vring_interrupt+0x33/0x180 drivers/virtio/virtio_ring.c:2141
 __handle_irq_event_percpu+0x93/0x410 kernel/irq/handle.c:156
 handle_irq_event_percpu kernel/irq/handle.c:196 [inline]
 handle_irq_event+0xb6/0x170 kernel/irq/handle.c:213
 handle_edge_irq+0x17e/0x600 kernel/irq/chip.c:822
 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
 handle_irq arch/x86/kernel/irq.c:231 [inline]
 __common_interrupt+0x38/0xb0 arch/x86/kernel/irq.c:250
 common_interrupt+0x73/0x90 arch/x86/kernel/irq.c:240
 asm_common_interrupt+0x1e/0x40
 kcsan_setup_watchpoint+0x94/0x3f0 kernel/kcsan/core.c:437
 copy_pte_range+0x332/0x1460 mm/memory.c:1044
 copy_pmd_range mm/memory.c:1156 [inline]
 copy_pud_range mm/memory.c:1193 [inline]
 copy_p4d_range mm/memory.c:1217 [inline]
 copy_page_range+0x5ea/0x8f0 mm/memory.c:1290
 dup_mmap+0x6db/0xa50 kernel/fork.c:610
 dup_mm+0x7c/0x210 kernel/fork.c:1453
 copy_mm kernel/fork.c:1505 [inline]
 copy_process+0x1463/0x2fa0 kernel/fork.c:2194
 kernel_clone+0x15c/0x680 kernel/fork.c:2584
 __do_sys_clone kernel/fork.c:2701 [inline]
 __se_sys_clone kernel/fork.c:2685 [inline]
 __x64_sys_clone+0xc6/0xf0 kernel/fork.c:2685
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x4b4b -> 0x4b4c

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 506 Comm: syz-executor.1 Not tainted 5.15.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================
sd 0:0:1:0: tag#4897 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK cmd_age=0s
sd 0:0:1:0: tag#4897 CDB: opcode=0xe5 (vendor)
sd 0:0:1:0: tag#4897 CDB[00]: e5 f4 32 73 2f 4e 09 6d 26 e2 c7 35 d1 35 12 1c
sd 0:0:1:0: tag#4897 CDB[10]: 92 1b da 40 b8 58 5b a8 d4 7d 34 f3 90 4c f1 2d
sd 0:0:1:0: tag#4897 CDB[20]: ba

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/10/19 01:46 upstream 519d81956ee2 24dc29db .config log report info KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt
* Struck through repros no longer work on HEAD.