syzbot


KCSAN: data-race in blk_mq_rq_ctx_init / bt_tags_for_each (2)

Status: auto-obsoleted due to no activity on 2024/03/31 15:34
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+f3d1ce7f36ed50bd8941@syzkaller.appspotmail.com
First crash: 53d, last: 53d
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 block 1 149d 129d 0/26 auto-obsoleted due to no activity on 2023/12/26 18:09

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

write to 0xffff888102d757e0 of 4 bytes by task 2273 on cpu 0:
 blk_mq_rq_ctx_init+0x18d/0x2f0 block/blk-mq.c:370
 __blk_mq_alloc_requests+0x7c8/0xa40 block/blk-mq.c:516
 blk_mq_get_new_requests block/blk-mq.c:2905 [inline]
 blk_mq_submit_bio+0x417/0xe30 block/blk-mq.c:3001
 __submit_bio+0x11c/0x350 block/blk-core.c:608
 __submit_bio_noacct_mq block/blk-core.c:687 [inline]
 submit_bio_noacct_nocheck+0x4ad/0x5e0 block/blk-core.c:716
 submit_bio_noacct+0x67d/0x830 block/blk-core.c:826
 submit_bio+0x212/0x220 block/blk-core.c:868
 ext4_io_submit+0x8a/0xa0 fs/ext4/page-io.c:378
 ext4_do_writepages+0xb3a/0x2100 fs/ext4/inode.c:2699
 ext4_writepages+0x15e/0x2e0 fs/ext4/inode.c:2768
 do_writepages+0x1c2/0x340 mm/page-writeback.c:2553
 filemap_fdatawrite_wbc+0xdb/0xf0 mm/filemap.c:388
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 __filemap_fdatawrite mm/filemap.c:427 [inline]
 filemap_flush+0x95/0xc0 mm/filemap.c:454
 ext4_alloc_da_blocks+0x50/0x130 fs/ext4/inode.c:3072
 ext4_release_file+0x5f/0x1c0 fs/ext4/file.c:169
 __fput+0x299/0x630 fs/file_table.c:376
 ____fput+0x15/0x20 fs/file_table.c:404
 task_work_run+0x135/0x1a0 kernel/task_work.c:180
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x604/0x16d0 kernel/exit.c:871
 do_group_exit+0x101/0x150 kernel/exit.c:1020
 get_signal+0xf4e/0x10a0 kernel/signal.c:2893
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop kernel/entry/common.c:105 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 irqentry_exit_to_user_mode+0x9c/0x130 kernel/entry/common.c:225
 irqentry_exit+0x12/0x40 kernel/entry/common.c:328
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

read to 0xffff888102d757e0 of 4 bytes by task 2264 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:1343 [inline]
 scsi_queue_rq+0x2f3/0x1a00 drivers/scsi/scsi_lib.c:1737
 blk_mq_dispatch_rq_list+0x2d9/0x10a0 block/blk-mq.c:2070
 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:170 [inline]
 blk_mq_do_dispatch_sched block/blk-mq-sched.c:184 [inline]
 __blk_mq_sched_dispatch_requests+0x5ec/0xd20 block/blk-mq-sched.c:309
 blk_mq_sched_dispatch_requests+0x78/0xe0 block/blk-mq-sched.c:331
 blk_mq_run_hw_queue+0x298/0x4c0 block/blk-mq.c:2285
 blk_mq_flush_plug_list+0x7a7/0xdc0 block/blk-mq.c:2833
 blk_add_rq_to_plug+0x102/0x3d0 block/blk-mq.c:1299
 blk_mq_submit_bio+0x5c8/0xe30 block/blk-mq.c:3027
 __submit_bio+0x11c/0x350 block/blk-core.c:608
 __submit_bio_noacct_mq block/blk-core.c:687 [inline]
 submit_bio_noacct_nocheck+0x4ad/0x5e0 block/blk-core.c:716
 submit_bio_noacct+0x67d/0x830 block/blk-core.c:826
 submit_bio+0x212/0x220 block/blk-core.c:868
 ext4_io_submit+0x8a/0xa0 fs/ext4/page-io.c:378
 ext4_do_writepages+0xb3a/0x2100 fs/ext4/inode.c:2699
 ext4_writepages+0x15e/0x2e0 fs/ext4/inode.c:2768
 do_writepages+0x1c2/0x340 mm/page-writeback.c:2553
 filemap_fdatawrite_wbc+0xdb/0xf0 mm/filemap.c:388
 __filemap_fdatawrite_range mm/filemap.c:421 [inline]
 __filemap_fdatawrite mm/filemap.c:427 [inline]
 filemap_flush+0x95/0xc0 mm/filemap.c:454
 ext4_alloc_da_blocks+0x50/0x130 fs/ext4/inode.c:3072
 ext4_release_file+0x5f/0x1c0 fs/ext4/file.c:169
 __fput+0x299/0x630 fs/file_table.c:376
 ____fput+0x15/0x20 fs/file_table.c:404
 task_work_run+0x135/0x1a0 kernel/task_work.c:180
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x604/0x16d0 kernel/exit.c:871
 do_group_exit+0x101/0x150 kernel/exit.c:1020
 get_signal+0xf4e/0x10a0 kernel/signal.c:2893
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:310
 exit_to_user_mode_loop kernel/entry/common.c:105 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 irqentry_exit_to_user_mode+0x9c/0x130 kernel/entry/common.c:225
 irqentry_exit+0x12/0x40 kernel/entry/common.c:328
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

value changed: 0x00001d25 -> 0xffffffff

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 2264 Comm: syz-executor.1 Not tainted 6.8.0-rc5-syzkaller-00329-gab0a97cffa0b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/25 15:33 upstream ab0a97cffa0b 8d446f15 .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.