possible deadlock in blk_request_module

Status: upstream: reported on 2026/09/05 07:50
Reported-by: syzbot+086639defea9c90fec13@syzkaller.appspotmail.com
First crash: 23h06m, last: 23h06m
Similar bugs (5)
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 262d 424d 0/3 auto-obsoleted due to no activity on 2026/03/27 18:48
linux-5.15 possible deadlock in blk_request_module (3) 4 2 132d 155d 0/3 auto-obsoleted due to no activity on 2026/08/04 13:53
upstream possible deadlock in blk_request_module (2) prio:low block 4 97 4h20m 103d 0/29 upstream: reported on 2026/05/25 20:24
linux-5.15 possible deadlock in blk_request_module 4 6 659d 789d 0/3 auto-obsoleted due to no activity on 2025/02/24 02:18
upstream possible deadlock in blk_request_module block 4 2 1764d 1809d 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.5.6586/694 is trying to acquire lock:
ffff888019ec8138 ((wq_completion)md_misc){+.+.}-{0:0}, at: touch_wq_lockdep_map kernel/workqueue.c:3183 [inline]
ffff888019ec8138 ((wq_completion)md_misc){+.+.}-{0:0}, at: __flush_workqueue+0x150/0x1380 kernel/workqueue.c:3213

but task is already holding lock:
ffffffff8d7bf0e8 (major_names_lock){+.+.}-{3:3}, at: blk_probe_dev block/genhd.c:771 [inline]
ffffffff8d7bf0e8 (major_names_lock){+.+.}-{3:3}, at: blk_request_module+0x35/0x290 block/genhd.c:787

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (major_names_lock){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x135/0xc80 kernel/locking/mutex.c:747
       blk_probe_dev block/genhd.c:771 [inline]
       blk_request_module+0x35/0x290 block/genhd.c:787
       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:3725
       new_dev_store+0x389/0x650 drivers/md/md.c:-1
       md_attr_store+0x196/0x380 drivers/md/md.c:5630
       kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
       call_write_iter include/linux/fs.h:2018 [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 (&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:592 [inline]
       array_state_store+0x2ec/0x980 drivers/md/md.c:4459
       md_attr_store+0x196/0x380 drivers/md/md.c:5630
       kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
       call_write_iter include/linux/fs.h:2018 [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

-> #2 (kn->active#63){++++}-{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

-> #1 ((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

-> #0 ((wq_completion)md_misc){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
       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:5705
       md_alloc_and_put+0x1a/0x1b0 drivers/md/md.c:5796
       blk_probe_dev block/genhd.c:774 [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
       swsusp_check+0x5b/0x390 kernel/power/swap.c:1525
       software_resume+0x4d/0x2d0 kernel/power/hibernate.c:958
       resume_store+0x334/0x4c0 kernel/power/hibernate.c:1216
       kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
       call_write_iter include/linux/fs.h:2018 [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:
  (wq_completion)md_misc --> &mddev->reconfig_mutex --> major_names_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(major_names_lock);
                               lock(&mddev->reconfig_mutex);
                               lock(major_names_lock);
  lock((wq_completion)md_misc);

 *** DEADLOCK ***

6 locks held by syz.5.6586/694:
 #0: ffff88806d3f1c48 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2a3/0x330 fs/file.c:1040
 #1: ffff88802f4b6418 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x21e/0x9a0 fs/read_write.c:580
 #2: ffff88801bb95888 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1dc/0x520 fs/kernfs/file.c:343
 #3: ffff888142e617c8 (kn->active#94){.+.+}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:80 [inline]
 #3: ffff888142e617c8 (kn->active#94){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x236/0x520 fs/kernfs/file.c:344
 #4: ffffffff8cfe5be8 (system_transition_mutex){+.+.}-{3:3}, at: software_resume+0x43/0x2d0 kernel/power/hibernate.c:957
 #5: ffffffff8d7bf0e8 (major_names_lock){+.+.}-{3:3}, at: blk_probe_dev block/genhd.c:771 [inline]
 #5: ffffffff8d7bf0e8 (major_names_lock){+.+.}-{3:3}, at: blk_request_module+0x35/0x290 block/genhd.c:787

stack backtrace:
CPU: 1 PID: 694 Comm: syz.5.6586 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 kernel/locking/lockdep.c:2187
 check_prev_add kernel/locking/lockdep.c:3134 [inline]
 check_prevs_add kernel/locking/lockdep.c:3253 [inline]
 validate_chain kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x37ef/0x7d80 kernel/locking/lockdep.c:5137
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
 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:5705
 md_alloc_and_put+0x1a/0x1b0 drivers/md/md.c:5796
 blk_probe_dev block/genhd.c:774 [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
 swsusp_check+0x5b/0x390 kernel/power/swap.c:1525
 software_resume+0x4d/0x2d0 kernel/power/hibernate.c:958
 resume_store+0x334/0x4c0 kernel/power/hibernate.c:1216
 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352
 call_write_iter include/linux/fs.h:2018 [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:0x7f5c3b79e159
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:00007f5c3c5a2028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f5c3ba25fa0 RCX: 00007f5c3b79e159
RDX: 0000000000000012 RSI: 0000200000000040 RDI: 0000000000000003
RBP: 00007f5c3b835024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5c3ba26038 R14: 00007f5c3ba25fa0 R15: 00007fff9b06a378
 </TASK>
block device autoloading is deprecated and will be removed.
bio_check_eod: 8 callbacks suppressed
syz.5.6586: attempt to access beyond end of device
md32: rw=2048, sector=0, nr_sectors = 8 limit=0
PM: Image not found (code -5)

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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.