EXT4-fs (loop1): encrypted files will use data=ordered instead of data journaling mode EXT4-fs (loop1): 1 truncate cleaned up EXT4-fs (loop1): mounted filesystem without journal. Quota mode: none. ====================================================== WARNING: possible circular locking dependency detected 6.1.141-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.450/5931 is trying to acquire lock: ffff888071226850 (&sb->s_type->i_mutex_key#8/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff888071226850 (&sb->s_type->i_mutex_key#8/1){+.+.}-{3:3}, at: ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ffff888071226850 (&sb->s_type->i_mutex_key#8/1){+.+.}-{3:3}, at: ext4_xattr_inode_lookup_create+0x18b5/0x1d10 fs/ext4/xattr.c:1556 but task is already holding lock: ffff8880712252c8 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x13d4/0x19f0 fs/ext4/inode.c:5593 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+0x36/0x60 kernel/locking/rwsem.c:1573 ext4_update_i_disksize fs/ext4/ext4.h:3378 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1412 [inline] ext4_xattr_inode_lookup_create+0x15c4/0x1d10 fs/ext4/xattr.c:1562 ext4_xattr_ibody_set+0x1fe/0x690 fs/ext4/xattr.c:2224 ext4_xattr_set_handle+0xa7c/0x12b0 fs/ext4/xattr.c:2401 ext4_xattr_set+0x22a/0x320 fs/ext4/xattr.c:2515 __vfs_setxattr+0x3e0/0x420 fs/xattr.c:182 __vfs_setxattr_noperm+0x129/0x5e0 fs/xattr.c:216 vfs_setxattr+0x168/0x2f0 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x2b2/0x2d0 fs/xattr.c:617 path_setxattr+0x142/0x280 fs/xattr.c:636 __do_sys_setxattr fs/xattr.c:652 [inline] __se_sys_setxattr fs/xattr.c:648 [inline] __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:648 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&sb->s_type->i_mutex_key#8/1){+.+.}-{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+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ext4_xattr_inode_lookup_create+0x18b5/0x1d10 fs/ext4/xattr.c:1556 ext4_xattr_block_set+0x23a/0x32a0 fs/ext4/xattr.c:1876 ext4_xattr_move_to_block fs/ext4/xattr.c:2625 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2700 [inline] ext4_expand_extra_isize_ea+0x109b/0x19b0 fs/ext4/xattr.c:2792 __ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5965 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6008 [inline] __ext4_mark_inode_dirty+0x47f/0x770 fs/ext4/inode.c:6086 ext4_setattr+0x1457/0x19f0 fs/ext4/inode.c:5596 notify_change+0xc74/0xf40 fs/attr.c:499 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3285 [inline] do_open fs/namei.c:3630 [inline] path_openat+0x27f2/0x2e70 fs/namei.c:3783 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 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#8/1); lock(&ei->i_data_sem/3); lock(&sb->s_type->i_mutex_key#8/1); *** DEADLOCK *** 5 locks held by syz.1.450/5931: #0: ffff888075128460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:393 #1: ffff888071225440 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888071225440 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: do_truncate+0x183/0x220 fs/open.c:63 #2: ffff8880712255e0 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:803 [inline] #2: ffff8880712255e0 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0xe6f/0x19f0 fs/ext4/inode.c:5553 #3: ffff8880712252c8 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x13d4/0x19f0 fs/ext4/inode.c:5593 #4: ffff888071225108 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #4: ffff888071225108 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6005 [inline] #4: ffff888071225108 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3fe/0x770 fs/ext4/inode.c:6086 stack backtrace: CPU: 0 PID: 5931 Comm: syz.1.450 Not tainted 6.1.141-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 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+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 down_write+0x36/0x60 kernel/locking/rwsem.c:1573 inode_lock include/linux/fs.h:758 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1474 [inline] ext4_xattr_inode_lookup_create+0x18b5/0x1d10 fs/ext4/xattr.c:1556 ext4_xattr_block_set+0x23a/0x32a0 fs/ext4/xattr.c:1876 ext4_xattr_move_to_block fs/ext4/xattr.c:2625 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2700 [inline] ext4_expand_extra_isize_ea+0x109b/0x19b0 fs/ext4/xattr.c:2792 __ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5965 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6008 [inline] __ext4_mark_inode_dirty+0x47f/0x770 fs/ext4/inode.c:6086 ext4_setattr+0x1457/0x19f0 fs/ext4/inode.c:5596 notify_change+0xc74/0xf40 fs/attr.c:499 do_truncate+0x197/0x220 fs/open.c:65 handle_truncate fs/namei.c:3285 [inline] do_open fs/namei.c:3630 [inline] path_openat+0x27f2/0x2e70 fs/namei.c:3783 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f987d58e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f987e42b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f987d7b5fa0 RCX: 00007f987d58e929 RDX: 0000000000000242 RSI: 0000200000000040 RDI: ffffffffffffff9c RBP: 00007f987d610b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f987d7b5fa0 R15: 00007ffcd317c078