loop0: detected capacity change from 0 to 4096 ============================================ WARNING: possible recursive locking detected 6.14.0-syzkaller-12886-ga1b5bd45d4ee #0 Not tainted -------------------------------------------- syz.0.0/5334 is trying to acquire lock: ffff888044679e60 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] ffff888044679e60 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: mi_read+0x2e1/0x5a0 fs/ntfs3/record.c:148 but task is already holding lock: ffff88804467ef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] ffff88804467ef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ntfs_fallocate+0x79e/0x1310 fs/ntfs3/file.c:714 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 5 locks held by syz.0.0/5334: #0: ffff888033da4420 (sb_writers#12){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3041 [inline] #0: ffff888033da4420 (sb_writers#12){.+.+}-{0:0}, at: vfs_fallocate+0x5a1/0x7a0 fs/open.c:337 #1: ffff88804467f1c0 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:867 [inline] #1: ffff88804467f1c0 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: ntfs_fallocate+0x303/0x1310 fs/ntfs3/file.c:601 #2: ffff88804467ef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1105 [inline] #2: ffff88804467ef28 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ntfs_fallocate+0x79e/0x1310 fs/ntfs3/file.c:714 #3: ffff88804467efd8 (&ni->file.run_lock#3){+.+.}-{4:4}, at: attr_force_nonresident+0x184/0x270 fs/ntfs3/attrib.c:2600 #4: ffff888033da2128 (&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: 5334 Comm: syz.0.0 Not tainted 6.14.0-syzkaller-12886-ga1b5bd45d4ee #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+0x34c/0x920 fs/ntfs3/frecord.c:1091 ni_insert_nonresident+0x2a1/0x7c0 fs/ntfs3/frecord.c:1426 attr_make_nonresident+0x65f/0xd40 fs/ntfs3/attrib.c:317 attr_force_nonresident+0x1e2/0x270 fs/ntfs3/attrib.c:2601 ntfs_fallocate+0x7a8/0x1310 fs/ntfs3/file.c:715 vfs_fallocate+0x627/0x7a0 fs/open.c:338 ksys_fallocate fs/open.c:362 [inline] __do_sys_fallocate fs/open.c:367 [inline] __se_sys_fallocate fs/open.c:365 [inline] __x64_sys_fallocate+0xbc/0x110 fs/open.c:365 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:0x7f65b2d8d169 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:00007f65b3bff038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007f65b2fa5fa0 RCX: 00007f65b2d8d169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f65b2e0e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000001000f4 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f65b2fa5fa0 R15: 00007ffc9e8c6a38