====================================================== WARNING: possible circular locking dependency detected 5.18.0-rc1-next-20220408-syzkaller #0 Not tainted ------------------------------------------------------ kworker/0:4/25401 is trying to acquire lock: ffff8880277540e0 (&type->s_umount_key#59){++++}-{3:3}, at: deactivate_super+0xa5/0xd0 fs/super.c:362 but task is already holding lock: ffffc90006d57da8 ((delayed_mntput_work).work){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((delayed_mntput_work).work){+.+.}-{0:0}: process_one_work+0x905/0x1610 kernel/workqueue.c:2265 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 -> #2 ((wq_completion)events){+.+.}-{0:0}: flush_workqueue+0x164/0x1440 kernel/workqueue.c:2831 flush_scheduled_work include/linux/workqueue.h:583 [inline] ext4_put_super+0x99/0x1150 fs/ext4/super.c:1202 generic_shutdown_super+0x14c/0x400 fs/super.c:462 kill_block_super+0x97/0xf0 fs/super.c:1394 deactivate_locked_super+0x94/0x160 fs/super.c:332 deactivate_super+0xad/0xd0 fs/super.c:363 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1186 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #1 (&type->s_umount_key#32){++++}-{3:3}: down_read+0x98/0x440 kernel/locking/rwsem.c:1489 ovl_sync_fs+0xff/0x170 fs/overlayfs/super.c:294 sync_filesystem.part.0+0x13c/0x1d0 fs/sync.c:66 sync_filesystem+0x8b/0xc0 fs/sync.c:43 generic_shutdown_super+0x70/0x400 fs/super.c:445 kill_anon_super+0x36/0x60 fs/super.c:1056 deactivate_locked_super+0x94/0x160 fs/super.c:332 deactivate_super+0xad/0xd0 fs/super.c:363 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1186 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (&type->s_umount_key#59){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 down_write+0x90/0x150 kernel/locking/rwsem.c:1542 deactivate_super+0xa5/0xd0 fs/super.c:362 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1186 delayed_mntput+0x62/0x80 fs/namespace.c:1203 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 other info that might help us debug this: Chain exists of: &type->s_umount_key#59 --> (wq_completion)events --> (delayed_mntput_work).work Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((delayed_mntput_work).work); lock((wq_completion)events); lock((delayed_mntput_work).work); lock(&type->s_umount_key#59); *** DEADLOCK *** 2 locks held by kworker/0:4/25401: #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline] #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline] #0: ffff888010c64d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260 #1: ffffc90006d57da8 ((delayed_mntput_work).work){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264 stack backtrace: CPU: 0 PID: 25401 Comm: kworker/0:4 Not tainted 5.18.0-rc1-next-20220408-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events delayed_mntput Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 down_write+0x90/0x150 kernel/locking/rwsem.c:1542 deactivate_super+0xa5/0xd0 fs/super.c:362 cleanup_mnt+0x3a2/0x540 fs/namespace.c:1186 delayed_mntput+0x62/0x80 fs/namespace.c:1203 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298