loop0: detected capacity change from 0 to 4096 ntfs3(loop0): Mark volume as dirty due to NTFS errors ntfs3(loop0): Failed to load $Extend (-22). ntfs3(loop0): Failed to initialize $Extend. ============================================ WARNING: possible recursive locking detected 6.13.0-rc7-syzkaller #0 Not tainted -------------------------------------------- syz.0.16/6577 is trying to acquire lock: ffff88805f530100 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline] ffff88805f530100 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 but task is already holding lock: ffff88805f533bc0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline] ffff88805f533bc0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ntfs_rename+0x74a/0xd10 fs/ntfs3/namei.c:312 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ni->ni_lock#2/5); lock(&ni->ni_lock#2/5); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.0.16/6577: #0: ffff888033222420 (sb_writers#13){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:516 #1: ffff88805f533700 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:853 [inline] #1: ffff88805f533700 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: lock_rename fs/namei.c:3215 [inline] #1: ffff88805f533700 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: do_renameat2+0x62c/0x13f0 fs/namei.c:5159 #2: ffff88805f533e58 (&sb->s_type->i_mutex_key#21/4){+.+.}-{4:4}, at: vfs_rename+0x6a2/0xf00 fs/namei.c:5038 #3: ffff88805f533468 (&ni->ni_lock#2/6){+.+.}-{4:4}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1115 [inline] #3: ffff88805f533468 (&ni->ni_lock#2/6){+.+.}-{4:4}, at: ntfs_rename+0x72f/0xd10 fs/ntfs3/namei.c:311 #4: ffff88805f533bc0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline] #4: ffff88805f533bc0 (&ni->ni_lock#2/5){+.+.}-{4:4}, at: ntfs_rename+0x74a/0xd10 fs/ntfs3/namei.c:312 #5: ffff888033224128 (&wnd->rw_lock/1){+.+.}-{4:4}, at: ntfs_look_free_mft+0x1e5/0x10c0 fs/ntfs3/fsntfs.c:571 stack backtrace: CPU: 0 UID: 0 PID: 6577 Comm: syz.0.16 Not tainted 6.13.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x476/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain kernel/locking/lockdep.c:3891 [inline] __lock_acquire+0x60db/0x81c0 kernel/locking/lockdep.c:5226 lock_acquire+0x1ed/0x540 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735 ni_lock fs/ntfs3/ntfs_fs.h:1110 [inline] mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 mi_format_new+0x1ab/0x5d0 fs/ntfs3/record.c:429 ni_add_subrecord+0xe2/0x430 fs/ntfs3/frecord.c:374 ntfs_look_free_mft+0x878/0x10c0 fs/ntfs3/fsntfs.c:715 ni_create_attr_list+0x9bd/0x1480 fs/ntfs3/frecord.c:878 ni_ins_attr_ext+0x369/0xbe0 fs/ntfs3/frecord.c:976 ni_insert_attr fs/ntfs3/frecord.c:1143 [inline] ni_insert_resident fs/ntfs3/frecord.c:1527 [inline] ni_add_name+0x809/0xe90 fs/ntfs3/frecord.c:3038 ni_rename+0xc2/0x1e0 fs/ntfs3/frecord.c:3078 ntfs_rename+0x7c1/0xd10 fs/ntfs3/namei.c:317 vfs_rename+0xbdb/0xf00 fs/namei.c:5067 do_renameat2+0xd94/0x13f0 fs/namei.c:5224 __do_sys_rename fs/namei.c:5271 [inline] __se_sys_rename fs/namei.c:5269 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5269 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x82/0x160 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7ff8bf785d29 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:00007ff8c05b1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007ff8bf975fa0 RCX: 00007ff8bf785d29 RDX: 0000000000000000 RSI: 0000000020000480 RDI: 0000000020000340 RBP: 00007ff8bf801b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff8bf975fa0 R15: 00007ffe13c89668