syzbot


KCSAN: data-race in blk_mq_rq_ctx_init / bt_tags_for_each

Status: auto-obsoleted due to no activity on 2023/12/26 18:09
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+fbf5308631c96a18b0ad@syzkaller.appspotmail.com
First crash: 318d, last: 318d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in blk_mq_rq_ctx_init / bt_tags_for_each (2) block 1 222d 222d 0/28 auto-obsoleted due to no activity on 2024/03/31 15:34

Sample crash report:
==================================================================
BUG: KCSAN: data-race in blk_mq_rq_ctx_init / bt_tags_for_each

write to 0xffff888102691a20 of 4 bytes by task 2880 on cpu 0:
 blk_mq_rq_ctx_init+0x193/0x300 block/blk-mq.c:371
 __blk_mq_alloc_requests+0x7ce/0x9e0 block/blk-mq.c:517
 blk_mq_get_new_requests block/blk-mq.c:2872 [inline]
 blk_mq_submit_bio+0x468/0xd90 block/blk-mq.c:2970
 __submit_bio+0x11c/0x350 block/blk-core.c:599
 __submit_bio_noacct_mq block/blk-core.c:678 [inline]
 submit_bio_noacct_nocheck+0x449/0x5e0 block/blk-core.c:707
 submit_bio_noacct+0x71c/0x8c0 block/blk-core.c:801
 submit_bio+0xb7/0xc0 block/blk-core.c:834
 iomap_dio_submit_bio fs/iomap/direct-io.c:80 [inline]
 iomap_dio_bio_iter+0xa50/0xbe0 fs/iomap/direct-io.c:417
 __iomap_dio_rw+0x8db/0x1090 fs/iomap/direct-io.c:659
 iomap_dio_rw+0x40/0x90 fs/iomap/direct-io.c:748
 ext4_dio_write_iter fs/ext4/file.c:575 [inline]
 ext4_file_write_iter+0xa8a/0xe10 fs/ext4/file.c:694
 call_write_iter include/linux/fs.h:2020 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x48a/0x790 fs/read_write.c:584
 ksys_write+0xeb/0x1a0 fs/read_write.c:637
 __do_sys_write fs/read_write.c:649 [inline]
 __se_sys_write fs/read_write.c:646 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:646
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff888102691a20 of 4 bytes by task 2878 on cpu 1:
 blk_mq_find_and_get_req block/blk-mq-tag.c:260 [inline]
 bt_tags_iter block/blk-mq-tag.c:356 [inline]
 __sbitmap_for_each_set include/linux/sbitmap.h:281 [inline]
 sbitmap_for_each_set include/linux/sbitmap.h:302 [inline]
 bt_tags_for_each+0x2e2/0x500 block/blk-mq-tag.c:391
 __blk_mq_all_tag_iter block/blk-mq-tag.c:402 [inline]
 blk_mq_tagset_busy_iter+0x114/0x150 block/blk-mq-tag.c:446
 scsi_host_busy+0x4f/0x80 drivers/scsi/hosts.c:604
 scsi_host_queue_ready drivers/scsi/scsi_lib.c:1341 [inline]
 scsi_queue_rq+0x310/0x1a30 drivers/scsi/scsi_lib.c:1735
 blk_mq_dispatch_rq_list+0x2d9/0x1090 block/blk-mq.c:2037
 __blk_mq_sched_dispatch_requests+0x1ce/0xd20 block/blk-mq-sched.c:301
 blk_mq_sched_dispatch_requests+0x99/0x100 block/blk-mq-sched.c:333
 blk_mq_run_hw_queue+0x2a4/0x4c0 block/blk-mq.c:2252
 blk_mq_flush_plug_list+0x7b6/0xdc0 block/blk-mq.c:2800
 blk_add_rq_to_plug+0x108/0x3e0 block/blk-mq.c:1294
 blk_mq_submit_bio+0x61a/0xd90 block/blk-mq.c:2996
 __submit_bio+0x11c/0x350 block/blk-core.c:599
 __submit_bio_noacct_mq block/blk-core.c:678 [inline]
 submit_bio_noacct_nocheck+0x4ad/0x5e0 block/blk-core.c:707
 submit_bio_noacct+0x71c/0x8c0 block/blk-core.c:801
 submit_bio+0xb7/0xc0 block/blk-core.c:834
 iomap_dio_submit_bio fs/iomap/direct-io.c:80 [inline]
 iomap_dio_bio_iter+0xa50/0xbe0 fs/iomap/direct-io.c:417
 __iomap_dio_rw+0x8db/0x1090 fs/iomap/direct-io.c:659
 iomap_dio_rw+0x40/0x90 fs/iomap/direct-io.c:748
 ext4_dio_write_iter fs/ext4/file.c:575 [inline]
 ext4_file_write_iter+0xa8a/0xe10 fs/ext4/file.c:694
 call_write_iter include/linux/fs.h:2020 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x48a/0x790 fs/read_write.c:584
 ksys_write+0xeb/0x1a0 fs/read_write.c:637
 __do_sys_write fs/read_write.c:649 [inline]
 __se_sys_write fs/read_write.c:646 [inline]
 __x64_sys_write+0x42/0x50 fs/read_write.c:646
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x00001f6c -> 0xffffffff

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 2878 Comm: syz-executor.2 Not tainted 6.7.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/21 18:08 upstream 98b1cc82c4af cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in blk_mq_rq_ctx_init / bt_tags_for_each
* Struck through repros no longer work on HEAD.