Warning: Permanently added '10.128.10.6' (ECDSA) to the list of known hosts. executing program syzkaller login: [ 81.601935][ T8443] [ 81.604455][ T8443] ====================================================== [ 81.611459][ T8443] WARNING: possible circular locking dependency detected [ 81.618487][ T8443] 5.12.0-rc6-next-20210409-syzkaller #0 Not tainted [ 81.625070][ T8443] ------------------------------------------------------ [ 81.632093][ T8443] syz-executor305/8443 is trying to acquire lock: [ 81.638495][ T8443] ffff8880172d2ea0 (&bdev->bd_mutex){+.+.}-{3:3}, at: del_gendisk+0x250/0x9e0 [ 81.647680][ T8443] [ 81.647680][ T8443] but task is already holding lock: [ 81.655223][ T8443] ffffffff8c7d9430 (bdev_lookup_sem){++++}-{3:3}, at: del_gendisk+0x222/0x9e0 [ 81.664109][ T8443] [ 81.664109][ T8443] which lock already depends on the new lock. [ 81.664109][ T8443] [ 81.674507][ T8443] [ 81.674507][ T8443] the existing dependency chain (in reverse order) is: [ 81.683540][ T8443] [ 81.683540][ T8443] -> #2 (bdev_lookup_sem){++++}-{3:3}: [ 81.691175][ T8443] down_write+0x92/0x150 [ 81.695989][ T8443] del_gendisk+0x222/0x9e0 [ 81.700929][ T8443] loop_control_ioctl+0x40d/0x4f0 [ 81.706496][ T8443] __x64_sys_ioctl+0x193/0x200 [ 81.711808][ T8443] do_syscall_64+0x2d/0x70 [ 81.716753][ T8443] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 81.723155][ T8443] [ 81.723155][ T8443] -> #1 (loop_ctl_mutex){+.+.}-{3:3}: [ 81.730786][ T8443] __mutex_lock+0x139/0x1120 [ 81.735896][ T8443] lo_open+0x1a/0x130 [ 81.740391][ T8443] __blkdev_get+0x135/0xa30 [ 81.745418][ T8443] blkdev_get_by_dev+0x26c/0x600 [ 81.750865][ T8443] blkdev_open+0x154/0x2b0 [ 81.755791][ T8443] do_dentry_open+0x4b9/0x11b0 [ 81.761088][ T8443] path_openat+0x1c09/0x27d0 [ 81.766191][ T8443] do_filp_open+0x190/0x3d0 [ 81.771205][ T8443] do_sys_openat2+0x16d/0x420 [ 81.776426][ T8443] __x64_sys_open+0x119/0x1c0 [ 81.781621][ T8443] do_syscall_64+0x2d/0x70 [ 81.786584][ T8443] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 81.793011][ T8443] [ 81.793011][ T8443] -> #0 (&bdev->bd_mutex){+.+.}-{3:3}: [ 81.800642][ T8443] __lock_acquire+0x2a17/0x5230 [ 81.806043][ T8443] lock_acquire+0x1ab/0x740 [ 81.811058][ T8443] __mutex_lock+0x139/0x1120 [ 81.816163][ T8443] del_gendisk+0x250/0x9e0 [ 81.821103][ T8443] loop_control_ioctl+0x40d/0x4f0 [ 81.826651][ T8443] __x64_sys_ioctl+0x193/0x200 [ 81.831934][ T8443] do_syscall_64+0x2d/0x70 [ 81.836872][ T8443] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 81.843299][ T8443] [ 81.843299][ T8443] other info that might help us debug this: [ 81.843299][ T8443] [ 81.853517][ T8443] Chain exists of: [ 81.853517][ T8443] &bdev->bd_mutex --> loop_ctl_mutex --> bdev_lookup_sem [ 81.853517][ T8443] [ 81.866465][ T8443] Possible unsafe locking scenario: [ 81.866465][ T8443] [ 81.873909][ T8443] CPU0 CPU1 [ 81.879265][ T8443] ---- ---- [ 81.884649][ T8443] lock(bdev_lookup_sem); [ 81.889055][ T8443] lock(loop_ctl_mutex); [ 81.896008][ T8443] lock(bdev_lookup_sem); [ 81.902943][ T8443] lock(&bdev->bd_mutex); [ 81.907353][ T8443] [ 81.907353][ T8443] *** DEADLOCK *** [ 81.907353][ T8443] [ 81.915480][ T8443] 2 locks held by syz-executor305/8443: [ 81.921030][ T8443] #0: ffffffff8ca5f148 (loop_ctl_mutex){+.+.}-{3:3}, at: loop_control_ioctl+0x7b/0x4f0 [ 81.930787][ T8443] #1: ffffffff8c7d9430 (bdev_lookup_sem){++++}-{3:3}, at: del_gendisk+0x222/0x9e0 [ 81.940108][ T8443] [ 81.940108][ T8443] stack backtrace: [ 81.946008][ T8443] CPU: 0 PID: 8443 Comm: syz-executor305 Not tainted 5.12.0-rc6-next-20210409-syzkaller #0 [ 81.956065][ T8443] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 81.966158][ T8443] Call Trace: [ 81.969452][ T8443] dump_stack+0x141/0x1d7 [ 81.973803][ T8443] check_noncircular+0x25f/0x2e0 [ 81.978842][ T8443] ? kernel_text_address+0xbd/0xf0 [ 81.983966][ T8443] ? print_circular_bug+0x1e0/0x1e0 [ 81.989163][ T8443] ? create_prof_cpu_mask+0x20/0x20 [ 81.994815][ T8443] ? arch_stack_walk+0x93/0xe0 [ 81.999599][ T8443] ? lockdep_lock+0xc6/0x200 [ 82.004245][ T8443] ? call_rcu_zapped+0xb0/0xb0 [ 82.009138][ T8443] __lock_acquire+0x2a17/0x5230 [ 82.014043][ T8443] ? lockdep_hardirqs_on_prepare+0x400/0x400 [ 82.020023][ T8443] lock_acquire+0x1ab/0x740 [ 82.024543][ T8443] ? del_gendisk+0x250/0x9e0 [ 82.029130][ T8443] ? lock_release+0x720/0x720 [ 82.033831][ T8443] ? lockdep_hardirqs_on_prepare+0x400/0x400 [ 82.040173][ T8443] __mutex_lock+0x139/0x1120 [ 82.044776][ T8443] ? del_gendisk+0x250/0x9e0 [ 82.049358][ T8443] ? del_gendisk+0x250/0x9e0 [ 82.053938][ T8443] ? mutex_lock_io_nested+0xf70/0xf70 [ 82.059923][ T8443] ? down_write+0xe0/0x150 [ 82.064362][ T8443] ? down_write_killable+0x170/0x170 [ 82.069679][ T8443] ? sysfs_remove_files+0x87/0xf0 [ 82.074708][ T8443] del_gendisk+0x250/0x9e0 [ 82.079119][ T8443] loop_control_ioctl+0x40d/0x4f0 [ 82.084145][ T8443] ? loop_lookup+0x1d0/0x1d0 [ 82.088746][ T8443] ? __sanitizer_cov_trace_const_cmp4+0x1c/0x70 [ 82.095001][ T8443] ? loop_lookup+0x1d0/0x1d0 [ 82.099603][ T8443] __x64_sys_ioctl+0x193/0x200 [ 82.104377][ T8443] do_syscall_64+0x2d/0x70 [ 82.108789][ T8443] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 82.114685][ T8443] RIP: 0033:0x43ee49 [ 82.118592][ T8443] Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48 [ 82.138644][ T8443] RSP: 002b:00007ffec3a31668 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 82.147094][ T8443] RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043ee49 [ 82.155083][ T8443] RDX: 0000000000000000 RSI: 0000000000004c81 RDI: 0000000000000003 [ 82.163085][ T8443] RBP: 0000000000402e30 R08: 0000000000000000 R09: 0000000000400488 [ 82.171067][ T8443] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000402ec0 [ 82.179031][ T8443] R13: 0000000000000000 R14: 00000000004ac018 R15: 0000000000400488