REISERFS (device loop2): Using r5 hash to sort names REISERFS (device loop2): 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.2/8632 is trying to acquire lock: ffff888045d42400 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: lock_two_nondirectories+0xe2/0x140 but task is already holding lock: ffff888045d41d60 (&type->i_mutex_dir_key#10/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#10/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_destroy_inode+0x40/0xf0 evict+0x542/0x620 do_unlinkat+0x4ad/0x8c0 __x64_sys_unlink+0x49/0x50 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&type->i_mutex_dir_key#10/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 notify_change+0x4e1/0x1080 chown_common+0x578/0x8c0 do_fchownat+0x165/0x240 __x64_sys_lchown+0x85/0x90 do_syscall_64+0x41/0xc0 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&sb->s_type->i_mutex_key#21){+.+.}-{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#21 --> &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#21); *** DEADLOCK *** 4 locks held by syz-executor.2/8632: #0: ffff888041d02460 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 #1: ffff888041d02748 (&type->s_vfs_rename_key){+.+.}-{3:3}, at: lock_rename+0x58/0x1a0 #2: ffff888045d437e0 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: lock_rename+0x13e/0x1a0 #3: ffff888045d41d60 (&type->i_mutex_dir_key#10/2){+.+.}-{3:3}, at: lock_rename+0x172/0x1a0 stack backtrace: CPU: 0 PID: 8632 Comm: syz-executor.2 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:0x7faf5a68c0f9 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:00007faf5b360168 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007faf5a7abf80 RCX: 00007faf5a68c0f9 RDX: 0000000000000005 RSI: 0000000020001680 RDI: 0000000000000006 RBP: 00007faf5a6e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000200016c0 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcd08f098f R14: 00007faf5b360300 R15: 0000000000022000