possible deadlock in blk_request_module

Status: upstream: reported on 2026/09/05 07:50
Reported-by: syzbot+086639defea9c90fec13@syzkaller.appspotmail.com
First crash: 47d, last: 1d00h
▶ ▼ Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in blk_request_module (2) 4 6 309d 470d 0/3 auto-obsoleted due to no activity on 2026/03/27 18:48
linux-6.1 possible deadlock in blk_request_module 4 5 1d20h 1d23h 0/3 upstream: reported on 2026/10/20 20:24
linux-5.15 possible deadlock in blk_request_module (4) 4 9 3h26m 41d 0/3 upstream: reported on 2026/09/10 23:54
linux-5.15 possible deadlock in blk_request_module (3) 4 2 179d 201d 0/3 auto-obsoleted due to no activity on 2026/08/04 13:53
upstream possible deadlock in blk_request_module (2) prio:low raid block 4 C 360 32m 149d 0/29 upstream: reported C repro on 2026/05/25 20:24
linux-5.15 possible deadlock in blk_request_module 4 6 705d 835d 0/3 auto-obsoleted due to no activity on 2025/02/24 02:18
upstream possible deadlock in blk_request_module block 4 2 1810d 1855d 0/29 auto-closed as invalid on 2022/03/06 21:21

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.9.3793/19825 is trying to acquire lock:
ffffffff8e5b3688 (major_names_lock){+.+.}-{3:3}, at: blk_probe_dev block/genhd.c:779 [inline]
ffffffff8e5b3688 (major_names_lock){+.+.}-{3:3}, at: blk_request_module+0x35/0x290 block/genhd.c:795

