syzbot


KCSAN: data-race in sg_fill_request_table / sg_rq_end_io

Status: moderation: reported on 2025/05/27 16:13
Subsystems: scsi
[Documentation on labels]
Reported-by: syzbot+c9d05b79ba1064aa8bc5@syzkaller.appspotmail.com
First crash: 2d17h, last: 2d17h

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

write to 0xffff888146158111 of 1 bytes by interrupt on cpu 1:
 sg_rq_end_io+0x1a2/0x740 drivers/scsi/sg.c:1349
 __blk_mq_end_request+0x25d/0x350 block/blk-mq.c:1139
 scsi_end_request+0x29c/0x4c0 drivers/scsi/scsi_lib.c:670
 scsi_io_completion+0x7f/0x200 drivers/scsi/scsi_lib.c:1078
 scsi_finish_command+0x1c7/0x1e0 drivers/scsi/scsi.c:198
 scsi_complete+0xc3/0x1e0 drivers/scsi/scsi_lib.c:1547
 blk_complete_reqs block/blk-mq.c:1224 [inline]
 blk_done_softirq+0x77/0xb0 block/blk-mq.c:1229
 handle_softirqs+0xb7/0x290 kernel/softirq.c:579
 __do_softirq kernel/softirq.c:613 [inline]
 invoke_softirq kernel/softirq.c:453 [inline]
 __irq_exit_rcu+0x3a/0xc0 kernel/softirq.c:680
 common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:285
 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:693
 kcsan_setup_watchpoint+0x415/0x430 kernel/kcsan/core.c:705
 skb_end_pointer include/linux/skbuff.h:1681 [inline]
 skb_release_data+0x41/0x4e0 net/core/skbuff.c:1076
 skb_release_all net/core/skbuff.c:1162 [inline]
 __kfree_skb+0x44/0x150 net/core/skbuff.c:1176
 sk_skb_reason_drop+0xbd/0x270 net/core/skbuff.c:1214
 kfree_skb_reason include/linux/skbuff.h:1279 [inline]
 kfree_skb include/linux/skbuff.h:1288 [inline]
 kauditd_hold_skb+0x101/0x1c0 kernel/audit.c:611
 kauditd_send_queue+0x273/0x2c0 kernel/audit.c:766
 kauditd_thread+0x421/0x630 kernel/audit.c:890
 kthread+0x486/0x510 kernel/kthread.c:464
 ret_from_fork+0x4e/0x60 arch/x86/kernel/process.c:148
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

read to 0xffff888146158111 of 1 bytes by task 9226 on cpu 0:
 sg_fill_request_table+0x65/0x1e0 drivers/scsi/sg.c:865
 sg_ioctl_common drivers/scsi/sg.c:1082 [inline]
 sg_ioctl+0x6b1/0x1360 drivers/scsi/sg.c:1156
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:907 [inline]
 __se_sys_ioctl+0xce/0x140 fs/ioctl.c:893
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:893
 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/0x1b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00 -> 0x01

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 9226 Comm: syz.3.2109 Not tainted 6.15.0-syzkaller-01958-g785cdec46e92 #0 PREEMPT(voluntary) 
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/05/27 16:12 upstream 785cdec46e92 874a1386 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in sg_fill_request_table / sg_rq_end_io
* Struck through repros no longer work on HEAD.