loop3: detected capacity change from 0 to 4096 ============================================ WARNING: possible recursive locking detected 6.1.115-syzkaller #0 Not tainted -------------------------------------------- syz.3.781/7601 is trying to acquire lock: ffff888058252d40 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1101 [inline] ffff888058252d40 (&ni->ni_lock/4){+.+.}-{3:3}, at: mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148 but task is already holding lock: ffff888058251720 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1101 [inline] ffff888058251720 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_link+0xf0/0x280 fs/ntfs3/namei.c:149 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ni->ni_lock/4); lock(&ni->ni_lock/4); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.3.781/7601: #0: ffff888051d04460 (sb_writers#18){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393 #1: ffff888058251260 (&type->i_mutex_dir_key#11/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:793 [inline] #1: ffff888058251260 (&type->i_mutex_dir_key#11/1){+.+.}-{3:3}, at: filename_create+0x25c/0x530 fs/namei.c:3876 #2: ffff8880582519c0 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #2: ffff8880582519c0 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: vfs_link+0x53f/0x810 fs/namei.c:4590 #3: ffff888058250fc0 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1106 [inline] #3: ffff888058250fc0 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_link+0xd5/0x280 fs/ntfs3/namei.c:147 #4: ffff888058251720 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1101 [inline] #4: ffff888058251720 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_link+0xf0/0x280 fs/ntfs3/namei.c:149 #5: ffff888051d02120 (&wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_look_free_mft+0x1e1/0x10c0 fs/ntfs3/fsntfs.c:542 stack backtrace: CPU: 0 PID: 7601 Comm: syz.3.781 Not tainted 6.1.115-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2983 [inline] check_deadlock kernel/locking/lockdep.c:3026 [inline] validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x132/0xd80 kernel/locking/mutex.c:747 ni_lock fs/ntfs3/ntfs_fs.h:1101 [inline] mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148 mi_format_new+0x1a7/0x5c0 fs/ntfs3/record.c:415 ni_add_subrecord+0xde/0x430 fs/ntfs3/frecord.c:371 ntfs_look_free_mft+0x874/0x10c0 fs/ntfs3/fsntfs.c:686 ni_create_attr_list+0x9b6/0x1470 fs/ntfs3/frecord.c:873 ni_ins_attr_ext+0x330/0xbf0 fs/ntfs3/frecord.c:974 ni_insert_attr fs/ntfs3/frecord.c:1141 [inline] ni_insert_resident fs/ntfs3/frecord.c:1525 [inline] ni_add_name+0x619/0xc30 fs/ntfs3/frecord.c:3103 ntfs_link_inode+0x12c/0x170 fs/ntfs3/inode.c:1695 ntfs_link+0x112/0x280 fs/ntfs3/namei.c:154 vfs_link+0x65e/0x810 fs/namei.c:4599 do_linkat+0x352/0x750 fs/namei.c:4670 __do_sys_link fs/namei.c:4704 [inline] __se_sys_link fs/namei.c:4702 [inline] __x64_sys_link+0x82/0x90 fs/namei.c:4702 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fa914b7e719 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:00007fa9158f7038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007fa914d35f80 RCX: 00007fa914b7e719 RDX: 0000000000000000 RSI: 0000000020000bc0 RDI: 0000000020001240 RBP: 00007fa914bf139e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fa914d35f80 R15: 00007ffefc621b38