overlayfs: upper fs needs to support d_type. overlayfs: upper fs does not support tmpfile. overlayfs: upper fs does not support RENAME_WHITEOUT. ====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.3.59/4604 is trying to acquire lock: ffff0000f690aaa0 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff0000f690aaa0 (&sb->s_type->i_mutex_key#20){+.+.}-{3:3}, at: vfs_rename+0x6cc/0xe3c fs/namei.c:4851 but task is already holding lock: ffff0000e17bcbc0 (&type->i_mutex_dir_key#10/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] ffff0000e17bcbc0 (&type->i_mutex_dir_key#10/2){+.+.}-{3:3}, at: vfs_rename+0x668/0xe3c fs/namei.c:4850 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&type->i_mutex_dir_key#10/2){+.+.}-{3:3}: down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] xattr_rmdir fs/reiserfs/xattr.c:106 [inline] delete_one_xattr+0xe8/0x2c8 fs/reiserfs/xattr.c:338 reiserfs_for_each_xattr+0x5d0/0x6f8 fs/reiserfs/xattr.c:311 reiserfs_delete_xattrs+0x2c/0xa4 fs/reiserfs/xattr.c:364 reiserfs_evict_inode+0x1f0/0x408 fs/reiserfs/inode.c:53 evict+0x3d8/0x824 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x728/0x7e8 fs/inode.c:1860 d_delete_notify include/linux/fsnotify.h:267 [inline] vfs_rmdir+0x32c/0x438 fs/namei.c:4212 do_rmdir+0x244/0x524 fs/namei.c:4260 __do_sys_unlinkat fs/namei.c:4440 [inline] __se_sys_unlinkat fs/namei.c:4434 [inline] __arm64_sys_unlinkat+0xcc/0xfc fs/namei.c:4434 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #1 (&type->i_mutex_dir_key#10/3){+.+.}-{3:3}: down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] open_xa_root fs/reiserfs/xattr.c:127 [inline] open_xa_dir+0x124/0x5ec fs/reiserfs/xattr.c:152 xattr_lookup+0x3c/0x268 fs/reiserfs/xattr.c:395 reiserfs_xattr_set_handle+0xe8/0xdbc fs/reiserfs/xattr.c:533 reiserfs_xattr_set+0x3a8/0x4d4 fs/reiserfs/xattr.c:633 trusted_set+0x98/0xe8 fs/reiserfs/xattr_trusted.c:31 __vfs_setxattr+0x374/0x390 fs/xattr.c:182 __vfs_setxattr_noperm+0x120/0x56c fs/xattr.c:216 __vfs_setxattr_locked+0x1e8/0x214 fs/xattr.c:277 vfs_setxattr+0x158/0x2a8 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x258/0x2d8 fs/xattr.c:617 path_setxattr+0x130/0x260 fs/xattr.c:636 __do_sys_setxattr fs/xattr.c:652 [inline] __se_sys_setxattr fs/xattr.c:648 [inline] __arm64_sys_setxattr+0xc4/0xe0 fs/xattr.c:648 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&sb->s_type->i_mutex_key#20){+.+.}-{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:3830 [inline] __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] vfs_rename+0x6cc/0xe3c fs/namei.c:4851 ovl_do_rename fs/overlayfs/overlayfs.h:297 [inline] ovl_cleanup_and_whiteout+0x3c8/0x614 fs/overlayfs/dir.c:125 ovl_remove_and_whiteout fs/overlayfs/dir.c:796 [inline] ovl_do_remove+0x690/0x930 fs/overlayfs/dir.c:923 ovl_rmdir+0x24/0x34 fs/overlayfs/dir.c:956 vfs_rmdir+0x304/0x438 fs/namei.c:4199 do_rmdir+0x244/0x524 fs/namei.c:4260 __do_sys_unlinkat fs/namei.c:4440 [inline] __se_sys_unlinkat fs/namei.c:4434 [inline] __arm64_sys_unlinkat+0xcc/0xfc fs/namei.c:4434 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#20 --> &type->i_mutex_dir_key#10/3 --> &type->i_mutex_dir_key#10/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#10/2); lock(&type->i_mutex_dir_key#10/3); lock(&type->i_mutex_dir_key#10/2); lock(&sb->s_type->i_mutex_key#20); *** DEADLOCK *** 9 locks held by syz.3.59/4604: #0: ffff0000d331c460 (sb_writers#17){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402 #1: ffff0000f8cc8d20 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff0000f8cc8d20 (&ovl_i_mutex_dir_key[depth]/1){+.+.}-{3:3}, at: do_rmdir+0x180/0x524 fs/namei.c:4247 #2: ffff0000f8cc92f8 (&ovl_i_mutex_dir_key[depth]#2){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff0000f8cc92f8 (&ovl_i_mutex_dir_key[depth]#2){+.+.}-{3:3}, at: vfs_rmdir+0x10c/0x438 fs/namei.c:4188 #3: ffff0000dfd42460 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:402 #4: ffff0000f8cc96b8 (&ovl_i_lock_key[depth]){+.+.}-{3:3}, at: ovl_inode_lock_interruptible fs/overlayfs/overlayfs.h:503 [inline] #4: ffff0000f8cc96b8 (&ovl_i_lock_key[depth]){+.+.}-{3:3}, at: ovl_nlink_start+0x240/0x430 fs/overlayfs/util.c:938 #5: ffff0000dfd42748 (&type->s_vfs_rename_key){+.+.}-{3:3}, at: lock_rename+0x58/0x110 fs/namei.c:3046 #6: ffff0000f6a57380 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #6: ffff0000f6a57380 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: lock_two_directories fs/namei.c:-1 [inline] #6: ffff0000f6a57380 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: lock_rename+0xcc/0x110 fs/namei.c:3047 #7: ffff0000e17bc520 (&type->i_mutex_dir_key#10/5){+.+.}-{3:3}, at: lock_rename+0xf8/0x110 include/linux/fs.h:-1 #8: ffff0000e17bcbc0 (&type->i_mutex_dir_key#10/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #8: ffff0000e17bcbc0 (&type->i_mutex_dir_key#10/2){+.+.}-{3:3}, at: vfs_rename+0x668/0xe3c fs/namei.c:4850 stack backtrace: CPU: 1 PID: 4604 Comm: syz.3.59 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/07/2026 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048 check_noncircular+0x264/0x2f8 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3830 [inline] __lock_acquire+0x2808/0x6634 kernel/locking/lockdep.c:5063 lock_acquire+0x20c/0x638 kernel/locking/lockdep.c:5676 down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] vfs_rename+0x6cc/0xe3c fs/namei.c:4851 ovl_do_rename fs/overlayfs/overlayfs.h:297 [inline] ovl_cleanup_and_whiteout+0x3c8/0x614 fs/overlayfs/dir.c:125 ovl_remove_and_whiteout fs/overlayfs/dir.c:796 [inline] ovl_do_remove+0x690/0x930 fs/overlayfs/dir.c:923 ovl_rmdir+0x24/0x34 fs/overlayfs/dir.c:956 vfs_rmdir+0x304/0x438 fs/namei.c:4199 do_rmdir+0x244/0x524 fs/namei.c:4260 __do_sys_unlinkat fs/namei.c:4440 [inline] __se_sys_unlinkat fs/namei.c:4434 [inline] __arm64_sys_unlinkat+0xcc/0xfc fs/namei.c:4434 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x290 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x13c/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x5c/0x134 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585