possible deadlock in blk_request_module

Status: upstream: reported on 2026/10/20 20:24
Reported-by: syzbot+49e5efd97029dc10b94d@syzkaller.appspotmail.com
First crash: 2d11h, last: 4h15m
▶ ▼ 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 471d 0/3 auto-obsoleted due to no activity on 2026/03/27 18:48
linux-5.15 possible deadlock in blk_request_module (4) 4 9 15h29m 42d 0/3 upstream: reported on 2026/09/10 23:54
linux-5.15 possible deadlock in blk_request_module (3) 4 2 179d 202d 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 369 1h07m 150d 0/29 upstream: reported C repro on 2026/05/25 20:24
linux-6.6 possible deadlock in blk_request_module 4 3 1d12h 48d 0/2 upstream: reported on 2026/09/05 07:50
linux-5.15 possible deadlock in blk_request_module 4 6 706d 836d 0/3 auto-obsoleted due to no activity on 2025/02/24 02:18
upstream possible deadlock in blk_request_module block 4 2 1811d 1856d 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.8.2485/12526 is trying to acquire lock:
ffffffff8df9d748
 (major_names_lock){+.+.}-{3:3}
, at: blk_probe_dev block/genhd.c:753 [inline]
, at: blk_request_module+0x31/0x290 block/genhd.c:769

but task is already holding lock:
ffff8880785e02d0 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: mddev_lock drivers/md/md.h:577 [inline]
ffff8880785e02d0 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: md_ioctl+0xab2/0x2880 drivers/md/md.c:7681

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+0x12d/0xae0 kernel/locking/mutex.c:747
       mddev_lock drivers/md/md.h:577 [inline]
       array_state_store+0x2e4/0x9c0 drivers/md/md.c:4479
       md_attr_store+0x183/0x220 drivers/md/md.c:5633
       kernfs_fop_write_iter+0x3a0/0x520 fs/kernfs/file.c:352
       call_write_iter include/linux/fs.h:2271 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x482/0x9a0 fs/read_write.c:584
       ksys_write+0x14d/0x260 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #3 (kn->active#74){++++}-{0:0}:
       kernfs_drain+0x31a/0x6d0 fs/kernfs/dir.c:499
       __kernfs_remove+0x3f4/0x6c0 fs/kernfs/dir.c:1461
       kernfs_remove_by_name_ns+0xd8/0x150 fs/kernfs/dir.c:1667
       kernfs_remove_by_name include/linux/kernfs.h:622 [inline]
       remove_files fs/sysfs/group.c:28 [inline]
       sysfs_remove_group+0xfd/0x290 fs/sysfs/group.c:288
       sysfs_remove_groups+0x50/0xa0 fs/sysfs/group.c:312
       __kobject_del+0x83/0x2e0 lib/kobject.c:587
       kobject_cleanup lib/kobject.c:672 [inline]
       kobject_release lib/kobject.c:712 [inline]
       kref_put include/linux/kref.h:65 [inline]
       kobject_put+0x22f/0x450 lib/kobject.c:729
       process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
       worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
       kthread+0x29d/0x330 kernel/kthread.c:376
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

-> #2 (
(work_completion)(&mddev->del_work)){+.+.}-{0:0}:
       process_one_work+0x7ec/0x1160 kernel/workqueue.c:2268
       worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
       kthread+0x29d/0x330 kernel/kthread.c:376
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

-> #1 (
(wq_completion)md_misc){+.+.}-{0:0}:
       __flush_workqueue+0x165/0x1380 kernel/workqueue.c:2812
       md_alloc+0x2e/0xd00 drivers/md/md.c:5708
       md_alloc_and_put drivers/md/md.c:5800 [inline]
       md_probe+0x53/0xc0 drivers/md/md.c:5813
       blk_probe_dev block/genhd.c:756 [inline]
       blk_request_module+0x26e/0x290 block/genhd.c:-1
       blkdev_get_no_open+0x33/0xc0 block/bdev.c:758
       blkdev_get_by_dev+0x77/0xa60 block/bdev.c:815
       blkdev_open+0x119/0x2d0 block/fops.c:500
       do_dentry_open+0x7dd/0x10b0 fs/open.c:882
       do_open fs/namei.c:3677 [inline]
       path_openat+0x2674/0x2f10 fs/namei.c:3834
       do_filp_open+0x1ee/0x420 fs/namei.c:3861
       do_sys_openat2+0x14b/0x4f0 fs/open.c:1320
       do_sys_open fs/open.c:1336 [inline]
       __do_sys_openat fs/open.c:1352 [inline]
       __se_sys_openat fs/open.c:1347 [inline]
       __x64_sys_openat+0x135/0x160 fs/open.c:1347
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x4c/0xa0 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+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
       lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x12d/0xae0 kernel/locking/mutex.c:747
       blk_probe_dev block/genhd.c:753 [inline]
       blk_request_module+0x31/0x290 block/genhd.c:769
       blkdev_get_no_open+0x33/0xc0 block/bdev.c:758
       blkdev_get_by_dev+0x77/0xa60 block/bdev.c:815
       lock_rdev drivers/md/md.c:2561 [inline]
       md_import_device+0x379/0x800 drivers/md/md.c:3751
       md_add_new_disk+0x514/0x17b0 drivers/md/md.c:6969
       md_ioctl+0x24f5/0x2880 drivers/md/md.c:7806
       blkdev_ioctl+0x37b/0x740 block/ioctl.c:626
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:870 [inline]
       __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x4c/0xa0 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#74 --> &mddev->reconfig_mutex

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz.8.2485/12526:
 #0: ffff8880785e02d0
 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: mddev_lock drivers/md/md.h:577 [inline]
 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: md_ioctl+0xab2/0x2880 drivers/md/md.c:7681

