[v6.6] possible deadlock in blk_request_module

7 views
Skip to first unread message

syzbot

unread,
Sep 5, 2026, 3:50:24 AMSep 5
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8b73de7da85f Linux 6.6.156
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16747215580000
kernel config: https://syzkaller.appspot.com/x/.config?x=7be9809cedd6b69c
dashboard link: https://syzkaller.appspot.com/bug?extid=086639defea9c90fec13
compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/d7e87682fef0/disk-8b73de7d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/096830afc063/vmlinux-8b73de7d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/89c175e4560d/bzImage-8b73de7d.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+086639...@syzkaller.appspotmail.com

======================================================
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)


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages