syzbot


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

Status: moderation: reported on 2025/01/30 00:57
Subsystems: scsi
[Documentation on labels]
Reported-by: syzbot+877f78011c0ddb8121b5@syzkaller.appspotmail.com
First crash: 6d05h, last: 6d05h
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in sg_common_write / sg_finish_rem_req scsi 3 473d 506d 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 227d 227d 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 111d 178d 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 0xffff8881170d331d of 1 bytes by task 3372 on cpu 1:
 sg_unlink_reserve drivers/scsi/sg.c:2061 [inline]
 sg_finish_rem_req+0x117/0x270 drivers/scsi/sg.c:1843
 sg_rq_end_io_usercontext+0x36/0x1c0 drivers/scsi/sg.c:1302
 process_one_work kernel/workqueue.c:3236 [inline]
 process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3317
 worker_thread+0x51d/0x6f0 kernel/workqueue.c:3398
 kthread+0x4ae/0x520 kernel/kthread.c:464
 ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

read to 0xffff8881170d331d of 1 bytes by task 7854 on cpu 0:
 sg_start_req drivers/scsi/sg.c:1783 [inline]
 sg_common_write+0x659/0x8d0 drivers/scsi/sg.c:799
 sg_new_write+0x82b/0x8e0 drivers/scsi/sg.c:766
 sg_ioctl_common drivers/scsi/sg.c:931 [inline]
 sg_ioctl+0xe22/0x1870 drivers/scsi/sg.c:1156
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:906 [inline]
 __se_sys_ioctl+0xc9/0x140 fs/ioctl.c:892
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:892
 x64_sys_call+0x1690/0x2dc0 arch/x86/include/generated/asm/syscalls_64.h:17
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x01 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 7854 Comm: syz.0.1549 Not tainted 6.13.0-syzkaller-09383-gebbb8be421ee #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
==================================================================

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