============================================ WARNING: possible recursive locking detected 6.1.0-rc8-next-20221207-syzkaller #0 Not tainted -------------------------------------------- syz-executor.0/5510 is trying to acquire lock: ffff888076a62480 (&ovl_i_mutex_key[depth]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] ffff888076a62480 (&ovl_i_mutex_key[depth]){+.+.}-{3:3}, at: ovl_remove_privs_unlocked fs/overlayfs/file.c:519 [inline] ffff888076a62480 (&ovl_i_mutex_key[depth]){+.+.}-{3:3}, at: ovl_fallocate+0x15c/0x270 fs/overlayfs/file.c:546 but task is already holding lock: ffff888076a62480 (&ovl_i_mutex_key[depth]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] ffff888076a62480 (&ovl_i_mutex_key[depth]){+.+.}-{3:3}, at: ovl_fallocate+0x9f/0x270 fs/overlayfs/file.c:535 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ovl_i_mutex_key[depth]); lock(&ovl_i_mutex_key[depth]); *** DEADLOCK *** May be due to missing lock nesting notation 2 locks held by syz-executor.0/5510: #0: ffff888029b28460 (sb_writers#18){.+.+}-{0:0}, at: ioctl_preallocate+0x18e/0x200 fs/ioctl.c:290 #1: ffff888076a62480 (&ovl_i_mutex_key[depth]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff888076a62480 (&ovl_i_mutex_key[depth]){+.+.}-{3:3}, at: ovl_fallocate+0x9f/0x270 fs/overlayfs/file.c:535 stack backtrace: CPU: 0 PID: 5510 Comm: syz-executor.0 Not tainted 6.1.0-rc8-next-20221207-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2990 [inline] check_deadlock kernel/locking/lockdep.c:3033 [inline] validate_chain kernel/locking/lockdep.c:3818 [inline] __lock_acquire.cold+0x116/0x3a7 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1e3/0x630 kernel/locking/lockdep.c:5633 down_write+0x94/0x220 kernel/locking/rwsem.c:1562 inode_lock include/linux/fs.h:756 [inline] ovl_remove_privs_unlocked fs/overlayfs/file.c:519 [inline] ovl_fallocate+0x15c/0x270 fs/overlayfs/file.c:546 vfs_fallocate+0x48b/0xe00 fs/open.c:323 ioctl_preallocate+0x18e/0x200 fs/ioctl.c:290 file_ioctl fs/ioctl.c:330 [inline] do_vfs_ioctl+0x1739/0x1ae0 fs/ioctl.c:849 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x10c/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb22ee8c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb22fc0c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fb22efabf80 RCX: 00007fb22ee8c0d9 RDX: 00000000200000c0 RSI: 0000000040305828 RDI: 0000000000000003 RBP: 00007fb22eee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc33e6e5ef R14: 00007fb22fc0c300 R15: 0000000000022000