[moderation] [scsi?] KCSAN: data-race in sg_ioctl / sg_rq_end_io (4)

1 view
Skip to first unread message

syzbot

unread,
Mar 10, 2024, 11:15:24 PMMar 10
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: fa4b851b4ad6 Merge tag 'trace-ring-buffer-v6.8-rc7' of git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13fb32fa180000
kernel config: https://syzkaller.appspot.com/x/.config?x=68a9b6ec15207f27
dashboard link: https://syzkaller.appspot.com/bug?extid=b1d221b937727c790159
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [dgil...@interlog.com je...@linux.ibm.com linux-...@vger.kernel.org linux...@vger.kernel.org martin....@oracle.com]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/79f575ff1bd7/disk-fa4b851b.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d64cbaeb67d8/vmlinux-fa4b851b.xz
kernel image: https://storage.googleapis.com/syzbot-assets/838fa1b578ba/bzImage-fa4b851b.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b1d221...@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in sg_ioctl / sg_rq_end_io

write to 0xffff888141dfe11c of 4 bytes by interrupt on cpu 1:
sg_rq_end_io+0x154/0x700 drivers/scsi/sg.c:1347
__blk_mq_end_request+0x27a/0x2b0 block/blk-mq.c:1050
scsi_end_request+0x2a5/0x4e0 drivers/scsi/scsi_lib.c:574
scsi_io_completion+0xc7/0x200 drivers/scsi/scsi_lib.c:977
scsi_finish_command+0x1bb/0x1d0 drivers/scsi/scsi.c:198
scsi_complete+0x19a/0x1d0 drivers/scsi/scsi_lib.c:1439
blk_complete_reqs block/blk-mq.c:1135 [inline]
blk_done_softirq+0x73/0xa0 block/blk-mq.c:1140
__do_softirq+0xc4/0x27b kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0x3b/0x90 kernel/softirq.c:644
common_interrupt+0x81/0x90 arch/x86/kernel/irq.c:247
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:640
kcsan_setup_watchpoint+0x3fe/0x410 kernel/kcsan/core.c:705
ext4_fill_raw_inode+0x51b/0xe90
ext4_do_update_inode fs/ext4/inode.c:5079 [inline]
ext4_mark_iloc_dirty+0x2e9/0xe10 fs/ext4/inode.c:5709
__ext4_mark_inode_dirty+0x314/0x440 fs/ext4/inode.c:5913
ext4_dirty_inode+0x91/0xb0 fs/ext4/inode.c:5942
__mark_inode_dirty+0x169/0x7d0 fs/fs-writeback.c:2452
mark_inode_dirty include/linux/fs.h:2382 [inline]
dquot_alloc_space include/linux/quotaops.h:319 [inline]
dquot_alloc_block include/linux/quotaops.h:336 [inline]
ext4_mb_new_blocks+0x1041/0x21e0 fs/ext4/mballoc.c:6169
ext4_ext_map_blocks+0x10a1/0x33b0 fs/ext4/extents.c:4317
ext4_map_blocks+0x72a/0xf50 fs/ext4/inode.c:623
ext4_getblk+0x112/0x510 fs/ext4/inode.c:833
ext4_bread+0x2c/0x110 fs/ext4/inode.c:889
ext4_append+0x164/0x2a0 fs/ext4/namei.c:83
ext4_init_new_dir+0x17f/0x510 fs/ext4/namei.c:2978
ext4_mkdir+0x312/0x740 fs/ext4/namei.c:3024
vfs_mkdir+0x1ef/0x2f0 fs/namei.c:4126
do_mkdirat+0x12f/0x2a0 fs/namei.c:4149
__do_sys_mkdirat fs/namei.c:4164 [inline]
__se_sys_mkdirat fs/namei.c:4162 [inline]
__x64_sys_mkdirat+0x50/0x60 fs/namei.c:4162
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff888141dfe11c of 4 bytes by task 11511 on cpu 0:
sg_fill_request_table drivers/scsi/sg.c:878 [inline]
sg_ioctl_common drivers/scsi/sg.c:1086 [inline]
sg_ioctl+0x96b/0x1870 drivers/scsi/sg.c:1160
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl+0xcf/0x140 fs/ioctl.c:857
__x64_sys_ioctl+0x43/0x50 fs/ioctl.c:857
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x00029a9a -> 0x00000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 11511 Comm: syz-executor.3 Not tainted 6.8.0-rc7-syzkaller-00260-gfa4b851b4ad6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages