REISERFS (device loop3): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc7-syzkaller-00018-g0983f6bf2bfc #0 Not tainted ------------------------------------------------------ syz-executor.3/11585 is trying to acquire lock: ffff888078d89020 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: lock_two_nondirectories+0xe2/0x140 but task is already holding lock: ffff888078d896c0 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: lock_rename+0x172/0x1a0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}: lock_acquire+0x20b/0x600 down_write_nested+0x3d/0x60 delete_one_xattr+0x106/0x2f0 reiserfs_for_each_xattr+0x9b0/0xb50 reiserfs_delete_xattrs+0x1f/0x90 reiserfs_evict_inode+0x207/0x470 evict+0x2a4/0x620 __dentry_kill+0x436/0x650 dentry_kill+0xbb/0x290 dput+0x1d8/0x3f0 ovl_create_or_link+0x10aa/0x1480 ovl_create_object+0x246/0x370 vfs_mkdir+0x3ba/0x590 do_mkdirat+0x237/0x4f0 __x64_sys_mkdir+0x6e/0x80 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}: lock_acquire+0x20b/0x600 down_write_nested+0x3d/0x60 open_xa_dir+0x122/0x650 xattr_lookup+0x24/0x280 reiserfs_xattr_get+0xfd/0x570 __vfs_getxattr+0x436/0x470 cap_inode_need_killpriv+0x45/0x60 security_inode_need_killpriv+0x61/0x90 __file_remove_privs+0x23f/0x620 __generic_file_write_iter+0xc4/0x400 generic_file_write_iter+0xaf/0x310 vfs_write+0x7dd/0xc50 ksys_write+0x17c/0x2a0 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}: validate_chain+0x166b/0x5860 __lock_acquire+0x125b/0x1f80 lock_acquire+0x20b/0x600 down_write+0x3a/0x60 lock_two_nondirectories+0xe2/0x140 vfs_rename+0x836/0x1190 do_renameat2+0xa70/0x1250 __x64_sys_renameat2+0xd2/0xe0 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#22 --> &type->i_mutex_dir_key#8/3 --> &type->i_mutex_dir_key#8/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#8/2); lock(&type->i_mutex_dir_key#8/3); lock(&type->i_mutex_dir_key#8/2); lock(&sb->s_type->i_mutex_key#22); *** DEADLOCK *** 4 locks held by syz-executor.3/11585: #0: ffff8880768f8460 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 #1: ffff8880768f8748 (&type->s_vfs_rename_key#6){+.+.}-{3:3}, at: lock_rename+0x58/0x1a0 #2: ffff888040406640 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: lock_rename+0xa4/0x1a0 #3: ffff888078d896c0 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: lock_rename+0x172/0x1a0 stack backtrace: CPU: 1 PID: 11585 Comm: syz-executor.3 Not tainted 6.2.0-rc7-syzkaller-00018-g0983f6bf2bfc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: dump_stack_lvl+0x1b5/0x2a0 check_noncircular+0x2d1/0x390 validate_chain+0x166b/0x5860 __lock_acquire+0x125b/0x1f80 lock_acquire+0x20b/0x600 down_write+0x3a/0x60 lock_two_nondirectories+0xe2/0x140 vfs_rename+0x836/0x1190 do_renameat2+0xa70/0x1250 __x64_sys_renameat2+0xd2/0xe0 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ffb1de8c0f9 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:00007ffb1ec70168 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007ffb1dfabf80 RCX: 00007ffb1de8c0f9 RDX: 0000000000000007 RSI: 00000000200001c0 RDI: 0000000000000007 RBP: 00007ffb1dee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000200002c0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffec75eab8f R14: 00007ffb1ec70300 R15: 0000000000022000