syzbot


KCSAN: data-race in blk_mq_start_request / bt_tags_for_each

Status: auto-obsoleted due to no activity on 2024/01/19 08:19
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+4d2dbfa833f40fc9f884@syzkaller.appspotmail.com
First crash: 185d, last: 146d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in blk_mq_start_request / bt_tags_for_each (2) block 1 58d 58d 0/26 auto-obsoleted due to no activity on 2024/04/16 04:54

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

write to 0xffff888101e61f18 of 8 bytes by task 77 on cpu 1:
 blk_mq_start_request+0x172/0x2d0 block/blk-mq.c:1262
 scsi_queue_rq+0x14cc/0x1a30 drivers/scsi/scsi_lib.c:1757
 blk_mq_dispatch_rq_list+0x2d9/0x1090 block/blk-mq.c:2049
 __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+0x99/0x100 block/blk-mq-sched.c:333
 blk_mq_run_work_fn+0x65/0xe0 block/blk-mq.c:2434
 process_one_work kernel/workqueue.c:2627 [inline]
 process_scheduled_works+0x5b8/0xa30 kernel/workqueue.c:2700
 worker_thread+0x525/0x730 kernel/workqueue.c:2781
 kthread+0x1d7/0x210 kernel/kthread.c:388
 ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242

read to 0xffff888101e61f18 of 8 bytes by task 21849 on cpu 0:
 blk_mq_find_and_get_req block/blk-mq-tag.c:259 [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+0x2cc/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:2049
 __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:2264
 blk_mq_flush_plug_list+0x7b6/0xdc0 block/blk-mq.c:2812
 blk_add_rq_to_plug+0x108/0x3e0 block/blk-mq.c:1294
 blk_mq_submit_bio+0x61a/0xd90 block/blk-mq.c:3008
 __submit_bio+0x11c/0x350 block/blk-core.c:607
 __submit_bio_noacct_mq block/blk-core.c:686 [inline]
 submit_bio_noacct_nocheck+0x4ad/0x5e0 block/blk-core.c:715
 submit_bio_noacct+0x70c/0x8c0 block/blk-core.c:809
 submit_bio+0xb7/0xc0 block/blk-core.c:842
 ext4_io_submit fs/ext4/page-io.c:378 [inline]
 io_submit_add_bh fs/ext4/page-io.c:419 [inline]
 ext4_bio_write_folio+0x6c0/0x9a0 fs/ext4/page-io.c:563
 mpage_submit_folio fs/ext4/inode.c:1875 [inline]
 mpage_map_and_submit_buffers fs/ext4/inode.c:2121 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2260 [inline]
 ext4_do_writepages+0x139f/0x2100 fs/ext4/inode.c:2685
 ext4_writepages+0x15e/0x2e0 fs/ext4/inode.c:2774
 do_writepages+0x1c2/0x340 mm/page-writeback.c:2553
 filemap_fdatawrite_wbc+0xdb/0xf0 mm/filemap.c:387
 __filemap_fdatawrite_range mm/filemap.c:420 [inline]
 __filemap_fdatawrite mm/filemap.c:426 [inline]
 filemap_flush+0x95/0xc0 mm/filemap.c:453
 ext4_alloc_da_blocks+0x50/0x130 fs/ext4/inode.c:3077
 ext4_release_file+0x5f/0x1c0 fs/ext4/file.c:169
 __fput+0x299/0x630 fs/file_table.c:394
 ____fput+0x15/0x20 fs/file_table.c:422
 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:1021
 get_signal+0xf4e/0x10a0 kernel/signal.c:2904
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:309
 exit_to_user_mode_loop+0x6f/0xe0 kernel/entry/common.c:168
 exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204
 irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:309
 irqentry_exit+0x12/0x40 kernel/entry/common.c:412
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570

value changed: 0xffff8881026cc300 -> 0xffff8881026cb600

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 21849 Comm: syz-executor.1 Not tainted 6.7.0-rc5-syzkaller-00125-gc7402612e2e6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/15 08:18 upstream c7402612e2e6 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in blk_mq_start_request / bt_tags_for_each
2023/11/05 23:27 upstream 1c41041124bd 500bfdc4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in blk_mq_start_request / bt_tags_for_each
* Struck through repros no longer work on HEAD.