stack backtrace:
CPU: 0 PID: 12526 Comm: syz.8.2485 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
 check_noncircular+0x2f8/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+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171
 lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x12d/0xae0 kernel/locking/mutex.c:747
 blk_probe_dev block/genhd.c:753 [inline]
 blk_request_module+0x31/0x290 block/genhd.c:769
 blkdev_get_no_open+0x33/0xc0 block/bdev.c:758
 blkdev_get_by_dev+0x77/0xa60 block/bdev.c:815
 lock_rdev drivers/md/md.c:2561 [inline]
 md_import_device+0x379/0x800 drivers/md/md.c:3751
 md_add_new_disk+0x514/0x17b0 drivers/md/md.c:6969
 md_ioctl+0x24f5/0x2880 drivers/md/md.c:7806
 blkdev_ioctl+0x37b/0x740 block/ioctl.c:626
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f35f779f559
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:00007f35f85e4028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f35f7a25fa0 RCX: 00007f35f779f559
RDX: 00002000000001c0 RSI: 0000000040140921 RDI: 0000000000000004
RBP: 00007f35f7836b20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f35f7a26038 R14: 00007f35f7a25fa0 R15: 00007fff068ffc68
 </TASK>
debugfs: creating file 'ram16'
device: 'ram16': device_add
kobject: 'ram16' (ffff8880540e2148): kobject_add_internal: parent: 'block', set: 'devices'
block ram16: No ACPI support
PM: Adding info for No Bus:ram16
kobject: 'ram16' (ffff8880540e2148): kobject_uevent_env
kobject: 'ram16' (ffff8880540e2148): kobject_uevent_env: uevent_suppress caused the event to drop!
kobject: 'holders' (ffff888020b64d80): kobject_add_internal: parent: 'ram16', set: '<NULL>'
kobject: 'slaves' (ffff888020b64400): kobject_add_internal: parent: 'ram16', set: '<NULL>'
kobject: 'queue' (ffff888027f99840): kobject_add_internal: parent: 'ram16', set: '<NULL>'
debugfs: creating file 'ram16'
kobject: 'queue' (ffff888027f99840): kobject_uevent_env
kobject: 'queue' (ffff888027f99840): kobject_uevent_env: filter function caused the event to drop!
device: '1:16': device_add
kobject: '1:16' (ffff88807a9b0000): kobject_add_internal: parent: 'bdi', set: 'devices'
bdi 1:16: No ACPI support
PM: Adding info for No Bus:1:16
kobject: '1:16' (ffff88807a9b0000): kobject_uevent_env
kobject: '1:16' (ffff88807a9b0000): fill_kobj_path: path = '/devices/virtual/bdi/1:16'
debugfs: creating file '1:16'
debugfs: creating file 'stats'
kobject: 'ram16' (ffff8880540e2148): kobject_uevent_env
kobject: 'ram16' (ffff8880540e2148): fill_kobj_path: path = '/devices/virtual/block/ram16'
block device autoloading is deprecated and will be removed.
md: bind<ram16>
kobject: 'dev-ram16' (ffff8880551fa878): kobject_add_internal: parent: 'md', set: '<NULL>'
kcov: kcov_task_exit: t = ffff888055525a00, kcov->t = ffff888055525a00

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/10/23 04:04 linux-6.1.y 79807e970724 b55fad29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in blk_request_module
2026/10/21 00:04 linux-6.1.y 79807e970724 df8746fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in blk_request_module
2026/10/20 23:13 linux-6.1.y 79807e970724 df8746fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in blk_request_module
2026/10/20 21:53 linux-6.1.y 79807e970724 df8746fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in blk_request_module
2026/10/20 21:51 linux-6.1.y 79807e970724 df8746fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in blk_request_module
2026/10/20 20:24 linux-6.1.y 79807e970724 df8746fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in blk_request_module
* Struck through repros no longer work on HEAD.