syzbot


KCSAN: data-race in _prb_read_valid / data_alloc

Status: moderation: reported on 2025/04/25 22:51
Subsystems: usb
[Documentation on labels]
Reported-by: syzbot+808447001465ab29f335@syzkaller.appspotmail.com
First crash: 14h38m, last: 3h30m

Sample crash report:
vhci_hcd vhci_hcd.0: pdev(4) rhport(3) sockfd(12)
==================================================================
BUG: KCSAN: data-race in _prb_read_valid / data_alloc

write to 0xffffffff868801c0 of 8 bytes by task 21007 on cpu 1:
 data_alloc+0x271/0x2b0 kernel/printk/printk_ringbuffer.c:1095
 prb_reserve+0x808/0xaf0 kernel/printk/printk_ringbuffer.c:1669
 vprintk_store+0x56d/0x860 kernel/printk/printk.c:2326
 vprintk_emit+0x178/0x650 kernel/printk/printk.c:2426
 vprintk_default+0x26/0x30 kernel/printk/printk.c:2465
 vprintk+0x1d/0x30 kernel/printk/printk_safe.c:82
 _printk+0x79/0xa0 kernel/printk/printk.c:2475
 __ext4_error_inode+0x2ca/0x3f0 fs/ext4/super.c:848
 ext4_do_update_inode fs/ext4/inode.c:5211 [inline]
 ext4_mark_iloc_dirty+0x35e/0xda0 fs/ext4/inode.c:5869
 ext4_orphan_del+0x6db/0x710 fs/ext4/orphan.c:303
 ext4_truncate+0x882/0xac0 fs/ext4/inode.c:4252
 ext4_process_orphan+0x110/0x1c0 fs/ext4/orphan.c:339
 ext4_orphan_cleanup+0x6a8/0xa00 fs/ext4/orphan.c:474
 __ext4_fill_super fs/ext4/super.c:5607 [inline]
 ext4_fill_super+0x3171/0x34e0 fs/ext4/super.c:5726
 get_tree_bdev_flags+0x28e/0x300 fs/super.c:1636
 get_tree_bdev+0x1f/0x30 fs/super.c:1659
 ext4_get_tree+0x1c/0x30 fs/ext4/super.c:5758
 vfs_get_tree+0x54/0x1d0 fs/super.c:1759
 do_new_mount+0x207/0x680 fs/namespace.c:3884
 path_mount+0x4a4/0xb20 fs/namespace.c:4211
 do_mount fs/namespace.c:4224 [inline]
 __do_sys_mount fs/namespace.c:4435 [inline]
 __se_sys_mount+0x28f/0x2e0 fs/namespace.c:4412
 __x64_sys_mount+0x67/0x80 fs/namespace.c:4412
 x64_sys_call+0xd36/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:166
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffffff868801c0 of 16 bytes by task 21008 on cpu 0:
 desc_read kernel/printk/printk_ringbuffer.c:482 [inline]
 desc_read_finalized_seq kernel/printk/printk_ringbuffer.c:1874 [inline]
 prb_read kernel/printk/printk_ringbuffer.c:1922 [inline]
 _prb_read_valid+0x1bc/0x920 kernel/printk/printk_ringbuffer.c:2113
 desc_update_last_finalized kernel/printk/printk_ringbuffer.c:1515 [inline]
 prb_final_commit+0x136/0x1e0 kernel/printk/printk_ringbuffer.c:1782
 vprintk_store+0x741/0x860 kernel/printk/printk.c:2352
 vprintk_emit+0x178/0x650 kernel/printk/printk.c:2426
 dev_vprintk_emit+0x242/0x2a0 drivers/base/core.c:4917
 dev_printk_emit+0x84/0xb0 drivers/base/core.c:4928
 __dev_printk+0xf3/0x110 drivers/base/core.c:4940
 _dev_info+0x9b/0xd0 drivers/base/core.c:4986
 attach_store+0x495/0x680 drivers/usb/usbip/vhci_sysfs.c:416
 dev_attr_store+0x47/0x70 drivers/base/core.c:2440
 sysfs_kf_write+0xfb/0x120 fs/sysfs/file.c:145
 kernfs_fop_write_iter+0x1be/0x2d0 fs/kernfs/file.c:334
 new_sync_write fs/read_write.c:591 [inline]
 vfs_write+0x49d/0x8d0 fs/read_write.c:684
 ksys_write+0xda/0x1a0 fs/read_write.c:736
 __do_sys_write fs/read_write.c:747 [inline]
 __se_sys_write fs/read_write.c:744 [inline]
 __x64_sys_write+0x40/0x50 fs/read_write.c:744
 x64_sys_call+0x2cdd/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd0/0x1a0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 21008 Comm: syz.4.5756 Not tainted 6.15.0-rc3-syzkaller-00283-gf1a3944c860b #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================
vhci_hcd vhci_hcd.0: devid(0) speed(4) speed_str(wireless)
vhci_hcd vhci_hcd.0: Device attached
vhci_hcd vhci_hcd.0: pdev(4) rhport(5) sockfd(16)
vhci_hcd vhci_hcd.0: devid(0) speed(2) speed_str(full-speed)
vhci_hcd vhci_hcd.0: Device attached

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/26 09:58 upstream f1a3944c860b c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _prb_read_valid / data_alloc
2025/04/25 22:55 upstream 02ddfb981de8 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _prb_read_valid / data_alloc
2025/04/25 22:50 upstream 02ddfb981de8 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in _prb_read_valid / data_alloc
* Struck through repros no longer work on HEAD.