[ OK ] Started OpenBSD Secure Shell server. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ OK ] Started Update UTMP about System Runlevel Changes. Debian GNU/Linux 9 syzkaller ttyS0 Warning: Permanently added '10.128.0.34' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 28.479695] [ 28.481462] ====================================================== [ 28.487748] WARNING: possible circular locking dependency detected [ 28.494036] 4.14.297-syzkaller #0 Not tainted [ 28.498497] ------------------------------------------------------ [ 28.504789] syz-executor240/7964 is trying to acquire lock: [ 28.510465] (&bdev->bd_mutex){+.+.}, at: [] blkdev_reread_part+0x1b/0x40 [ 28.518955] [ 28.518955] but task is already holding lock: [ 28.524904] (&nbd->config_lock){+.+.}, at: [] nbd_ioctl+0x11f/0xad0 [ 28.532949] [ 28.532949] which lock already depends on the new lock. [ 28.532949] [ 28.541242] [ 28.541242] the existing dependency chain (in reverse order) is: [ 28.549018] [ 28.549018] -> #2 (&nbd->config_lock){+.+.}: [ 28.554887] __mutex_lock+0xc4/0x1310 [ 28.559182] nbd_open+0x1ac/0x370 [ 28.563126] __blkdev_get+0x306/0x1090 [ 28.567503] blkdev_get+0x88/0x890 [ 28.571532] blkdev_open+0x1cc/0x250 [ 28.575734] do_dentry_open+0x44b/0xec0 [ 28.580196] vfs_open+0x105/0x220 [ 28.584141] path_openat+0x628/0x2970 [ 28.588518] do_filp_open+0x179/0x3c0 [ 28.592819] do_sys_open+0x296/0x410 [ 28.597200] do_syscall_64+0x1d5/0x640 [ 28.601588] entry_SYSCALL_64_after_hwframe+0x5e/0xd3 [ 28.607272] [ 28.607272] -> #1 (nbd_index_mutex){+.+.}: [ 28.612984] __mutex_lock+0xc4/0x1310 [ 28.617280] nbd_open+0x1e/0x370 [ 28.621146] __blkdev_get+0x306/0x1090 [ 28.625530] blkdev_get+0x88/0x890 [ 28.629558] blkdev_open+0x1cc/0x250 [ 28.633772] do_dentry_open+0x44b/0xec0 [ 28.638255] vfs_open+0x105/0x220 [ 28.642204] path_openat+0x628/0x2970 [ 28.646498] do_filp_open+0x179/0x3c0 [ 28.650882] do_sys_open+0x296/0x410 [ 28.655089] do_syscall_64+0x1d5/0x640 [ 28.659521] entry_SYSCALL_64_after_hwframe+0x5e/0xd3 [ 28.665209] [ 28.665209] -> #0 (&bdev->bd_mutex){+.+.}: [ 28.670904] lock_acquire+0x170/0x3f0 [ 28.675207] __mutex_lock+0xc4/0x1310 [ 28.679507] blkdev_reread_part+0x1b/0x40 [ 28.684144] nbd_ioctl+0x802/0xad0 [ 28.688170] blkdev_ioctl+0x540/0x1830 [ 28.692546] block_ioctl+0xd9/0x120 [ 28.696667] do_vfs_ioctl+0x75a/0xff0 [ 28.700954] SyS_ioctl+0x7f/0xb0 [ 28.704808] do_syscall_64+0x1d5/0x640 [ 28.709198] entry_SYSCALL_64_after_hwframe+0x5e/0xd3 [ 28.715233] [ 28.715233] other info that might help us debug this: [ 28.715233] [ 28.723601] Chain exists of: [ 28.723601] &bdev->bd_mutex --> nbd_index_mutex --> &nbd->config_lock [ 28.723601] [ 28.734684] Possible unsafe locking scenario: [ 28.734684] [ 28.741245] CPU0 CPU1 [ 28.745883] ---- ---- [ 28.750518] lock(&nbd->config_lock); [ 28.754395] lock(nbd_index_mutex); [ 28.760594] lock(&nbd->config_lock); [ 28.766980] lock(&bdev->bd_mutex); [ 28.770793] [ 28.770793] *** DEADLOCK *** [ 28.770793] [ 28.776922] 1 lock held by syz-executor240/7964: [ 28.781642] #0: (&nbd->config_lock){+.+.}, at: [] nbd_ioctl+0x11f/0xad0 [ 28.790115] [ 28.790115] stack backtrace: [ 28.794676] CPU: 1 PID: 7964 Comm: syz-executor240 Not tainted 4.14.297-syzkaller #0 [ 28.802523] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 [ 28.812108] Call Trace: [ 28.814666] dump_stack+0x1b2/0x281 [ 28.818268] print_circular_bug.constprop.0.cold+0x2d7/0x41e [ 28.824143] __lock_acquire+0x2e0e/0x3f20 [ 28.828258] ? trace_hardirqs_on+0x10/0x10 [ 28.832460] ? entry_SYSCALL_64_after_hwframe+0x5e/0xd3 [ 28.837792] ? add_lock_to_list.constprop.0+0x17d/0x330 [ 28.843126] ? save_trace+0xd6/0x290 [ 28.846810] lock_acquire+0x170/0x3f0 [ 28.850600] ? blkdev_reread_part+0x1b/0x40 [ 28.855586] ? blkdev_reread_part+0x1b/0x40 [ 28.859892] __mutex_lock+0xc4/0x1310 [ 28.863666] ? blkdev_reread_part+0x1b/0x40 [ 28.868045] ? __get_super.part.0+0xbb/0x390 [ 28.872422] ? blkdev_reread_part+0x1b/0x40 [ 28.876714] ? __ww_mutex_wakeup_for_backoff+0x210/0x210 [ 28.882131] ? lock_downgrade+0x740/0x740 [ 28.886247] ? nbd_ioctl+0x7e7/0xad0 [ 28.889935] ? lock_downgrade+0x740/0x740 [ 28.894055] blkdev_reread_part+0x1b/0x40 [ 28.898176] nbd_ioctl+0x802/0xad0 [ 28.901698] ? kasan_slab_free+0xc3/0x1a0 [ 28.905828] ? nbd_disconnect_and_put+0x140/0x140 [ 28.910639] ? do_syscall_64+0x1d5/0x640 [ 28.914733] ? entry_SYSCALL_64_after_hwframe+0x5e/0xd3 [ 28.920081] ? path_lookupat+0x780/0x780 [ 28.924110] ? debug_check_no_obj_freed+0x2c0/0x680 [ 28.929092] ? nbd_disconnect_and_put+0x140/0x140 [ 28.933913] blkdev_ioctl+0x540/0x1830 [ 28.937769] ? blkpg_ioctl+0x8d0/0x8d0 [ 28.941624] ? _raw_spin_unlock_irqrestore+0x66/0xe0 [ 28.946712] ? debug_check_no_obj_freed+0x2c0/0x680 [ 28.951696] block_ioctl+0xd9/0x120 [ 28.955298] ? blkdev_fallocate+0x3a0/0x3a0 [ 28.959591] do_vfs_ioctl+0x75a/0xff0 [ 28.963359] ? rcu_lockdep_current_cpu_online+0xed/0x140 [ 28.969129] ? ioctl_preallocate+0x1a0/0x1a0 [ 28.973685] ? kmem_cache_free+0x23a/0x2b0 [ 28.977899] ? putname+0xcd/0x110 [ 28.