Hello, syzbot found the following issue on: HEAD commit: 8d245acc1e88 Merge tag 'char-misc-6.17-rc3' of git://git.k.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1654ac42580000 kernel config: https://syzkaller.appspot.com/x/.config?x=da02162f945f3311 dashboard link: https://syzkaller.appspot.com/bug?extid=c5c9c223a721d7353490 compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15d1cef0580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10f4e7bc580000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/cea3b9f96317/disk-8d245acc.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/edb55fcbe832/vmlinux-8d245acc.xz kernel image: https://storage.googleapis.com/syzbot-assets/db6f85cd97c7/bzImage-8d245acc.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/d39971563b22/mount_0.gz fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=125fc862580000) IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+c5c9c223a721d7353490@xxxxxxxxxxxxxxxxxxxxxxxxx loop5: detected capacity change from 0 to 1024 EXT4-fs: Ignoring removed nobh option ============================================ WARNING: possible recursive locking detected syzkaller #0 Not tainted -------------------------------------------- syz.5.286/7060 is trying to acquire lock: ffff888056de1590 (&ei->i_data_sem/3){++++}-{4:4}, at: ext4_truncate+0xddd/0x1210 fs/ext4/inode.c:4639 but task is already holding lock: ffff888056de1f20 (&ei->i_data_sem/3){++++}-{4:4}, at: ext4_truncate+0xddd/0x1210 fs/ext4/inode.c:4639 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ei->i_data_sem/3); lock(&ei->i_data_sem/3); *** DEADLOCK *** May be due to missing lock nesting notation 5 locks held by syz.5.286/7060: #0: ffff888022bfe428 (sb_writers#4){.+.+}-{0:0}, at: vfs_truncate+0x336/0x6e0 fs/open.c:96 #1: ffff888056de2090 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: inode_lock_killable include/linux/fs.h:874 [inline] #1: ffff888056de2090 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: do_truncate+0x146/0x230 fs/open.c:63 #2: ffff888056de2230 (mapping.invalidate_lock#2){++++}-{4:4}, at: filemap_invalidate_lock include/linux/fs.h:924 [inline] #2: ffff888056de2230 (mapping.invalidate_lock#2){++++}-{4:4}, at: ext4_setattr+0xe11/0x2ae0 fs/ext4/inode.c:5954 #3: ffff888056de1f20 (&ei->i_data_sem/3){++++}-{4:4}, at: ext4_truncate+0xddd/0x1210 fs/ext4/inode.c:4639 #4: ffff888056de1d78 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:164 [inline] #4: ffff888056de1d78 (&ei->xattr_sem){++++}-{4:4}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:6425 [inline] #4: ffff888056de1d78 (&ei->xattr_sem){++++}-{4:4}, at: __ext4_mark_inode_dirty+0x4ba/0x870 fs/ext4/inode.c:6506 stack backtrace: CPU: 1 UID: 0 PID: 7060 Comm: syz.5.286 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_deadlock_bug+0x1e9/0x240 kernel/locking/lockdep.c:3041 check_deadlock kernel/locking/lockdep.c:3093 [inline] validate_chain kernel/locking/lockdep.c:3895 [inline] __lock_acquire+0x1133/0x1ce0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825 down_write+0x92/0x200 kernel/locking/rwsem.c:1590 ext4_truncate+0xddd/0x1210 fs/ext4/inode.c:4639 ext4_evict_inode+0x7a8/0x18e0 fs/ext4/inode.c:261 evict+0x3e6/0x920 fs/inode.c:810 iput_final fs/inode.c:1897 [inline] iput fs/inode.c:1923 [inline] iput+0x521/0x880 fs/inode.c:1909 ext4_xattr_set_entry+0x73c/0x1f00 fs/ext4/xattr.c:1839 ext4_xattr_ibody_set+0x3d6/0x5d0 fs/ext4/xattr.c:2263 ext4_xattr_move_to_block fs/ext4/xattr.c:2666 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2734 [inline] ext4_expand_extra_isize_ea+0x1487/0x1ab0 fs/ext4/xattr.c:2822 __ext4_expand_extra_isize+0x346/0x480 fs/ext4/inode.c:6385 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6428 [inline] __ext4_mark_inode_dirty+0x544/0x870 fs/ext4/inode.c:6506 ext4_ext_truncate+0xa3/0x300 fs/ext4/extents.c:4475 ext4_truncate+0xe3b/0x1210 fs/ext4/inode.c:4643 ext4_setattr+0x19f3/0x2ae0 fs/ext4/inode.c:6044 notify_change+0x6a9/0x1230 fs/attr.c:552 do_truncate+0x1d7/0x230 fs/open.c:68 vfs_truncate+0x5d6/0x6e0 fs/open.c:118 do_sys_truncate fs/open.c:141 [inline] __do_sys_truncate fs/open.c:153 [inline] __se_sys_truncate fs/open.c:151 [inline] __x64_sys_truncate+0x172/0x1e0 fs/open.c:151 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4c0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f63ad98ebe9 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:00007f63ae7fc038 EFLAGS: 00000246 ORIG_RAX: 000000000000004c RAX: ffffffffffffffda RBX: 00007f63adbb5fa0 RCX: 00007f63ad98ebe9 RDX: 0000000000000000 RSI: 000000000000041a RDI: 00002000000000c0 RBP: 00007f63ada11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f63adbb6038 R14: 00007f63adbb5fa0 R15: 00007fff7f328758 </TASK> --- This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. If the report is already addressed, let syzbot know by replying with: #syz fix: exact-commit-title If you want syzbot to run the reproducer, reply with: #syz test: git://repo/address.git branch-or-commit-hash If you attach or paste a git patch, syzbot will apply it before testing. If you want to overwrite report's subsystems, reply with: #syz set subsystems: new-subsystem (See the list of subsystem names on the web dashboard) If the report is a duplicate of another one, reply with: #syz dup: exact-subject-of-another-report If you want to undo deduplication, reply with: #syz undup