syzbot


KCSAN: data-race in sg_open / sg_release (2)

Status: moderation: reported on 2025/08/28 00:24
Subsystems: scsi
[Documentation on labels]
Reported-by: syzbot+92b6af4f2ee6b9e092dc@syzkaller.appspotmail.com
First crash: 1d03h, last: 1d03h
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in sg_open / sg_release scsi 6 1 1310d 1310d 0/29 auto-closed as invalid on 2022/03/02 20:32

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

read-write to 0xffff8881019375a8 of 4 bytes by task 20198 on cpu 1:
 sg_release+0x5b/0x260 drivers/scsi/sg.c:389
 __fput+0x298/0x650 fs/file_table.c:468
 ____fput+0x1c/0x30 fs/file_table.c:496
 task_work_run+0x131/0x1a0 kernel/task_work.c:227
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 exit_to_user_mode_loop+0xe4/0x100 kernel/entry/common.c:43
 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
 do_syscall_64+0x1d6/0x200 arch/x86/entry/syscall_64.c:100
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881019375a8 of 4 bytes by task 20199 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:965
 vfs_open+0x37/0x1e0 fs/open.c:1095
 do_open fs/namei.c:3887 [inline]
 path_openat+0x1c5e/0x2170 fs/namei.c:4046
 do_filp_open+0x109/0x230 fs/namei.c:4073
 do_sys_openat2+0xa6/0x110 fs/open.c:1435
 do_sys_open fs/open.c:1450 [inline]
 __do_sys_openat fs/open.c:1466 [inline]
 __se_sys_openat fs/open.c:1461 [inline]
 __x64_sys_openat+0xf2/0x120 fs/open.c:1461
 x64_sys_call+0x2e9c/0x2ff0 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 -> 0x00000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 20199 Comm: syz.1.5018 Not tainted syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/14/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/28 00:23 upstream 39f90c196721 e12e5ba4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in sg_open / sg_release
* Struck through repros no longer work on HEAD.