====================================================== WARNING: possible circular locking dependency detected 6.1.141-syzkaller #0 Not tainted ------------------------------------------------------ syz.6.195/5419 is trying to acquire lock: ffff0000e147d900 (&type->i_mutex_dir_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff0000e147d900 (&type->i_mutex_dir_key#8){++++}-{3:3}, at: vfs_rename+0x670/0xdcc fs/namei.c:4839 but task is already holding lock: ffff0000e147e640 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] ffff0000e147e640 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: vfs_rename+0x60c/0xdcc fs/namei.c:4837 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}: down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] xattr_rmdir fs/reiserfs/xattr.c:106 [inline] delete_one_xattr+0xe8/0x2c8 fs/reiserfs/xattr.c:338 reiserfs_for_each_xattr+0x568/0x68c fs/reiserfs/xattr.c:311 reiserfs_delete_xattrs+0x2c/0xa4 fs/reiserfs/xattr.c:364 reiserfs_evict_inode+0x1d8/0x3e8 fs/reiserfs/inode.c:53 evict+0x3c8/0x810 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x764/0x7f4 fs/inode.c:1860 dentry_unlink_inode+0x360/0x438 fs/dcache.c:405 __dentry_kill+0x320/0x598 fs/dcache.c:611 dentry_kill+0xc8/0x248 fs/dcache.c:-1 dput+0x238/0x454 fs/dcache.c:918 cleanup_mnt+0x360/0x404 fs/namespace.c:1181 __cleanup_mnt+0x20/0x30 fs/namespace.c:1189 task_work_run+0x1ec/0x270 kernel/task_work.c:203 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x1f70/0x2b0c arch/arm64/kernel/signal.c:1137 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x98/0x138 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #1 (&type->i_mutex_dir_key#8/3){+.+.}-{3:3}: down_write_nested+0x64/0x94 kernel/locking/rwsem.c:1689 inode_lock_nested include/linux/fs.h:793 [inline] open_xa_root fs/reiserfs/xattr.c:127 [inline] open_xa_dir+0x118/0x5d4 fs/reiserfs/xattr.c:152 reiserfs_for_each_xattr+0x16c/0x68c fs/reiserfs/xattr.c:252 reiserfs_chown_xattrs+0x30/0xa8 fs/reiserfs/xattr.c:375 reiserfs_setattr+0x8c8/0xf7c fs/reiserfs/inode.c:3348 notify_change+0xb0c/0xdcc fs/attr.c:499 chown_common+0x414/0x574 fs/open.c:736 vfs_fchown fs/open.c:804 [inline] ksys_fchown+0xe0/0x158 fs/open.c:815 __do_sys_fchown fs/open.c:823 [inline] __se_sys_fchown fs/open.c:821 [inline] __arm64_sys_fchown+0x7c/0x94 fs/open.c:821 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 -> #0 (&type->i_mutex_dir_key#8){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x293c/0x6544 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662 down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] vfs_rename+0x670/0xdcc fs/namei.c:4839 do_renameat2+0x738/0xa54 fs/namei.c:5027 __do_sys_renameat2 fs/namei.c:5060 [inline] __se_sys_renameat2 fs/namei.c:5057 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:5057 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 other info that might help us debug this: Chain exists of: &type->i_mutex_dir_key#8 --> &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(&type->i_mutex_dir_key#8); *** DEADLOCK *** 5 locks held by syz.6.195/5419: #0: ffff0000f3d36460 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #1: ffff0000f3d36748 (&type->s_vfs_rename_key#2){+.+.}-{3:3}, at: lock_rename fs/namei.c:3038 [inline] #1: ffff0000f3d36748 (&type->s_vfs_rename_key#2){+.+.}-{3:3}, at: do_renameat2+0x2fc/0xa54 fs/namei.c:4966 #2: ffff0000e147c520 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #2: ffff0000e147c520 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: lock_two_directories fs/namei.c:-1 [inline] #2: ffff0000e147c520 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3039 [inline] #2: ffff0000e147c520 (&type->i_mutex_dir_key#8/1){+.+.}-{3:3}, at: do_renameat2+0x378/0xa54 fs/namei.c:4966 #3: ffff0000e147dfa0 (&type->i_mutex_dir_key#8/5){+.+.}-{3:3}, at: lock_rename include/linux/fs.h:-1 [inline] #3: ffff0000e147dfa0 (&type->i_mutex_dir_key#8/5){+.+.}-{3:3}, at: do_renameat2+0x3ac/0xa54 fs/namei.c:4966 #4: ffff0000e147e640 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #4: ffff0000e147e640 (&type->i_mutex_dir_key#8/2){+.+.}-{3:3}, at: vfs_rename+0x60c/0xdcc fs/namei.c:4837 stack backtrace: CPU: 0 PID: 5419 Comm: syz.6.195 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048 check_noncircular+0x240/0x2d4 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x293c/0x6544 kernel/locking/lockdep.c:5049 lock_acquire+0x20c/0x644 kernel/locking/lockdep.c:5662 down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] vfs_rename+0x670/0xdcc fs/namei.c:4839 do_renameat2+0x738/0xa54 fs/namei.c:5027 __do_sys_renameat2 fs/namei.c:5060 [inline] __se_sys_renameat2 fs/namei.c:5057 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:5057 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585