syzbot


KCSAN: data-race in detach_buf_split / virtqueue_add

Status: moderation: reported on 2021/12/01 23:44
Reported-by: syzbot+888f3df5bec03d45cffc@syzkaller.appspotmail.com
First crash: 242d, last: 11h41m

Sample crash report:
==================================================================
BUG: KCSAN: data-race in detach_buf_split / virtqueue_add

read to 0xffff888101eb04c0 of 4 bytes by task 7206 on cpu 0:
 virtqueue_add_split drivers/virtio/virtio_ring.c:500 [inline]
 virtqueue_add+0x4bc/0x2160 drivers/virtio/virtio_ring.c:1810
 virtqueue_add_inbuf+0x4f/0x80 drivers/virtio/virtio_ring.c:1889
 request_entropy drivers/char/hw_random/virtio-rng.c:61 [inline]
 copy_data drivers/char/hw_random/virtio-rng.c:74 [inline]
 virtio_read+0x1e1/0x430 drivers/char/hw_random/virtio-rng.c:92
 rng_get_data drivers/char/hw_random/core.c:191 [inline]
 rng_dev_read+0x1b4/0x630 drivers/char/hw_random/core.c:228
 do_iter_read+0x433/0x5d0 fs/read_write.c:805
 vfs_readv fs/read_write.c:923 [inline]
 do_preadv+0x159/0x230 fs/read_write.c:1015
 __do_sys_preadv fs/read_write.c:1065 [inline]
 __se_sys_preadv fs/read_write.c:1060 [inline]
 __x64_sys_preadv+0x54/0x60 fs/read_write.c:1060
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0

read-write to 0xffff888101eb04c0 of 4 bytes by interrupt on cpu 1:
 detach_buf_split+0x2f2/0x580 drivers/virtio/virtio_ring.c:704
 virtqueue_get_buf_ctx_split drivers/virtio/virtio_ring.c:782 [inline]
 virtqueue_get_buf_ctx+0x394/0x570 drivers/virtio/virtio_ring.c:2004
 virtqueue_get_buf+0x1b/0x20 drivers/virtio/virtio_ring.c:2010
 random_recv_done+0x42/0x80 drivers/char/hw_random/virtio-rng.c:42
 vring_interrupt+0x14c/0x170 drivers/virtio/virtio_ring.c:2176
 __handle_irq_event_percpu+0x92/0x400 kernel/irq/handle.c:158
 handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
 handle_irq_event+0x60/0xf0 kernel/irq/handle.c:210
 handle_edge_irq+0x17e/0x5a0 kernel/irq/chip.c:817
 generic_handle_irq_desc include/linux/irqdesc.h:158 [inline]
 handle_irq arch/x86/kernel/irq.c:231 [inline]
 __common_interrupt+0x60/0x100 arch/x86/kernel/irq.c:250
 common_interrupt+0x9a/0xc0 arch/x86/kernel/irq.c:240
 asm_common_interrupt+0x27/0x40
 crng_make_state+0x21d/0x490
 _get_random_bytes+0x95/0x1b0 drivers/char/random.c:364
 get_random_bytes+0x19/0x20 drivers/char/random.c:396
 eth_random_addr include/linux/etherdevice.h:232 [inline]
 nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:749 [inline]
 nsim_dev_trap_report drivers/net/netdevsim/dev.c:799 [inline]
 nsim_dev_trap_report_work+0x206/0x590 drivers/net/netdevsim/dev.c:840
 process_one_work+0x3d3/0x720 kernel/workqueue.c:2289
 worker_thread+0x618/0xa70 kernel/workqueue.c:2436
 kthread+0x1a9/0x1e0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30

value changed: 0x00000000 -> 0x00000002

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 1913 Comm: kworker/1:3 Not tainted 5.19.0-rc5-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
Workqueue: events nsim_dev_trap_report_work
==================================================================

Crashes (351):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/07/04 13:17 upstream 88084a3df167 bff65f44 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/07/04 11:24 upstream 88084a3df167 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/07/03 20:16 upstream 20855e4cb361 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/07/03 04:57 upstream 69cb6c6556ad 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/07/01 21:36 upstream b336ad598a3b 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/07/01 10:29 upstream a175eca0f3d7 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/30 02:58 upstream d9b2ba67917c 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/29 16:15 upstream 941e3e791269 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/29 14:14 upstream 941e3e791269 1434eec0 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/28 01:45 upstream 941e3e791269 ef82eb2c .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/27 21:52 upstream 03c765b0e3b4 a371c43c .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/26 18:33 upstream 82708bb1eb9e a371c43c .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/26 10:26 upstream 0840a7914caa a371c43c .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/24 21:27 upstream 38bc4ac43168 a371c43c .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/24 12:07 upstream 92f20ff72066 a371c43c .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/24 07:54 upstream 92f20ff72066 a5dbd430 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/23 21:03 upstream 92f20ff72066 912f5df7 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/23 07:15 upstream de5c208d533a 912f5df7 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/22 19:42 upstream 3abc3ae553c7 912f5df7 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/22 16:15 upstream ca1fdab7fd27 912f5df7 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/21 19:32 upstream ca1fdab7fd27 0fc5c330 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/21 06:35 upstream 78ca55889a54 0fc5c330 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/20 15:13 upstream 78ca55889a54 b9406563 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/20 13:46 upstream a111daf0c53a b9406563 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/20 07:50 upstream a111daf0c53a 8f633d84 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/19 17:38 upstream 05c6ca8512f2 8f633d84 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/19 03:39 upstream 354c6e071be9 8f633d84 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/18 09:43 upstream 4b35035bcf80 8f633d84 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/17 19:21 upstream 462abc9de7a1 8f633d84 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/17 06:51 upstream 47700948a4ab cb58b3b2 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/16 21:45 upstream 48a23ec6ff2b 1719ee24 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/16 02:01 upstream 30306f6194ca 1719ee24 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/15 13:51 upstream 018ab4fabddd 1719ee24 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/15 06:47 upstream 018ab4fabddd 127d1faf .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/14 17:54 upstream 24625f7d91fb 127d1faf .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/14 14:17 upstream b13baccc3850 127d1faf .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/13 17:25 upstream b13baccc3850 0f087040 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/13 08:47 upstream b13baccc3850 0d5abf15 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/12 19:35 upstream 997952851843 0d5abf15 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/12 06:17 upstream 7a68065eb9cd 0d5abf15 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/03 11:43 upstream 50fd82b3a9a9 eee80d3c .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2022/06/02 23:15 upstream 58f9d52ff689 02dddea8 .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2021/12/01 08:26 upstream 58e1100fdc59 5fa3eacc .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add
ci2-upstream-kcsan-gce 2021/11/04 05:47 upstream ce840177930f 4c1be0be .config log report info KCSAN: data-race in detach_buf_split / virtqueue_add