loop2: detected capacity change from 0 to 4096 ============================================ WARNING: possible recursive locking detected 5.15.170-syzkaller #0 Not tainted -------------------------------------------- syz.2.707/6523 is trying to acquire lock: ffff888060827700 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] ffff888060827700 (&ni->ni_lock/4){+.+.}-{3:3}, at: mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148 but task is already holding lock: ffff888060821e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] ffff888060821e80 (&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.2.707/6523: #0: ffff888061400460 (sb_writers#14){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377 #1: ffff8880608203a0 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline] #1: ffff8880608203a0 (&type->i_mutex_dir_key#10/1){+.+.}-{3:3}, at: filename_create+0x25c/0x530 fs/namei.c:3835 #2: ffff888060822120 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:789 [inline] #2: ffff888060822120 (&sb->s_type->i_mutex_key#22){+.+.}-{3:3}, at: vfs_link+0x53f/0x810 fs/namei.c:4548 #3: ffff888060820100 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1105 [inline] #3: ffff888060820100 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_link+0xd5/0x280 fs/ntfs3/namei.c:147 #4: ffff888060821e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] #4: ffff888060821e80 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_link+0xf0/0x280 fs/ntfs3/namei.c:149 #5: ffff888061402120 (&wnd->rw_lock/1){+.+.}-{3:3}, at: ntfs_look_free_mft+0x1e7/0xff0 fs/ntfs3/fsntfs.c:542 stack backtrace: CPU: 1 PID: 6523 Comm: syz.2.707 Not tainted 5.15.170-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/0x2d0 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline] check_deadlock kernel/locking/lockdep.c:2989 [inline] validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 ni_lock fs/ntfs3/ntfs_fs.h:1100 [inline] mi_read+0x2dd/0x5a0 fs/ntfs3/record.c:148 mi_format_new+0x1a7/0x5c0 fs/ntfs3/record.c:374 ni_add_subrecord+0xde/0x430 fs/ntfs3/frecord.c:370 ntfs_look_free_mft+0x7f1/0xff0 fs/ntfs3/fsntfs.c:686 ni_create_attr_list+0x9b6/0x1470 fs/ntfs3/frecord.c:848 ni_ins_attr_ext+0x364/0xb30 fs/ntfs3/frecord.c:949 ni_insert_attr fs/ntfs3/frecord.c:1103 [inline] ni_insert_resident fs/ntfs3/frecord.c:1477 [inline] ni_add_name+0x689/0x9d0 fs/ntfs3/frecord.c:2983 ntfs_link_inode+0x305/0x3c0 fs/ntfs3/inode.c:1711 ntfs_link+0x112/0x280 fs/ntfs3/namei.c:154 vfs_link+0x65e/0x810 fs/namei.c:4557 do_linkat+0x5c8/0x9d0 fs/namei.c:4628 __do_sys_link fs/namei.c:4662 [inline] __se_sys_link fs/namei.c:4660 [inline] __x64_sys_link+0x82/0x90 fs/namei.c:4660 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fcdb78e4719 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:00007fcdb5d5c038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007fcdb7a9bf80 RCX: 00007fcdb78e4719 RDX: 0000000000000000 RSI: 0000000020000bc0 RDI: 0000000020001240 RBP: 00007fcdb795739e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fcdb7a9bf80 R15: 00007ffd3bf061c8