syzbot


KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt

Status: closed as invalid on 2019/11/19 13:44
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 1196d, last: 1186d
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 (5) 1 208d 208d 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 1089d 1114d 0/24 auto-closed as invalid on 2020/04/19 05:34
upstream KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt (3) 1 471d 471d 0/24 auto-closed as invalid on 2021/11/23 01:54
upstream KCSAN: data-race in virtqueue_get_buf_ctx / vring_interrupt (4) 1 286d 286d 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 0xffff8881299aa888 of 2 bytes by interrupt on cpu 1:
 virtqueue_get_buf_ctx_split drivers/virtio/virtio_ring.c:721 [inline]
 virtqueue_get_buf_ctx+0x4cc/0x5c0 drivers/virtio/virtio_ring.c:1900
 virtqueue_get_buf+0x29/0x40 drivers/virtio/virtio_ring.c:1906
 free_old_xmit_skbs+0x9e/0x170 drivers/net/virtio_net.c:1359
 start_xmit+0xd3/0xbe0 drivers/net/virtio_net.c:1562
 __netdev_start_xmit include/linux/netdevice.h:4413 [inline]
 netdev_start_xmit include/linux/netdevice.h:4427 [inline]
 xmit_one net/core/dev.c:3199 [inline]
 dev_hard_start_xmit+0xef/0x430 net/core/dev.c:3215
 sch_direct_xmit+0x2b3/0x900 net/sched/sch_generic.c:313
 __dev_xmit_skb net/core/dev.c:3400 [inline]
 __dev_queue_xmit+0x19a3/0x1b40 net/core/dev.c:3761
 dev_queue_xmit+0x21/0x30 net/core/dev.c:3825
 neigh_hh_output include/net/neighbour.h:500 [inline]
 neigh_output include/net/neighbour.h:509 [inline]
 ip_finish_output2+0x836/0xe40 net/ipv4/ip_output.c:228
 __ip_finish_output net/ipv4/ip_output.c:308 [inline]
 __ip_finish_output+0x23a/0x490 net/ipv4/ip_output.c:290
 ip_finish_output+0x41/0x160 net/ipv4/ip_output.c:318
 NF_HOOK_COND include/linux/netfilter.h:294 [inline]
 ip_output+0xdf/0x210 net/ipv4/ip_output.c:432
 dst_output include/net/dst.h:436 [inline]
 ip_local_out+0x74/0x90 net/ipv4/ip_output.c:125
 __ip_queue_xmit+0x3a8/0xa40 net/ipv4/ip_output.c:532
 ip_queue_xmit+0x45/0x60 include/net/ip.h:237
 __tcp_transmit_skb+0xe81/0x1d60 net/ipv4/tcp_output.c:1169
 __tcp_send_ack+0x246/0x300 net/ipv4/tcp_output.c:3696
 tcp_send_ack+0x34/0x40 net/ipv4/tcp_output.c:3702
 __tcp_ack_snd_check+0xd9/0x4f0 net/ipv4/tcp_input.c:5243
 tcp_rcv_established+0xce9/0xf50 net/ipv4/tcp_input.c:5674
 tcp_v4_do_rcv+0x3b5/0x520 net/ipv4/tcp_ipv4.c:1564
 tcp_v4_rcv+0x19ec/0x1bd0 net/ipv4/tcp_ipv4.c:1945
 ip_protocol_deliver_rcu+0x4d/0x420 net/ipv4/ip_input.c:204
 ip_local_deliver_finish+0x110/0x140 net/ipv4/ip_input.c:231
 NF_HOOK include/linux/netfilter.h:305 [inline]
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ip_local_deliver+0x133/0x210 net/ipv4/ip_input.c:252
 dst_input include/net/dst.h:442 [inline]
 ip_rcv_finish+0x121/0x160 net/ipv4/ip_input.c:413
 NF_HOOK include/linux/netfilter.h:305 [inline]
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ip_rcv+0x18f/0x1a0 net/ipv4/ip_input.c:523
 __netif_receive_skb_one_core+0xa7/0xe0 net/core/dev.c:4929
 __netif_receive_skb+0x37/0xf0 net/core/dev.c:5043
 netif_receive_skb_internal+0x59/0x190 net/core/dev.c:5133
 napi_skb_finish net/core/dev.c:5596 [inline]
 napi_gro_receive+0x28f/0x330 net/core/dev.c:5629
 receive_buf+0x284/0x30b0 drivers/net/virtio_net.c:1061
 virtnet_receive drivers/net/virtio_net.c:1323 [inline]
 virtnet_poll+0x436/0x7d0 drivers/net/virtio_net.c:1428
 napi_poll net/core/dev.c:6311 [inline]
 net_rx_action+0x3ae/0xa90 net/core/dev.c:6379
 __do_softirq+0x115/0x33f kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0xbb/0xe0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:536 [inline]
 do_IRQ+0xa6/0x180 arch/x86/kernel/irq.c:263
 ret_from_intr+0x0/0x19
 __tsan_read8+0x23/0x1f0 kernel/kcsan/core.c:530
 tomoyo_domain_quota_is_ok+0xce/0x2b0 security/tomoyo/util.c:1031
 tomoyo_supervisor+0x22b/0xd20 security/tomoyo/common.c:2087
 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline]
 tomoyo_path_permission security/tomoyo/file.c:587 [inline]
 tomoyo_path_permission+0x121/0x160 security/tomoyo/file.c:573
 tomoyo_path_perm+0x23e/0x390 security/tomoyo/file.c:838
 tomoyo_inode_getattr+0x26/0x40 security/tomoyo/tomoyo.c:129
 security_inode_getattr+0x9b/0xd0 security/security.c:1222
 vfs_getattr+0x2e/0x70 fs/stat.c:115
 vfs_statx_fd+0x7a/0xd0 fs/stat.c:145
 vfs_fstat include/linux/fs.h:3258 [inline]
 __do_sys_newfstat+0x49/0xa0 fs/stat.c:378
 __se_sys_newfstat fs/stat.c:375 [inline]
 __x64_sys_newfstat+0x3a/0x50 fs/stat.c:375
 do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

read to 0xffff8881299aa888 of 2 bytes by interrupt on cpu 0:
 more_used drivers/virtio/virtio_ring.c:2029 [inline]
 vring_interrupt+0x36/0x1c0 drivers/virtio/virtio_ring.c:2036
 __handle_irq_event_percpu+0x9a/0x430 kernel/irq/handle.c:149
 handle_irq_event_percpu+0x4b/0xe0 kernel/irq/handle.c:189
 handle_irq_event+0x85/0xca kernel/irq/handle.c:206
 handle_edge_irq+0x1a4/0x4a0 kernel/irq/chip.c:830
 generic_handle_irq_desc include/linux/irqdesc.h:156 [inline]
 do_IRQ+0xa1/0x180 arch/x86/kernel/irq.c:250
 ret_from_intr+0x0/0x19
 arch_local_irq_enable arch/x86/include/asm/paravirt.h:766 [inline]
 __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
 _raw_spin_unlock_irq+0x4e/0x80 kernel/locking/spinlock.c:199
 finish_lock_switch kernel/sched/core.c:3123 [inline]
 finish_task_switch+0x7b/0x260 kernel/sched/core.c:3223
 context_switch kernel/sched/core.c:3387 [inline]
 __schedule+0x319/0x640 kernel/sched/core.c:4069
 schedule+0x47/0xd0 kernel/sched/core.c:4136
 freezable_schedule include/linux/freezer.h:172 [inline]
 do_nanosleep+0x138/0x320 kernel/time/hrtimer.c:1871
 hrtimer_nanosleep+0x191/0x320 kernel/time/hrtimer.c:1924
 __do_sys_nanosleep kernel/time/hrtimer.c:1958 [inline]
 __se_sys_nanosleep kernel/time/hrtimer.c:1945 [inline]
 __x64_sys_nanosleep+0x106/0x150 kernel/time/hrtimer.c:1945
 do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 8090 Comm: syz-executor.3 Not tainted 5.4.0-rc6+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci2-upstream-kcsan-gce 2019/11/04 17:18 https://github.com/google/ktsan.git kcsan 94c006602e13 18e12644 .config console log report
ci2-upstream-kcsan-gce 2019/11/01 21:23 https://github.com/google/ktsan.git kcsan 05f2236801fe 997ccc67 .config console log report
ci2-upstream-kcsan-gce 2019/10/25 12:33 https://github.com/google/ktsan.git kcsan 05f2236801fe 04ca72cd .config console log report
* Struck through repros no longer work on HEAD.