REISERFS (device loop3): Using r5 hash to sort names REISERFS (device loop3): Created .reiserfs_priv - reserved for xattr storage. ====================================================== WARNING: possible circular locking dependency detected 6.1.0-syzkaller-14594-g72a85e2b0a1e #0 Not tainted ------------------------------------------------------ syz-executor.3/29892 is trying to acquire lock: ffff88803e0d1020 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] ffff88803e0d1020 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: lock_two_nondirectories+0xdd/0x130 fs/inode.c:1121 but task is already holding lock: ffff88803e0d5fa0 (&type->i_mutex_dir_key#19/2){+.+.}-{3:3}, at: lock_rename+0x16e/0x1a0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&type->i_mutex_dir_key#19/2){+.+.}-{3:3}: lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_write_nested+0xa2/0x280 kernel/locking/rwsem.c:1672 inode_lock_nested include/linux/fs.h:791 [inline] xattr_rmdir fs/reiserfs/xattr.c:106 [inline] delete_one_xattr+0x101/0x2f0 fs/reiserfs/xattr.c:338 reiserfs_for_each_xattr+0x98c/0xb30 fs/reiserfs/xattr.c:311 reiserfs_delete_xattrs+0x1b/0x80 fs/reiserfs/xattr.c:364 reiserfs_evict_inode+0x200/0x460 fs/reiserfs/inode.c:53 evict+0x2a4/0x620 fs/inode.c:664 __dentry_kill+0x3b1/0x5b0 fs/dcache.c:607 dentry_kill+0xbb/0x290 dput+0x1f3/0x410 fs/dcache.c:913 ovl_destroy_inode+0x42/0xf0 fs/overlayfs/super.c:214 destroy_inode fs/inode.c:309 [inline] evict+0x541/0x620 fs/inode.c:679 do_unlinkat+0x4e2/0x930 fs/namei.c:4327 __do_sys_unlink fs/namei.c:4368 [inline] __se_sys_unlink fs/namei.c:4366 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4366 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (&type->i_mutex_dir_key#19/3){+.+.}-{3:3}: lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_write_nested+0xa2/0x280 kernel/locking/rwsem.c:1672 inode_lock_nested include/linux/fs.h:791 [inline] open_xa_root fs/reiserfs/xattr.c:127 [inline] open_xa_dir+0x11e/0x610 fs/reiserfs/xattr.c:152 xattr_lookup+0x27/0x280 fs/reiserfs/xattr.c:395 reiserfs_xattr_get+0xfa/0x580 fs/reiserfs/xattr.c:677 __vfs_getxattr+0x476/0x4b0 fs/xattr.c:425 cap_inode_need_killpriv+0x41/0x60 security/commoncap.c:301 security_inode_need_killpriv+0x50/0xb0 security/security.c:1492 dentry_needs_remove_privs fs/inode.c:1967 [inline] __file_remove_privs+0x237/0x610 fs/inode.c:1998 __generic_file_write_iter+0xc1/0x400 mm/filemap.c:3845 generic_file_write_iter+0xab/0x310 mm/filemap.c:3932 call_write_iter include/linux/fs.h:2186 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7dc/0xc50 fs/read_write.c:584 ksys_write+0x177/0x2a0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_write+0x9c/0x270 kernel/locking/rwsem.c:1562 inode_lock include/linux/fs.h:756 [inline] lock_two_nondirectories+0xdd/0x130 fs/inode.c:1121 vfs_rename+0x80a/0x1130 fs/namei.c:4749 do_renameat2+0xaad/0x12d0 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4960 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#30 --> &type->i_mutex_dir_key#19/3 --> &type->i_mutex_dir_key#19/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&type->i_mutex_dir_key#19/2); lock(&type->i_mutex_dir_key#19/3); lock(&type->i_mutex_dir_key#19/2); lock(&sb->s_type->i_mutex_key#30); *** DEADLOCK *** 4 locks held by syz-executor.3/29892: #0: ffff88807c474460 (sb_writers#24){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:508 #1: ffff88807c474748 (&type->s_vfs_rename_key#7){+.+.}-{3:3}, at: lock_rename+0x54/0x1a0 fs/namei.c:2994 #2: ffff88803e390980 (&type->i_mutex_dir_key#19/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #2: ffff88803e390980 (&type->i_mutex_dir_key#19/1){+.+.}-{3:3}, at: lock_rename+0xa0/0x1a0 fs/namei.c:2998 #3: ffff88803e0d5fa0 (&type->i_mutex_dir_key#19/2){+.+.}-{3:3}, at: lock_rename+0x16e/0x1a0 stack backtrace: CPU: 1 PID: 29892 Comm: syz-executor.3 Not tainted 6.1.0-syzkaller-14594-g72a85e2b0a1e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x290 lib/dump_stack.c:106 check_noncircular+0x2cc/0x390 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain+0x1898/0x6ae0 kernel/locking/lockdep.c:3831 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5055 lock_acquire+0x182/0x3c0 kernel/locking/lockdep.c:5668 down_write+0x9c/0x270 kernel/locking/rwsem.c:1562 inode_lock include/linux/fs.h:756 [inline] lock_two_nondirectories+0xdd/0x130 fs/inode.c:1121 vfs_rename+0x80a/0x1130 fs/namei.c:4749 do_renameat2+0xaad/0x12d0 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:4960 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f0f75e8c0a9 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:00007f0f76cc4168 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007f0f75fabf80 RCX: 00007f0f75e8c0a9 RDX: 0000000000000006 RSI: 00000000200002c0 RDI: 0000000000000006 RBP: 00007f0f75ee7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020000180 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff48163f0f R14: 00007f0f76cc4300 R15: 0000000000022000