====================================================== WARNING: possible circular locking dependency detected 6.11.0-rc5-syzkaller-gdf54f4a16f82 #0 Not tainted ------------------------------------------------------ syz.4.212/7666 is trying to acquire lock: ffff0000ef190df0 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:799 [inline] ffff0000ef190df0 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}, at: ext4_xattr_inode_iget+0x360/0x510 fs/ext4/xattr.c:461 but task is already holding lock: ffff0000ef193e58 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_truncate+0x7d0/0x1074 fs/ext4/inode.c:4213 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->i_data_sem/3){++++}-{3:3}: down_write+0x50/0xc0 kernel/locking/rwsem.c:1579 ext4_update_i_disksize fs/ext4/ext4.h:3395 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1452 [inline] ext4_xattr_inode_lookup_create+0x12d8/0x19e4 fs/ext4/xattr.c:1602 ext4_xattr_ibody_set+0x1b0/0x604 fs/ext4/xattr.c:2269 ext4_xattr_set_handle+0xb64/0x12d0 fs/ext4/xattr.c:2446 ext4_xattr_set+0x1e0/0x354 fs/ext4/xattr.c:2560 ext4_xattr_trusted_set+0x4c/0x64 fs/ext4/xattr_trusted.c:38 __vfs_setxattr+0x3d8/0x400 fs/xattr.c:200 __vfs_setxattr_noperm+0x110/0x578 fs/xattr.c:234 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:295 vfs_setxattr+0x1a8/0x344 fs/xattr.c:321 do_setxattr fs/xattr.c:629 [inline] path_setxattr+0x30c/0x428 fs/xattr.c:658 __do_sys_setxattr fs/xattr.c:676 [inline] __se_sys_setxattr fs/xattr.c:672 [inline] __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:672 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 -> #0 (&ea_inode->i_rwsem#8/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x33d8/0x779c kernel/locking/lockdep.c:5142 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 down_write+0x50/0xc0 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:799 [inline] ext4_xattr_inode_iget+0x360/0x510 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x12c/0x3a0 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2642 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2744 [inline] ext4_expand_extra_isize_ea+0xbc8/0x16c0 fs/ext4/xattr.c:2836 __ext4_expand_extra_isize+0x290/0x348 fs/ext4/inode.c:5861 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5904 [inline] __ext4_mark_inode_dirty+0x458/0x868 fs/ext4/inode.c:5982 ext4_ext_truncate+0x94/0x1d4 fs/ext4/extents.c:4432 ext4_truncate+0x9c4/0x1074 fs/ext4/inode.c:4218 ext4_evict_inode+0xaf0/0x10f0 fs/ext4/inode.c:258 evict+0x418/0x894 fs/inode.c:704 iput_final fs/inode.c:1838 [inline] iput+0x74c/0x830 fs/inode.c:1864 dentry_unlink_inode+0x3a0/0x4e0 fs/dcache.c:407 __dentry_kill+0x178/0x5e8 fs/dcache.c:610 dput+0x1b8/0x290 fs/dcache.c:852 do_renameat2+0x9d4/0xe40 fs/namei.c:5125 __do_sys_renameat2 fs/namei.c:5157 [inline] __se_sys_renameat2 fs/namei.c:5154 [inline] __arm64_sys_renameat2+0xd8/0xf4 fs/namei.c:5154 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#8/1); lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#8/1); *** DEADLOCK *** 7 locks held by syz.4.212/7666: #0: ffff0000d69d6420 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:515 #1: ffff0000d69d6730 (&type->s_vfs_rename_key){+.+.}-{3:3}, at: lock_rename fs/namei.c:3151 [inline] #1: ffff0000d69d6730 (&type->s_vfs_rename_key){+.+.}-{3:3}, at: do_renameat2+0x4a0/0xe40 fs/namei.c:5058 #2: ffff0000ef1967a8 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:834 [inline] #2: ffff0000ef1967a8 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_two_directories+0x144/0x214 fs/namei.c:3117 #3: ffff0000ef195db0 (&type->i_mutex_dir_key#3/5){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:834 [inline] #3: ffff0000ef195db0 (&type->i_mutex_dir_key#3/5){+.+.}-{3:3}, at: lock_two_directories+0x16c/0x214 fs/namei.c:3118 #4: ffff0000d69d6610 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1675 [inline] #4: ffff0000d69d6610 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1858 [inline] #4: ffff0000d69d6610 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x2c0/0x10f0 fs/ext4/inode.c:212 #5: ffff0000ef193e58 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_truncate+0x7d0/0x1074 fs/ext4/inode.c:4213 #6: ffff0000ef193c98 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #6: ffff0000ef193c98 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5901 [inline] #6: ffff0000ef193c98 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3d8/0x868 fs/ext4/inode.c:5982 stack backtrace: CPU: 1 UID: 0 PID: 7666 Comm: syz.4.212 Not tainted 6.11.0-rc5-syzkaller-gdf54f4a16f82 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:119 dump_stack+0x1c/0x28 lib/dump_stack.c:128 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2059 check_noncircular+0x310/0x404 kernel/locking/lockdep.c:2186 check_prev_add kernel/locking/lockdep.c:3133 [inline] check_prevs_add kernel/locking/lockdep.c:3252 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x33d8/0x779c kernel/locking/lockdep.c:5142 lock_acquire+0x240/0x728 kernel/locking/lockdep.c:5759 down_write+0x50/0xc0 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:799 [inline] ext4_xattr_inode_iget+0x360/0x510 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x12c/0x3a0 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2642 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2744 [inline] ext4_expand_extra_isize_ea+0xbc8/0x16c0 fs/ext4/xattr.c:2836 __ext4_expand_extra_isize+0x290/0x348 fs/ext4/inode.c:5861 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5904 [inline] __ext4_mark_inode_dirty+0x458/0x868 fs/ext4/inode.c:5982 ext4_ext_truncate+0x94/0x1d4 fs/ext4/extents.c:4432 ext4_truncate+0x9c4/0x1074 fs/ext4/inode.c:4218 ext4_evict_inode+0xaf0/0x10f0 fs/ext4/inode.c:258 evict+0x418/0x894 fs/inode.c:704 iput_final fs/inode.c:1838 [inline] iput+0x74c/0x830 fs/inode.c:1864 dentry_unlink_inode+0x3a0/0x4e0 fs/dcache.c:407 __dentry_kill+0x178/0x5e8 fs/dcache.c:610 dput+0x1b8/0x290 fs/dcache.c:852 do_renameat2+0x9d4/0xe40 fs/namei.c:5125 __do_sys_renameat2 fs/namei.c:5157 [inline] __se_sys_renameat2 fs/namei.c:5154 [inline] __arm64_sys_renameat2+0xd8/0xf4 fs/namei.c:5154 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598