============================================ WARNING: possible recursive locking detected 5.14.0-rc4-syzkaller #0 Not tainted -------------------------------------------- systemd-udevd/18631 is trying to acquire lock: ffff888013d35118 (&disk->open_mutex){+.+.}-{3:3}, at: del_gendisk+0x8b/0x770 block/genhd.c:587 but task is already holding lock: ffff888013d35118 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xa0/0xae0 fs/block_dev.c:1534 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&disk->open_mutex); lock(&disk->open_mutex); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by systemd-udevd/18631: #0: ffff888013d35118 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xa0/0xae0 fs/block_dev.c:1534 #1: ffffffff8c4896a8 (nbd_index_mutex){+.+.}-{3:3}, at: refcount_dec_and_mutex_lock lib/refcount.c:118 [inline] #1: ffffffff8c4896a8 (nbd_index_mutex){+.+.}-{3:3}, at: refcount_dec_and_mutex_lock+0x50/0x140 lib/refcount.c:113 stack backtrace: CPU: 3 PID: 18631 Comm: systemd-udevd Not tainted 5.14.0-rc4-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_deadlock_bug kernel/locking/lockdep.c:2944 [inline] check_deadlock kernel/locking/lockdep.c:2987 [inline] validate_chain kernel/locking/lockdep.c:3776 [inline] __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5015 lock_acquire kernel/locking/lockdep.c:5625 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 __mutex_lock_common kernel/locking/mutex.c:959 [inline] __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104 del_gendisk+0x8b/0x770 block/genhd.c:587 nbd_dev_remove drivers/block/nbd.c:241 [inline] nbd_put.part.0+0x82/0x160 drivers/block/nbd.c:263 nbd_put drivers/block/nbd.c:1527 [inline] nbd_release+0x14d/0x1a0 drivers/block/nbd.c:1526 blkdev_put_whole fs/block_dev.c:1279 [inline] blkdev_put+0x34f/0xae0 fs/block_dev.c:1576 blkdev_close+0x8c/0xb0 fs/block_dev.c:1586 __fput+0x288/0x920 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:209 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f5e2b96c270 Code: 73 01 c3 48 8b 0d 38 7d 20 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 59 c1 20 00 00 75 10 b8 03 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 ee fb ff ff 48 89 04 24 RSP: 002b:00007ffd980d07f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000007 RCX: 00007f5e2b96c270 RDX: 000000000aba9500 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007f5e2c826710 R08: 000000000000004a R09: 0000000000000008 R10: 00005620a9a377f8 R11: 0000000000000246 R12: 0000000000000000 R13: 00005620a9a3a920 R14: 0000000000000003 R15: 000000000000000e