syzbot


KCSAN: data-race in random_recv_done / virtio_read

Status: auto-closed as invalid on 2022/03/26 07:07
Reported-by: syzbot+9f00f7796f970f61ce79@syzkaller.appspotmail.com
First crash: 392d, last: 286d
similar bugs (1):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in random_recv_done / virtio_read (2) 32 59d 234d 0/24 auto-obsoleted due to no activity on 2022/11/08 08:46

Sample crash report:
==================================================================
BUG: KCSAN: data-race in random_recv_done / virtio_read

read to 0xffff88810123e0cc of 4 bytes by task 15589 on cpu 0:
 copy_data drivers/char/hw_random/virtio-rng.c:70 [inline]
 virtio_read+0xc2/0x450 drivers/char/hw_random/virtio-rng.c:92
 rng_get_data drivers/char/hw_random/core.c:192 [inline]
 rng_dev_read+0x1b4/0x630 drivers/char/hw_random/core.c:229
 do_loop_readv_writev fs/read_write.c:746 [inline]
 do_iter_read+0x370/0x5d0 fs/read_write.c:788
 vfs_readv fs/read_write.c:906 [inline]
 do_preadv+0x159/0x240 fs/read_write.c:998
 __do_sys_preadv fs/read_write.c:1048 [inline]
 __se_sys_preadv fs/read_write.c:1043 [inline]
 __x64_sys_preadv+0x54/0x60 fs/read_write.c:1043
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

write to 0xffff88810123e0cc of 4 bytes by interrupt on cpu 1:
 random_recv_done+0x58/0x80 drivers/char/hw_random/virtio-rng.c:45
 vring_interrupt+0x15d/0x180 drivers/virtio/virtio_ring.c:2165
 __handle_irq_event_percpu+0x92/0x450 kernel/irq/handle.c:158
 handle_irq_event_percpu kernel/irq/handle.c:193 [inline]
 handle_irq_event+0x7b/0x110 kernel/irq/handle.c:210
 handle_edge_irq+0x18e/0x5f0 kernel/irq/chip.c:820
 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+0x1e/0x40
 __tsan_read8+0xe/0x180 kernel/kcsan/core.c:1014
 avc_has_perm_noaudit+0x6b/0x270 security/selinux/avc.c:1152
 selinux_inode_permission+0x2da/0x3f0 security/selinux/hooks.c:3155
 security_inode_permission+0x72/0xc0 security/security.c:1317
 inode_permission fs/namei.c:532 [inline]
 may_lookup fs/namei.c:1733 [inline]
 link_path_walk+0x1e2/0x990 fs/namei.c:2289
 path_lookupat+0x8b/0x3d0 fs/namei.c:2498
 filename_lookup+0x130/0x310 fs/namei.c:2528
 user_path_at_empty+0x3e/0x110 fs/namei.c:2851
 do_readlinkat+0x97/0x210 fs/stat.c:443
 __do_sys_readlink fs/stat.c:476 [inline]
 __se_sys_readlink fs/stat.c:473 [inline]
 __x64_sys_readlink+0x43/0x50 fs/stat.c:473
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x00000000 -> 0x00000040

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 1440 Comm: udevd Not tainted 5.17.0-rc4-syzkaller-00217-g7993e65fdd0f-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================
virtio_rng virtio3: input:id 0 is not a head!

Crashes (23):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/02/19 07:06 upstream 7993e65fdd0f 3cd800e4 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2022/02/11 07:12 upstream f1baf68e1383 0b33604d .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2022/02/10 00:59 upstream f4bc5bbb5fef 0b33604d .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2022/02/09 18:08 upstream e6251ab4551f 0b33604d .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2022/01/24 10:12 upstream dd81e1c7d5fb 214351e1 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/28 17:59 upstream a8ad9a2434dc 76c8cf06 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/26 11:14 upstream 438645193e59 e4f103c4 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/24 11:03 upstream 7a29b11da965 6caa12e4 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/21 09:34 upstream 6e0567b73052 a938f0b8 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/18 04:07 upstream 9eaa88c7036e 44068e19 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/17 09:52 upstream fa36bbe6d43f 44068e19 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/12 02:40 upstream 6f513529296f 49ca1f59 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/10 14:12 upstream c741e49150db fc17c959 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/10 10:45 upstream ded746bfc943 4d4ce9bc .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/09 23:51 upstream ded746bfc943 b54aa474 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/09 16:53 upstream 2a987e65025e b54aa474 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/08 02:15 upstream 2a987e65025e 0230ba3e .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/06 10:33 upstream 0fcfb00b28c0 579a8754 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/05 00:28 upstream bbef3c7a63d2 a617004c .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/12/04 16:48 upstream 12119cfa1052 a617004c .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/11/28 09:36 upstream 3498e7f2bb41 63eeac02 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/11/17 13:34 upstream 8ab774587903 cafff8b6 .config log report info KCSAN: data-race in random_recv_done / virtio_read
ci2-upstream-kcsan-gce 2021/11/05 17:00 upstream d4439a1189f9 4c1be0be .config log report info KCSAN: data-race in random_recv_done / virtio_read
* Struck through repros no longer work on HEAD.