[v5.15] possible deadlock in blk_request_module (3)

0 views
Skip to first unread message

syzbot

unread,
Apr 3, 2026, 6:44:31 PM (2 days ago) Apr 3
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 91d48252ad4b Linux 5.15.202
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17cdfaba580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=7c586a17f61e61969704
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/74e75dfcb812/disk-91d48252.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/bfa72aab00f2/vmlinux-91d48252.xz
kernel image: https://storage.googleapis.com/syzbot-assets/47ea72d1c7dc/bzImage-91d48252.xz

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

======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.7.3349/20558 is trying to acquire lock:
ffffffff8c8fd988 (major_names_lock){+.+.}-{3:3}, at: blk_probe_dev block/genhd.c:682 [inline]
ffffffff8c8fd988 (major_names_lock){+.+.}-{3:3}, at: blk_request_module+0x31/0x290 block/genhd.c:698

but task is already holding lock:
ffffffff8c1d77c8 (system_transition_mutex/1){+.+.}-{3:3}, at: software_resume+0x7c/0x3b0 kernel/power/hibernate.c:937

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #8 (system_transition_mutex/1){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
software_resume+0x7c/0x3b0 kernel/power/hibernate.c:937
resume_store+0xe4/0x130 kernel/power/hibernate.c:1184
kernfs_fop_write_iter+0x379/0x4c0 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #7 (&of->mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
kernfs_seq_start+0x51/0x3c0 fs/kernfs/file.c:112
seq_read_iter+0x3c4/0xd50 fs/seq_file.c:225
call_read_iter include/linux/fs.h:2167 [inline]
new_sync_read fs/read_write.c:404 [inline]
vfs_read+0x759/0xd60 fs/read_write.c:485
ksys_read+0x152/0x260 fs/read_write.c:623
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #6 (&p->lock){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
seq_read_iter+0xad/0xd50 fs/seq_file.c:182
do_iter_readv_writev+0x47e/0x5f0 fs/read_write.c:-1
do_iter_read+0x20b/0x7c0 fs/read_write.c:790
lo_read_simple drivers/block/loop.c:392 [inline]
do_req_filebacked drivers/block/loop.c:663 [inline]
loop_handle_cmd drivers/block/loop.c:2235 [inline]
loop_process_work+0x16dd/0x24a0 drivers/block/loop.c:2275
process_one_work+0x85f/0x1010 kernel/workqueue.c:2310
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #5 ((work_completion)(&worker->work)){+.+.}-{0:0}:
process_one_work+0x7bb/0x1010 kernel/workqueue.c:2286
worker_thread+0xaa6/0x1290 kernel/workqueue.c:2457
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #4 ((wq_completion)loop0){+.+.}-{0:0}:
flush_workqueue+0x16c/0x13d0 kernel/workqueue.c:2830
drain_workqueue+0xcf/0x380 kernel/workqueue.c:2995
destroy_workqueue+0x7b/0xb20 kernel/workqueue.c:4439
__loop_clr_fd+0x234/0xb90 drivers/block/loop.c:1384
blkdev_put_whole block/bdev.c:692 [inline]
blkdev_put+0x53f/0x7d0 block/bdev.c:957
deactivate_locked_super+0x93/0xf0 fs/super.c:335
cleanup_mnt+0x42d/0x4e0 fs/namespace.c:1148
task_work_run+0x125/0x1a0 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
__syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #3 (&lo->lo_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_killable_nested+0x17/0x20 kernel/locking/mutex.c:758
lo_open+0x6a/0x100 drivers/block/loop.c:2056
blkdev_get_whole+0x90/0x390 block/bdev.c:669
blkdev_get_by_dev+0x2d0/0xa60 block/bdev.c:827
blkdev_open+0x12d/0x2c0 block/fops.c:466
do_dentry_open+0x7ff/0xf80 fs/open.c:826
do_open fs/namei.c:3616 [inline]
path_openat+0x26f5/0x2fa0 fs/namei.c:3750
do_filp_open+0x1e2/0x410 fs/namei.c:3777
do_sys_openat2+0x150/0x4b0 fs/open.c:1255
do_sys_open fs/open.c:1271 [inline]
__do_sys_openat fs/open.c:1287 [inline]
__se_sys_openat fs/open.c:1282 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1282
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (&disk->open_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
bd_register_pending_holders+0x33/0x310 block/holder.c:161
device_add_disk+0x5a7/0xd40 block/genhd.c:486
add_disk include/linux/genhd.h:200 [inline]
md_alloc+0x809/0xc00 drivers/md/md.c:5782
blk_probe_dev block/genhd.c:685 [inline]
blk_request_module+0x26e/0x290 block/genhd.c:-1
blkdev_get_no_open+0x38/0x1d0 block/bdev.c:740
blkdev_get_by_dev+0x77/0xa60 block/bdev.c:807
blkdev_open+0x12d/0x2c0 block/fops.c:466
do_dentry_open+0x7ff/0xf80 fs/open.c:826
do_open fs/namei.c:3616 [inline]
path_openat+0x26f5/0x2fa0 fs/namei.c:3750
do_filp_open+0x1e2/0x410 fs/namei.c:3777
do_sys_openat2+0x150/0x4b0 fs/open.c:1255
do_sys_open fs/open.c:1271 [inline]
__do_sys_openat fs/open.c:1287 [inline]
__se_sys_openat fs/open.c:1282 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1282
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #1 (disks_mutex){+.+.}-{3:3}:
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
md_alloc+0x48/0xc00 drivers/md/md.c:5723
blk_probe_dev block/genhd.c:685 [inline]
blk_request_module+0x26e/0x290 block/genhd.c:-1
blkdev_get_no_open+0x38/0x1d0 block/bdev.c:740
blkdev_get_by_dev+0x77/0xa60 block/bdev.c:807
blkdev_open+0x12d/0x2c0 block/fops.c:466
do_dentry_open+0x7ff/0xf80 fs/open.c:826
do_open fs/namei.c:3616 [inline]
path_openat+0x26f5/0x2fa0 fs/namei.c:3750
do_filp_open+0x1e2/0x410 fs/namei.c:3777
do_sys_openat2+0x150/0x4b0 fs/open.c:1255
do_sys_open fs/open.c:1271 [inline]
__do_sys_openat fs/open.c:1287 [inline]
__se_sys_openat fs/open.c:1282 [inline]
__x64_sys_openat+0x135/0x160 fs/open.c:1282
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (major_names_lock){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
blk_probe_dev block/genhd.c:682 [inline]
blk_request_module+0x31/0x290 block/genhd.c:698
blkdev_get_no_open+0x38/0x1d0 block/bdev.c:740
blkdev_get_by_dev+0x77/0xa60 block/bdev.c:807
swsusp_check+0xa1/0x2b0 kernel/power/swap.c:1526
software_resume+0xc6/0x3b0 kernel/power/hibernate.c:982
resume_store+0xe4/0x130 kernel/power/hibernate.c:1184
kernfs_fop_write_iter+0x379/0x4c0 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
major_names_lock --> &of->mutex --> system_transition_mutex/1

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
lock(system_transition_mutex/1);
lock(&of->mutex);
lock(system_transition_mutex/1);
lock(major_names_lock);

*** DEADLOCK ***

5 locks held by syz.7.3349/20558:
#0: ffff888064642ff0 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2bf/0x370 fs/file.c:1056
#1: ffff88807f6fe460 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x295/0xd60 fs/read_write.c:590
#2: ffff8880600cf088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1e5/0x4c0 fs/kernfs/file.c:287
#3: ffff888144bfd830 (kn->active#861){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x208/0x4c0 fs/kernfs/file.c:288
#4: ffffffff8c1d77c8 (system_transition_mutex/1){+.+.}-{3:3}, at: software_resume+0x7c/0x3b0 kernel/power/hibernate.c:937

stack backtrace:
CPU: 1 PID: 20558 Comm: syz.7.3349 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
check_prev_add kernel/locking/lockdep.c:3053 [inline]
check_prevs_add kernel/locking/lockdep.c:3172 [inline]
validate_chain kernel/locking/lockdep.c:3788 [inline]
__lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__mutex_lock_common+0x1e3/0x2400 kernel/locking/mutex.c:596
__mutex_lock kernel/locking/mutex.c:729 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
blk_probe_dev block/genhd.c:682 [inline]
blk_request_module+0x31/0x290 block/genhd.c:698
blkdev_get_no_open+0x38/0x1d0 block/bdev.c:740
blkdev_get_by_dev+0x77/0xa60 block/bdev.c:807
swsusp_check+0xa1/0x2b0 kernel/power/swap.c:1526
software_resume+0xc6/0x3b0 kernel/power/hibernate.c:982
resume_store+0xe4/0x130 kernel/power/hibernate.c:1184
kernfs_fop_write_iter+0x379/0x4c0 fs/kernfs/file.c:296
call_write_iter include/linux/fs.h:2173 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x745/0xd60 fs/read_write.c:594
ksys_write+0x152/0x260 fs/read_write.c:647
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f7943e91819
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:00007f79420a9028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f794410b180 RCX: 00007f7943e91819
RDX: 0000000000000012 RSI: 0000200000000040 RDI: 0000000000000007
RBP: 00007f7943f27c91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f794410b218 R14: 00007f794410b180 R15: 00007ffd90814258
</TASK>
block device autoloading is deprecated and will be removed.
PM: Image not found (code -22)


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