================================================================== BUG: KCSAN: data-race in detach_buf_split / virtqueue_add read to 0xffff888101af8b2c of 4 bytes by task 26531 on cpu 0: virtqueue_add_split drivers/virtio/virtio_ring.c:575 [inline] virtqueue_add+0x75a/0x20e0 drivers/virtio/virtio_ring.c:2133 virtqueue_add_inbuf+0x53/0x80 drivers/virtio/virtio_ring.c:2212 request_entropy drivers/char/hw_random/virtio-rng.c:61 [inline] copy_data drivers/char/hw_random/virtio-rng.c:74 [inline] virtio_read+0x1c5/0x3f0 drivers/char/hw_random/virtio-rng.c:92 rng_get_data drivers/char/hw_random/core.c:197 [inline] rng_dev_read+0x1a7/0x5e0 drivers/char/hw_random/core.c:234 vfs_read+0x19f/0x5c0 fs/read_write.c:468 ksys_read+0xeb/0x1a0 fs/read_write.c:613 __do_sys_read fs/read_write.c:623 [inline] __se_sys_read fs/read_write.c:621 [inline] __x64_sys_read+0x42/0x50 fs/read_write.c:621 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd read-write to 0xffff888101af8b2c of 4 bytes by interrupt on cpu 1: detach_buf_split+0x316/0x570 drivers/virtio/virtio_ring.c:760 virtqueue_get_buf_ctx_split drivers/virtio/virtio_ring.c:835 [inline] virtqueue_get_buf_ctx+0x3c2/0x5b0 drivers/virtio/virtio_ring.c:2327 virtqueue_get_buf+0x1f/0x30 drivers/virtio/virtio_ring.c:2333 random_recv_done+0x4c/0x90 drivers/char/hw_random/virtio-rng.c:42 vring_interrupt+0x150/0x170 drivers/virtio/virtio_ring.c:2501 __handle_irq_event_percpu+0x91/0x490 kernel/irq/handle.c:158 handle_irq_event_percpu kernel/irq/handle.c:193 [inline] handle_irq_event+0x64/0xf0 kernel/irq/handle.c:210 handle_edge_irq+0x167/0x590 kernel/irq/chip.c:834 generic_handle_irq_desc include/linux/irqdesc.h:161 [inline] handle_irq arch/x86/kernel/irq.c:238 [inline] __common_interrupt+0x3c/0xb0 arch/x86/kernel/irq.c:257 common_interrupt+0x3d/0x90 arch/x86/kernel/irq.c:247 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:636 is_atomic kernel/kcsan/core.c:249 [inline] should_watch kernel/kcsan/core.c:277 [inline] check_access kernel/kcsan/core.c:752 [inline] __tsan_unaligned_write8+0x129/0x180 kernel/kcsan/core.c:1025 pie_calculate_probability+0x333/0x520 net/sched/sch_pie.c:388 fq_pie_timer+0xbc/0x150 net/sched/sch_fq_pie.c:387 call_timer_fn+0x35/0x290 kernel/time/timer.c:1700 expire_timers kernel/time/timer.c:1751 [inline] __run_timers+0x46c/0x650 kernel/time/timer.c:2022 run_timer_softirq+0x1d/0x40 kernel/time/timer.c:2035 __do_softirq+0xc1/0x265 kernel/softirq.c:553 invoke_softirq kernel/softirq.c:427 [inline] __irq_exit_rcu kernel/softirq.c:632 [inline] irq_exit_rcu+0x3b/0x90 kernel/softirq.c:644 sysvec_apic_timer_interrupt+0x6d/0x80 arch/x86/kernel/apic/apic.c:1109 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645 console_flush_all+0x495/0x6a0 console_unlock+0xf3/0x210 kernel/printk/printk.c:3007 vprintk_emit+0x107/0x430 kernel/printk/printk.c:2307 vprintk_default+0x26/0x30 kernel/printk/printk.c:2318 vprintk+0x83/0x90 kernel/printk/printk_safe.c:50 _printk+0x7a/0xa0 kernel/printk/printk.c:2328 set_capacity_and_notify+0x11d/0x170 block/genhd.c:86 loop_set_size+0x2e/0x70 drivers/block/loop.c:237 loop_configure+0xafe/0xca0 drivers/block/loop.c:1100 lo_ioctl+0x682/0x12e0 blkdev_ioctl+0x375/0x460 block/ioctl.c:621 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xcf/0x140 fs/ioctl.c:856 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd value changed: 0x000000ff -> 0x000000fe Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 26529 Comm: syz-executor.3 Not tainted 6.4.0-syzkaller-04247-g3a8a670eeeaa #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 ==================================================================