but task is already holding lock:
ffff888079278360 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: mddev_lock drivers/md/md.h:593 [inline]
ffff888079278360 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: new_dev_store+0x21e/0x650 drivers/md/md.c:4718

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (&mddev->reconfig_mutex){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       mddev_lock drivers/md/md.h:593 [inline]
       array_state_store+0x2ef/0xb00 drivers/md/md.c:4572
       md_attr_store+0x19c/0x390 drivers/md/md.c:5756
       kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
       call_write_iter include/linux/fs.h:2019 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x474/0x9a0 fs/read_write.c:584
       ksys_write+0x151/0x260 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #3 (kn->active#79){++++}-{0:0}:
       kernfs_drain+0x31e/0x6d0 fs/kernfs/dir.c:500
       __kernfs_remove+0x426/0x830 fs/kernfs/dir.c:1486
       kernfs_remove_by_name_ns+0xdc/0x150 fs/kernfs/dir.c:1695
       kernfs_remove_by_name include/linux/kernfs.h:624 [inline]
       remove_files fs/sysfs/group.c:28 [inline]
       sysfs_remove_group+0x101/0x290 fs/sysfs/group.c:292
       sysfs_remove_groups+0x54/0xa0 fs/sysfs/group.c:316
       __kobject_del+0x83/0x2e0 lib/kobject.c:595
       kobject_cleanup lib/kobject.c:680 [inline]
       kobject_release lib/kobject.c:720 [inline]
       kref_put include/linux/kref.h:65 [inline]
       kobject_put+0x233/0x450 lib/kobject.c:737
       process_one_work kernel/workqueue.c:2657 [inline]
       process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734
       worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815
       kthread+0x2fa/0x390 kernel/kthread.c:388
       ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
       ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

-> #2 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}:
       process_one_work kernel/workqueue.c:2633 [inline]
       process_scheduled_works+0x9ab/0x1600 kernel/workqueue.c:2734
       worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815
       kthread+0x2fa/0x390 kernel/kthread.c:388
       ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
       ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

-> #1 ((wq_completion)md_misc){+.+.}-{0:0}:
       touch_wq_lockdep_map kernel/workqueue.c:3183 [inline]
       __flush_workqueue+0x169/0x1380 kernel/workqueue.c:3213
       md_alloc+0x33/0xe90 drivers/md/md.c:5831
       md_alloc_and_put+0x1a/0x1b0 drivers/md/md.c:5922
       blk_probe_dev block/genhd.c:782 [inline]
       blk_request_module+0x272/0x290 block/genhd.c:-1
       blkdev_get_no_open+0x37/0xc0 block/bdev.c:724
       blkdev_get_by_dev+0x64/0x610 block/bdev.c:782
       blkdev_open+0x14e/0x360 block/fops.c:589
       do_dentry_open+0x880/0x14b0 fs/open.c:929
       do_open fs/namei.c:3695 [inline]
       path_openat+0x284f/0x3270 fs/namei.c:3856
       do_filp_open+0x1f2/0x430 fs/namei.c:3883
       do_sys_openat2+0x134/0x1d0 fs/open.c:1422
       do_sys_open fs/open.c:1437 [inline]
       __do_sys_openat fs/open.c:1453 [inline]
       __se_sys_openat fs/open.c:1448 [inline]
       __x64_sys_openat+0x139/0x160 fs/open.c:1448
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (major_names_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3162 [inline]
       check_prevs_add kernel/locking/lockdep.c:3281 [inline]
       validate_chain kernel/locking/lockdep.c:3897 [inline]
       __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       blk_probe_dev block/genhd.c:779 [inline]
       blk_request_module+0x35/0x290 block/genhd.c:795
       blkdev_get_no_open+0x37/0xc0 block/bdev.c:724
       blkdev_get_by_dev+0x64/0x610 block/bdev.c:782
       md_import_device+0x398/0x7b0 drivers/md/md.c:3838
       new_dev_store+0x389/0x650 drivers/md/md.c:-1
       md_attr_store+0x19c/0x390 drivers/md/md.c:5756
       kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
       call_write_iter include/linux/fs.h:2019 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x474/0x9a0 fs/read_write.c:584
       ksys_write+0x151/0x260 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  major_names_lock --> kn->active#79 --> &mddev->reconfig_mutex

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&mddev->reconfig_mutex);
                               lock(kn->active#79);
                               lock(&mddev->reconfig_mutex);
  lock(major_names_lock);

 *** DEADLOCK ***

5 locks held by syz.9.3793/19825:
 #0: ffff88805e010fc8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2a3/0x330 fs/file.c:1040
 #1: ffff88802e398418 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x21e/0x9a0 fs/read_write.c:580
 #2: ffff88805ebd4088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1dc/0x520 fs/kernfs/file.c:343
 #3: ffff88807b08b8c0 (kn->active#78){.+.+}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:80 [inline]
 #3: ffff88807b08b8c0 (kn->active#78){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x236/0x520 fs/kernfs/file.c:344
 #4: ffff888079278360 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: mddev_lock drivers/md/md.h:593 [inline]
 #4: ffff888079278360 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: new_dev_store+0x21e/0x650 drivers/md/md.c:4718

stack backtrace:
CPU: 0 PID: 19825 Comm: syz.9.3793 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2215
 check_prev_add kernel/locking/lockdep.c:3162 [inline]
 check_prevs_add kernel/locking/lockdep.c:3281 [inline]
 validate_chain kernel/locking/lockdep.c:3897 [inline]
 __lock_acquire+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
 blk_probe_dev block/genhd.c:779 [inline]
 blk_request_module+0x35/0x290 block/genhd.c:795
 blkdev_get_no_open+0x37/0xc0 block/bdev.c:724
 blkdev_get_by_dev+0x64/0x610 block/bdev.c:782
 md_import_device+0x398/0x7b0 drivers/md/md.c:3838
 new_dev_store+0x389/0x650 drivers/md/md.c:-1
 md_attr_store+0x19c/0x390 drivers/md/md.c:5756
 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2019 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x474/0x9a0 fs/read_write.c:584
 ksys_write+0x151/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f015ed9f559
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f015fcaa028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f015f025fa0 RCX: 00007f015ed9f559
RDX: 0000000000000016 RSI: 00002000000002c0 RDI: 0000000000000004
RBP: 00007f015ee36b20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f015f026038 R14: 00007f015f025fa0 R15: 00007ffd5599e688
 </TASK>
block device autoloading is deprecated and will be removed.

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/21 19:21 linux-6.6.y 0aebf2870d53 61c200c7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in blk_request_module
2026/10/20 23:43 linux-6.6.y cecd39af8a1a df8746fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in blk_request_module
2026/09/05 07:49 linux-6.6.y 8b73de7da85f 4f7b22a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in blk_request_module
* Struck through repros no longer work on HEAD.