====================================================== WARNING: possible circular locking dependency detected 6.6.0-syzkaller-10265-gbabe393974de #0 Not tainted ------------------------------------------------------ syz-executor.0/5403 is trying to acquire lock: ffff888053af3b40 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] ffff888053af3b40 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: xattr_rmdir fs/reiserfs/xattr.c:107 [inline] ffff888053af3b40 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: delete_one_xattr+0x13e/0x2d0 fs/reiserfs/xattr.c:339 but task is already holding lock: ffff888053af1420 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] ffff888053af1420 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x737/0x990 fs/reiserfs/xattr.c:310 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}: down_write_nested+0x97/0x200 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] open_xa_root fs/reiserfs/xattr.c:128 [inline] open_xa_dir+0x142/0x8d0 fs/reiserfs/xattr.c:153 xattr_lookup+0x1f/0x380 fs/reiserfs/xattr.c:396 reiserfs_xattr_set_handle+0x103/0xb50 fs/reiserfs/xattr.c:535 reiserfs_xattr_set+0x46a/0x5c0 fs/reiserfs/xattr.c:635 trusted_set+0xa8/0xd0 fs/reiserfs/xattr_trusted.c:31 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296 vfs_setxattr+0x146/0x350 fs/xattr.c:322 ovl_do_setxattr fs/overlayfs/overlayfs.h:299 [inline] ovl_setxattr fs/overlayfs/overlayfs.h:311 [inline] ovl_make_workdir fs/overlayfs/super.c:770 [inline] ovl_get_workdir fs/overlayfs/super.c:882 [inline] ovl_fill_super+0x13fa/0x64a0 fs/overlayfs/super.c:1427 vfs_get_super fs/super.c:1335 [inline] get_tree_nodev+0xd6/0x180 fs/super.c:1354 vfs_get_tree+0x8c/0x370 fs/super.c:1768 do_new_mount fs/namespace.c:3337 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3664 do_mount fs/namespace.c:3677 [inline] __do_sys_mount fs/namespace.c:3886 [inline] __se_sys_mount fs/namespace.c:3863 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3863 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #1 (&type->i_mutex_dir_key#8){++++}-{3:3}: down_write_nested+0x97/0x200 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] lock_two_inodes+0x1b2/0x1e0 fs/inode.c:1127 vfs_rename+0x4f0/0x1c30 fs/namei.c:4816 do_renameat2+0xc3c/0xdc0 fs/namei.c:4996 __do_sys_rename fs/namei.c:5042 [inline] __se_sys_rename fs/namei.c:5040 [inline] __x64_sys_rename+0x81/0xa0 fs/namei.c:5040 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #0 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 down_write_nested+0x97/0x200 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] xattr_rmdir fs/reiserfs/xattr.c:107 [inline] delete_one_xattr+0x13e/0x2d0 fs/reiserfs/xattr.c:339 reiserfs_for_each_xattr+0x746/0x990 fs/reiserfs/xattr.c:312 reiserfs_delete_xattrs+0x1f/0x90 fs/reiserfs/xattr.c:365 reiserfs_evict_inode+0x302/0x570 fs/reiserfs/inode.c:53 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:745 [inline] dput+0x6de/0xf80 fs/dcache.c:913 cleanup_mnt+0x1fa/0x450 fs/namespace.c:1255 task_work_run+0x14d/0x240 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x4b/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b other info that might help us debug this: Chain exists of: &type->i_mutex_dir_key#8/2 --> &type->i_mutex_dir_key#8 --> &type->i_mutex_dir_key#8/3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#8/3); lock(&type->i_mutex_dir_key#8); lock(&type->i_mutex_dir_key#8/3); lock(&type->i_mutex_dir_key#8/2); *** DEADLOCK *** 1 lock held by syz-executor.0/5403: #0: ffff888053af1420 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] #0: ffff888053af1420 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x737/0x990 fs/reiserfs/xattr.c:310 stack backtrace: CPU: 1 PID: 5403 Comm: syz-executor.0 Not tainted 6.6.0-syzkaller-10265-gbabe393974de #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5718 down_write_nested+0x97/0x200 kernel/locking/rwsem.c:1695 inode_lock_nested include/linux/fs.h:837 [inline] xattr_rmdir fs/reiserfs/xattr.c:107 [inline] delete_one_xattr+0x13e/0x2d0 fs/reiserfs/xattr.c:339 reiserfs_for_each_xattr+0x746/0x990 fs/reiserfs/xattr.c:312 reiserfs_delete_xattrs+0x1f/0x90 fs/reiserfs/xattr.c:365 reiserfs_evict_inode+0x302/0x570 fs/reiserfs/inode.c:53 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 dentry_unlink_inode+0x292/0x430 fs/dcache.c:401 __dentry_kill+0x3b8/0x640 fs/dcache.c:607 dentry_kill fs/dcache.c:745 [inline] dput+0x6de/0xf80 fs/dcache.c:913 cleanup_mnt+0x1fa/0x450 fs/namespace.c:1255 task_work_run+0x14d/0x240 kernel/task_work.c:180 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x4b/0x110 arch/x86/entry/common.c:88 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f1214e7de17 Code: b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffce1c5f058 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f1214e7de17 RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007ffce1c5f110 RBP: 00007ffce1c5f110 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffce1c601d0 R13: 00007f1214ec73b9 R14: 000000000001c0e5 R15: 0000000000000008