syzbot


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

Status: moderation: reported on 2025/04/28 01:01
Subsystems: scsi
[Documentation on labels]
Reported-by: syzbot+0e7d81703b9f895856dc@syzkaller.appspotmail.com
First crash: 6d09h, last: 6d09h
Similar bugs (4)
Kernel Title 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 72d 94d 0/28 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 3 561d 594d 0/28 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 1 315d 315d 0/28 auto-obsoleted due to no activity on 2024/07/27 17:57
upstream KCSAN: data-race in sg_common_write / sg_finish_rem_req (3) scsi 14 199d 266d 0/28 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 0xffff88810794131d of 1 bytes by task 3382 on cpu 1:
 sg_unlink_reserve drivers/scsi/sg.c:2061 [inline]
 sg_finish_rem_req+0x11f/0x270 drivers/scsi/sg.c:1843
 sg_rq_end_io_usercontext+0x38/0x1c0 drivers/scsi/sg.c:1302
 process_one_work kernel/workqueue.c:3238 [inline]
 process_scheduled_works+0x4cb/0x9d0 kernel/workqueue.c:3319
 worker_thread+0x582/0x770 kernel/workqueue.c:3400
 kthread+0x486/0x510 kernel/kthread.c:464
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

read to 0xffff88810794131d of 1 bytes by task 5122 on cpu 0:
 sg_start_req drivers/scsi/sg.c:1783 [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:906 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:892
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:892
 x64_sys_call+0x19a8/0x2fb0 arch/x86/include/generated/asm/syscalls_64.h:17
 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

value changed: 0x01 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 5122 Comm: syz.2.620 Not tainted 6.15.0-rc4-syzkaller #0 PREEMPT(voluntary) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/28 01:00 upstream b4432656b36e c6b4fb39 .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.