====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc6-syzkaller-00043-gdd72f9c7e512 #0 Not tainted ------------------------------------------------------ syz-executor326/5036 is trying to acquire lock: ffff888072ef2b00 (&type->i_mutex_dir_key#6/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] ffff888072ef2b00 (&type->i_mutex_dir_key#6/2){+.+.}-{3:3}, at: xattr_rmdir fs/reiserfs/xattr.c:107 [inline] ffff888072ef2b00 (&type->i_mutex_dir_key#6/2){+.+.}-{3:3}, at: delete_one_xattr+0x13e/0x2d0 fs/reiserfs/xattr.c:339 but task is already holding lock: ffff888072ef03e0 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] ffff888072ef03e0 (&type->i_mutex_dir_key#6/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#6/3){+.+.}-{3:3}: down_write_nested+0x97/0x200 kernel/locking/rwsem.c:1689 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:762 [inline] ovl_get_workdir fs/overlayfs/super.c:874 [inline] ovl_fill_super+0x13fa/0x6450 fs/overlayfs/super.c:1419 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:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&type->i_mutex_dir_key#6){++++}-{3:3}: down_write_nested+0x97/0x200 kernel/locking/rwsem.c:1689 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:4832 do_renameat2+0xc3c/0xdc0 fs/namei.c:5012 __do_sys_rename fs/namei.c:5058 [inline] __se_sys_rename fs/namei.c:5056 [inline] __x64_sys_rename+0x81/0xa0 fs/namei.c:5056 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&type->i_mutex_dir_key#6/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:1689 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/0x3d0 fs/namespace.c:1253 task_work_run+0x14d/0x240 kernel/task_work.c:180 ptrace_notify+0x10c/0x130 kernel/signal.c:2387 ptrace_report_syscall include/linux/ptrace.h:411 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline] syscall_exit_work kernel/entry/common.c:251 [inline] syscall_exit_to_user_mode_prepare+0x120/0x220 kernel/entry/common.c:278 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0xd/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &type->i_mutex_dir_key#6/2 --> &type->i_mutex_dir_key#6 --> &type->i_mutex_dir_key#6/3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#6/3); lock(&type->i_mutex_dir_key#6); lock(&type->i_mutex_dir_key#6/3); lock(&type->i_mutex_dir_key#6/2); *** DEADLOCK *** 1 lock held by syz-executor326/5036: #0: ffff888072ef03e0 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:837 [inline] #0: ffff888072ef03e0 (&type->i_mutex_dir_key#6/3){+.+.}-{3:3}, at: reiserfs_for_each_xattr+0x737/0x990 fs/reiserfs/xattr.c:310 stack backtrace: CPU: 0 PID: 5036 Comm: syz-executor326 Not tainted 6.6.0-rc6-syzkaller-00043-gdd72f9c7e512 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/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:1689 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/0x3d0 fs/namespace.c:1253 task_work_run+0x14d/0x240 kernel/task_work.c:180 ptrace_notify+0x10c/0x130 kernel/signal.c:2387 ptrace_report_syscall include/linux/ptrace.h:411 [inline] ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline] syscall_exit_work kernel/entry/common.c:251 [inline] syscall_exit_to_user_mode_prepare+0x120/0x220 kernel/entry/common.c:278 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0xd/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f201933f547 Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007fffe97f5688 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f201933f547 RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007fffe97f5740 RBP: 00007fffe97f5740 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000206 R12: 00007fffe97f67b0 R13: 0000555556be16c0 R14: 431bde82d7b634db R15: 00007fffe97f67d0