loop0: detected capacity change from 0 to 4096 ============================================ WARNING: possible recursive locking detected 6.15.0-rc1-syzkaller-00065-g3b07108ada81 #0 Not tainted -------------------------------------------- syz.0.0/5328 is trying to acquire lock: ffff8880449a9e60 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] ffff8880449a9e60 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 but task is already holding lock: ffff8880449aef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] ffff8880449aef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ntfs_link+0xf4/0x270 fs/ntfs3/namei.c:141 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ni->ni_lock#3/5); lock(&ni->ni_lock#3/5); *** DEADLOCK *** May be due to missing lock nesting notation 6 locks held by syz.0.0/5328: #0: ffff8880339b4420 (sb_writers#12){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:556 #1: ffff8880449aea68 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:902 [inline] #1: ffff8880449aea68 (&type->i_mutex_dir_key#8/1){+.+.}-{4:4}, at: filename_create+0x266/0x490 fs/namei.c:4097 #2: ffff8880449af1c0 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] #2: ffff8880449af1c0 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: vfs_link+0x3b2/0x6e0 fs/namei.c:4803 #3: ffff8880449ae7d0 (&ni->ni_lock/6){+.+.}-{4:4}, at: ni_lock_dir fs/ntfs3/ntfs_fs.h:1110 [inline] #3: ffff8880449ae7d0 (&ni->ni_lock/6){+.+.}-{4:4}, at: ntfs_link+0xd9/0x270 fs/ntfs3/namei.c:139 #4: ffff8880449aef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] #4: ffff8880449aef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ntfs_link+0xf4/0x270 fs/ntfs3/namei.c:141 #5: ffff8880368d8128 (&wnd->rw_lock/1){+.+.}-{4:4}, at: ntfs_look_free_mft+0x1f4/0x10e0 fs/ntfs3/fsntfs.c:571 stack backtrace: CPU: 0 UID: 0 PID: 5328 Comm: syz.0.0 Not tainted 6.15.0-rc1-syzkaller-00065-g3b07108ada81 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x2be/0x2d0 kernel/locking/lockdep.c:3042 check_deadlock kernel/locking/lockdep.c:3094 [inline] validate_chain+0x928/0x24e0 kernel/locking/lockdep.c:3896 __lock_acquire+0xad5/0xd80 kernel/locking/lockdep.c:5235 lock_acquire+0x116/0x2f0 kernel/locking/lockdep.c:5866 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x1a5/0x10c0 kernel/locking/mutex.c:746 ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 mi_format_new+0x1a6/0x600 fs/ntfs3/record.c:434 ni_add_subrecord+0xe2/0x430 fs/ntfs3/frecord.c:321 ntfs_look_free_mft+0x881/0x10e0 fs/ntfs3/fsntfs.c:715 ni_create_attr_list+0xa3e/0x1650 fs/ntfs3/frecord.c:826 ni_ins_attr_ext+0x48d/0xd50 fs/ntfs3/frecord.c:924 ni_insert_attr fs/ntfs3/frecord.c:1091 [inline] ni_insert_resident fs/ntfs3/frecord.c:1475 [inline] ni_add_name+0x807/0xe70 fs/ntfs3/frecord.c:2987 ntfs_link_inode+0x130/0x170 fs/ntfs3/inode.c:1698 ntfs_link+0x116/0x270 fs/ntfs3/namei.c:146 vfs_link+0x4f0/0x6e0 fs/namei.c:4812 do_linkat+0x55b/0x700 fs/namei.c:4882 __do_sys_link fs/namei.c:4916 [inline] __se_sys_link fs/namei.c:4914 [inline] __x64_sys_link+0x82/0x90 fs/namei.c:4914 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2b8cd8d169 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:00007f2b8db81038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007f2b8cfa5fa0 RCX: 00007f2b8cd8d169 RDX: 0000000000000000 RSI: 0000200000000bc0 RDI: 0000200000001240 RBP: 00007f2b8ce0e730 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2b8cfa5fa0 R15: 00007ffd754e4c78