====================================================== WARNING: possible circular locking dependency detected 5.15.189-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.84/4504 is trying to acquire lock: ffff0000e99453b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] ffff0000e99453b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ffff0000e99453b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1556 [inline] ffff0000e99453b0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}, at: ext4_xattr_set_entry+0x24f0/0x2d98 fs/ext4/xattr.c:1684 but task is already holding lock: ffff0000e9943e48 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0xe80/0x142c fs/ext4/inode.c:5546 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+0xbc/0x12c kernel/locking/rwsem.c:1551 ext4_update_i_disksize fs/ext4/ext4.h:3409 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1412 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1560 [inline] ext4_xattr_set_entry+0x2404/0x2d98 fs/ext4/xattr.c:1684 ext4_xattr_ibody_set+0x104/0x358 fs/ext4/xattr.c:2252 ext4_xattr_set_handle+0x918/0x1050 fs/ext4/xattr.c:2409 ext4_xattr_set+0x1e0/0x2b4 fs/ext4/xattr.c:2522 ext4_xattr_security_set+0x4c/0x64 fs/ext4/xattr_security.c:31 __vfs_setxattr+0x388/0x3a4 fs/xattr.c:182 __vfs_setxattr_noperm+0x120/0x564 fs/xattr.c:216 __vfs_setxattr_locked+0x1ec/0x218 fs/xattr.c:277 vfs_setxattr+0x158/0x2ac fs/xattr.c:303 do_setxattr fs/xattr.c:588 [inline] setxattr+0x248/0x2ac fs/xattr.c:611 path_setxattr+0x12c/0x25c fs/xattr.c:630 __do_sys_setxattr fs/xattr.c:646 [inline] __se_sys_setxattr fs/xattr.c:642 [inline] __arm64_sys_setxattr+0xbc/0xd8 fs/xattr.c:642 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 -> #0 (&sb->s_type->i_mutex_key#9/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2928/0x651c kernel/locking/lockdep.c:5012 lock_acquire+0x1f4/0x620 kernel/locking/lockdep.c:5623 down_write+0xbc/0x12c kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:787 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1556 [inline] ext4_xattr_set_entry+0x24f0/0x2d98 fs/ext4/xattr.c:1684 ext4_xattr_block_set+0x9a0/0x26fc fs/ext4/xattr.c:1935 ext4_xattr_move_to_block fs/ext4/xattr.c:2632 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2707 [inline] ext4_expand_extra_isize_ea+0xd8c/0x1504 fs/ext4/xattr.c:2799 __ext4_expand_extra_isize+0x298/0x358 fs/ext4/inode.c:5887 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5930 [inline] __ext4_mark_inode_dirty+0x434/0x7b0 fs/ext4/inode.c:6008 ext4_setattr+0xedc/0x142c fs/ext4/inode.c:5549 notify_change+0xa08/0xcd8 fs/attr.c:505 do_truncate+0x178/0x1f0 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x211c/0x26e4 fs/namei.c:3742 do_filp_open+0x164/0x330 fs/namei.c:3769 do_sys_openat2+0x128/0x3d8 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __arm64_sys_openat+0x120/0x154 fs/open.c:1280 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem /3); lock(&sb->s_type->i_mutex_key#9/1); lock(&ei->i_data_sem/3); lock(&sb->s_type->i_mutex_key#9/1); *** DEADLOCK *** 5 locks held by syz.1.84/4504: #0: ffff0000f002a460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377 #1: ffff0000e9943fc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff0000e9943fc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: do_truncate+0x164/0x1f0 fs/open.c:63 #2: ffff0000e9944160 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:832 [inline] #2: ffff0000e9944160 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0xa34/0x142c fs/ext4/inode.c:5506 #3: ffff0000e9943e48 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0xe80/0x142c fs/ext4/inode.c:5546 #4: ffff0000e9943c98 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #4: ffff0000e9943c98 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5927 [inline] #4: ffff0000e9943c98 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3cc/0x7b0 fs/ext4/inode.c:6008 stack backtrace: CPU: 1 PID: 4504 Comm: syz.1.84 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __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:2011 check_noncircular+0x240/0x2d4 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2928/0x651c kernel/locking/lockdep.c:5012 lock_acquire+0x1f4/0x620 kernel/locking/lockdep.c:5623 down_write+0xbc/0x12c kernel/locking/rwsem.c:1551 inode_lock include/linux/fs.h:787 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1556 [inline] ext4_xattr_set_entry+0x24f0/0x2d98 fs/ext4/xattr.c:1684 ext4_xattr_block_set+0x9a0/0x26fc fs/ext4/xattr.c:1935 ext4_xattr_move_to_block fs/ext4/xattr.c:2632 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2707 [inline] ext4_expand_extra_isize_ea+0xd8c/0x1504 fs/ext4/xattr.c:2799 __ext4_expand_extra_isize+0x298/0x358 fs/ext4/inode.c:5887 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5930 [inline] __ext4_mark_inode_dirty+0x434/0x7b0 fs/ext4/inode.c:6008 ext4_setattr+0xedc/0x142c fs/ext4/inode.c:5549 notify_change+0xa08/0xcd8 fs/attr.c:505 do_truncate+0x178/0x1f0 fs/open.c:65 handle_truncate fs/namei.c:3265 [inline] do_open fs/namei.c:3612 [inline] path_openat+0x211c/0x26e4 fs/namei.c:3742 do_filp_open+0x164/0x330 fs/namei.c:3769 do_sys_openat2+0x128/0x3d8 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __arm64_sys_openat+0x120/0x154 fs/open.c:1280 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584