====================================================== WARNING: possible circular locking dependency detected 5.15.0-rc2-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/18556 is trying to acquire lock: ffff88807c3ec230 (&mddev->open_mutex){+.+.}-{3:3}, at: md_open+0x227/0x320 drivers/md/md.c:7815 but task is already holding lock: ffff88801b7cf118 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0xf6/0xb90 block/bdev.c:816 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&disk->open_mutex){+.+.}-{3:3}: lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5625 __mutex_lock_common+0x1df/0x2550 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x1a/0x20 kernel/locking/mutex.c:743 bd_register_pending_holders+0x32/0x370 block/holder.c:160 device_add_disk+0x4df/0xe70 block/genhd.c:475 add_disk include/linux/genhd.h:221 [inline] md_alloc+0x829/0xc70 drivers/md/md.c:5707 blk_request_module+0x19d/0x1c0 block/genhd.c:637 blkdev_get_no_open+0x37/0x180 block/bdev.c:739 blkdev_get_by_dev+0x84/0xb90 block/bdev.c:803 swsusp_check+0x3e/0x210 kernel/power/swap.c:1525 software_resume+0xc8/0x3d0 kernel/power/hibernate.c:977 resume_store+0xdc/0x120 kernel/power/hibernate.c:1179 kernfs_fop_write_iter+0x3b6/0x510 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2163 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xb11/0xe90 fs/read_write.c:594 ksys_write+0x18f/0x2c0 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (&mddev->open_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain+0x1dfb/0x8240 kernel/locking/lockdep.c:3789 __lock_acquire+0x1382/0x2b00 kernel/locking/lockdep.c:5015 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5625 __mutex_lock_common+0x1df/0x2550 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_interruptible_nested+0x1a/0x20 kernel/locking/mutex.c:765 md_open+0x227/0x320 drivers/md/md.c:7815 blkdev_get_whole+0x95/0x3e0 block/bdev.c:668 blkdev_get_by_dev+0x28d/0xb90 block/bdev.c:823 swsusp_check+0x3e/0x210 kernel/power/swap.c:1525 software_resume+0xc8/0x3d0 kernel/power/hibernate.c:977 resume_store+0xdc/0x120 kernel/power/hibernate.c:1179 kernfs_fop_write_iter+0x3b6/0x510 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2163 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xb11/0xe90 fs/read_write.c:594 ksys_write+0x18f/0x2c0 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&disk->open_mutex); lock(&mddev->open_mutex); lock(&disk->open_mutex); lock(&mddev->open_mutex); *** DEADLOCK *** 6 locks held by syz-executor.4/18556: #0: ffff888025a39c70 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x24e/0x2f0 fs/file.c:990 #1: ffff88802621e460 (sb_writers#6){.+.+}-{0:0}, at: vfs_write+0x2b5/0xe90 fs/read_write.c:590 #2: ffff88801dda7488 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1f3/0x510 fs/kernfs/file.c:287 #3: ffff888144183830 (kn->active#453){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x217/0x510 fs/kernfs/file.c:288 #4: ffffffff8c7d4c48 (system_transition_mutex/1){+.+.}-{3:3}, at: software_resume+0x7a/0x3d0 kernel/power/hibernate.c:932 #5: ffff88801b7cf118 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_get_by_dev+0xf6/0xb90 block/bdev.c:816 stack backtrace: CPU: 1 PID: 18556 Comm: syz-executor.4 Not tainted 5.15.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2131 check_prev_add kernel/locking/lockdep.c:3051 [inline] check_prevs_add kernel/locking/lockdep.c:3174 [inline] validate_chain+0x1dfb/0x8240 kernel/locking/lockdep.c:3789 __lock_acquire+0x1382/0x2b00 kernel/locking/lockdep.c:5015 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5625 __mutex_lock_common+0x1df/0x2550 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_interruptible_nested+0x1a/0x20 kernel/locking/mutex.c:765 md_open+0x227/0x320 drivers/md/md.c:7815 blkdev_get_whole+0x95/0x3e0 block/bdev.c:668 blkdev_get_by_dev+0x28d/0xb90 block/bdev.c:823 swsusp_check+0x3e/0x210 kernel/power/swap.c:1525 software_resume+0xc8/0x3d0 kernel/power/hibernate.c:977 resume_store+0xdc/0x120 kernel/power/hibernate.c:1179 kernfs_fop_write_iter+0x3b6/0x510 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2163 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xb11/0xe90 fs/read_write.c:594 ksys_write+0x18f/0x2c0 fs/read_write.c:647 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fdcdfa58709 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdcdcfcf188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fdcdfb5cf60 RCX: 00007fdcdfa58709 RDX: 000000002000fdef RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00007fdcdfab2cb4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc2a44dfaf R14: 00007fdcdcfcf300 R15: 0000000000022000 PM: Image not found (code -5)