============================================ WARNING: possible recursive locking detected 5.10.0-rc1-syzkaller #0 Not tainted -------------------------------------------- syz-executor.3/10150 is trying to acquire lock: ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline] ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: ovl_dir_real_file+0xd3/0x140 fs/overlayfs/readdir.c:886 but task is already holding lock: ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline] ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: ovl_ioctl_set_flags fs/overlayfs/file.c:577 [inline] ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: ovl_ioctl+0x82/0x160 fs/overlayfs/file.c:616 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ovl_i_mutex_dir_key[depth]); lock(&ovl_i_mutex_dir_key[depth]); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by syz-executor.3/10150: #0: ffff88811eeb5460 (sb_writers#15){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1648 [inline] #0: ffff88811eeb5460 (sb_writers#15){.+.+}-{0:0}, at: mnt_want_write_file+0x1f/0x60 fs/namespace.c:412 #1: ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: inode_lock include/linux/fs.h:774 [inline] #1: ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: ovl_ioctl_set_flags fs/overlayfs/file.c:577 [inline] #1: ffff888114d69e20 (&ovl_i_mutex_dir_key[depth]){++++}-{3:3}, at: ovl_ioctl+0x82/0x160 fs/overlayfs/file.c:616 stack backtrace: CPU: 1 PID: 10150 Comm: syz-executor.3 Not tainted 5.10.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x77/0x97 lib/dump_stack.c:118 print_deadlock_bug kernel/locking/lockdep.c:2759 [inline] check_deadlock kernel/locking/lockdep.c:2800 [inline] validate_chain kernel/locking/lockdep.c:3591 [inline] __lock_acquire.cold.60+0x17a/0x2e8 kernel/locking/lockdep.c:4837 lock_acquire+0xd0/0x420 kernel/locking/lockdep.c:5442 down_write+0x33/0x70 kernel/locking/rwsem.c:1531 inode_lock include/linux/fs.h:774 [inline] ovl_dir_real_file+0xd3/0x140 fs/overlayfs/readdir.c:886 ovl_real_fdget+0x32/0x70 fs/overlayfs/file.c:141 ovl_real_ioctl+0x25/0x90 fs/overlayfs/file.c:546 ovl_ioctl_set_flags fs/overlayfs/file.c:592 [inline] ovl_ioctl+0xc9/0x160 fs/overlayfs/file.c:616 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x7c/0xb0 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e219 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fce60297c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045e219 RDX: 0000000000000000 RSI: 0000000040086602 RDI: 0000000000000003 RBP: 000000000119bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007ffc8c9eb7cf R14: 00007fce602989c0 R15: 000000000119bf8c