syzbot


KCSAN: data-race in sg_common_write / sg_finish_rem_req (6)

Status: moderation: reported on 2025/10/30 14:38
Subsystems: scsi
[Documentation on labels]
Reported-by: syzbot+3fd8cb6e827442a26422@syzkaller.appspotmail.com
First crash: 5d21h, last: 3d16h
Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in sg_common_write / sg_finish_rem_req (4) scsi 6 6 257d 279d 0/29 auto-obsoleted due to no activity on 2025/04/18 04:19
upstream KCSAN: data-race in sg_common_write / sg_finish_rem_req scsi 6 3 746d 779d 0/29 auto-obsoleted due to no activity on 2023/11/25 03:57
upstream KCSAN: data-race in sg_common_write / sg_finish_rem_req (2) scsi 6 1 500d 500d 0/29 auto-obsoleted due to no activity on 2024/07/27 17:57
upstream KCSAN: data-race in sg_common_write / sg_finish_rem_req (5) scsi 6 7 100d 191d 0/29 auto-obsoleted due to no activity on 2025/09/21 21:52
upstream KCSAN: data-race in sg_common_write / sg_finish_rem_req (3) scsi 6 14 384d 451d 0/29 auto-obsoleted due to no activity on 2024/11/20 21:45

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

write to 0xffff888118f8931d of 1 bytes by task 4185 on cpu 1:
 sg_unlink_reserve drivers/scsi/sg.c:2059 [inline]
 sg_finish_rem_req+0x11f/0x270 drivers/scsi/sg.c:1841
 sg_rq_end_io_usercontext+0x38/0x1c0 drivers/scsi/sg.c:1301
 process_one_work kernel/workqueue.c:3263 [inline]
 process_scheduled_works+0x4ce/0x9d0 kernel/workqueue.c:3346
 worker_thread+0x582/0x770 kernel/workqueue.c:3427
 kthread+0x489/0x510 kernel/kthread.c:463
 ret_from_fork+0x122/0x1b0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

read to 0xffff888118f8931d of 1 bytes by task 22561 on cpu 0:
 sg_start_req drivers/scsi/sg.c:1781 [inline]
 sg_common_write+0x961/0xc30 drivers/scsi/sg.c:799
 sg_new_write+0x7b6/0x890 drivers/scsi/sg.c:766
 sg_ioctl_common drivers/scsi/sg.c:931 [inline]
 sg_ioctl+0xb81/0x1360 drivers/scsi/sg.c:1156
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xce/0x140 fs/ioctl.c:583
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:583
 x64_sys_call+0x1816/0x3000 arch/x86/include/generated/asm/syscalls_64.h:17
 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: 0x01 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 22561 Comm: syz.1.22103 Tainted: G        W           syzkaller #0 PREEMPT(voluntary) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/01 19:45 upstream 691d401c7e0e 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in sg_common_write / sg_finish_rem_req
2025/10/30 14:38 upstream e53642b87a4f fd2207e7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in sg_common_write / sg_finish_rem_req
* Struck through repros no longer work on HEAD.