syzbot


KCSAN: data-race in sg_open / sg_open

Status: moderation: reported on 2025/07/25 19:42
Subsystems: scsi
[Documentation on labels]
Reported-by: syzbot+6a9772f5c667f84e251c@syzkaller.appspotmail.com
First crash: 4d20h, last: 4d20h

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

read-write to 0xffff8881025b44e8 of 4 bytes by task 32070 on cpu 1:
 sg_open+0xb8e/0xc70 drivers/scsi/sg.c:355
 chrdev_open+0x2eb/0x3a0 fs/char_dev.c:414
 do_dentry_open+0x646/0xa20 fs/open.c:964
 vfs_open+0x37/0x1e0 fs/open.c:1094
 do_open fs/namei.c:3896 [inline]
 path_openat+0x1c5e/0x2170 fs/namei.c:4055
 do_filp_open+0x109/0x230 fs/namei.c:4082
 do_sys_openat2+0xa6/0x110 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_openat fs/open.c:1468 [inline]
 __se_sys_openat fs/open.c:1463 [inline]
 __x64_sys_openat+0xf2/0x120 fs/open.c:1463
 x64_sys_call+0x1af/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:258
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881025b44e8 of 4 bytes by task 32011 on cpu 0:
 open_wait drivers/scsi/sg.c:253 [inline]
 sg_open+0x550/0xc70 drivers/scsi/sg.c:334
 chrdev_open+0x2eb/0x3a0 fs/char_dev.c:414
 do_dentry_open+0x646/0xa20 fs/open.c:964
 vfs_open+0x37/0x1e0 fs/open.c:1094
 do_open fs/namei.c:3896 [inline]
 path_openat+0x1c5e/0x2170 fs/namei.c:4055
 do_filp_open+0x109/0x230 fs/namei.c:4082
 do_sys_openat2+0xa6/0x110 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_openat fs/open.c:1468 [inline]
 __se_sys_openat fs/open.c:1463 [inline]
 __x64_sys_openat+0xf2/0x120 fs/open.c:1463
 x64_sys_call+0x1af/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:258
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd2/0x200 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000001 -> 0x00000002

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 32011 Comm: syz.2.8177 Tainted: G        W           6.16.0-rc7-syzkaller-00105-g2942242dde89 #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/25 19:41 upstream 2942242dde89 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in sg_open / sg_open
* Struck through repros no longer work on HEAD.