loop4: detected capacity change from 0 to 4096 ====================================================== WARNING: possible circular locking dependency detected 6.1.112-syzkaller #0 Not tainted ------------------------------------------------------ syz.4.684/6569 is trying to acquire lock: ffff888057ea60e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1101 [inline] ffff888057ea60e0 (&ni->ni_lock/4){+.+.}-{3:3}, at: ntfs_fallocate+0x7e9/0x1020 fs/ntfs3/file.c:663 but task is already holding lock: ffff888057ea6520 (mapping.invalidate_lock#5){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:803 [inline] ffff888057ea6520 (mapping.invalidate_lock#5){++++}-{3:3}, at: ntfs_fallocate+0x33e/0x1020 fs/ntfs3/file.c:580 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (mapping.invalidate_lock#5){++++}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 down_read+0xad/0xa30 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] filemap_fault+0x640/0x17e0 mm/filemap.c:3191 __do_fault+0x136/0x4f0 mm/memory.c:4278 do_read_fault mm/memory.c:4629 [inline] do_fault mm/memory.c:4758 [inline] handle_pte_fault mm/memory.c:5029 [inline] __handle_mm_fault mm/memory.c:5171 [inline] handle_mm_fault+0x3410/0x5340 mm/memory.c:5292 do_user_addr_fault arch/x86/mm/fault.c:1340 [inline] handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x26f/0x620 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 strncpy_from_user+0x159/0x360 lib/strncpy_from_user.c:139 getname_flags+0xf5/0x4f0 fs/namei.c:150 do_sys_openat2+0xd2/0x4f0 fs/open.c:1312 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1345 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 -> #1 (&mm->mmap_lock){++++}-{3:3}: lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662 __might_fault+0xbd/0x110 mm/memory.c:5851 _copy_to_user+0x26/0x130 lib/usercopy.c:36 copy_to_user include/linux/uaccess.h:169 [inline] ni_fiemap+0x5b0/0x1900 fs/ntfs3/frecord.c:2141 ntfs_fiemap+0x12e/0x170 fs/ntfs3/file.c:1244 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x18e9/0x2a90 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl+0x81/0x160 fs/ioctl.c:856 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 -> #0 (&ni->ni_lock/4){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __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] ntfs_fallocate+0x7e9/0x1020 fs/ntfs3/file.c:663 vfs_fallocate+0x547/0x6b0 fs/open.c:323 ksys_fallocate fs/open.c:346 [inline] __do_sys_fallocate fs/open.c:354 [inline] __se_sys_fallocate fs/open.c:352 [inline] __x64_sys_fallocate+0xb9/0x100 fs/open.c:352 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 other info that might help us debug this: Chain exists of: &ni->ni_lock/4 --> &mm->mmap_lock --> mapping.invalidate_lock#5 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(mapping.invalidate_lock#5); lock(&mm->mmap_lock); lock(mapping.invalidate_lock#5); lock(&ni->ni_lock/4); *** DEADLOCK *** 3 locks held by syz.4.684/6569: #0: ffff88802ef1c460 (sb_writers#20){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3015 [inline] #0: ffff88802ef1c460 (sb_writers#20){.+.+}-{0:0}, at: vfs_fallocate+0x4ba/0x6b0 fs/open.c:322 #1: ffff888057ea6380 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff888057ea6380 (&sb->s_type->i_mutex_key#27){+.+.}-{3:3}, at: ntfs_fallocate+0x2a0/0x1020 fs/ntfs3/file.c:566 #2: ffff888057ea6520 (mapping.invalidate_lock#5){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:803 [inline] #2: ffff888057ea6520 (mapping.invalidate_lock#5){++++}-{3:3}, at: ntfs_fallocate+0x33e/0x1020 fs/ntfs3/file.c:580 stack backtrace: CPU: 0 PID: 6569 Comm: syz.4.684 Not tainted 6.1.112-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 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain+0x1661/0x5950 kernel/locking/lockdep.c:3825 __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] ntfs_fallocate+0x7e9/0x1020 fs/ntfs3/file.c:663 vfs_fallocate+0x547/0x6b0 fs/open.c:323 ksys_fallocate fs/open.c:346 [inline] __do_sys_fallocate fs/open.c:354 [inline] __se_sys_fallocate fs/open.c:352 [inline] __x64_sys_fallocate+0xb9/0x100 fs/open.c:352 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:0x7fa5f437dff9 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:00007fa5f51a4038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007fa5f4535f80 RCX: 00007fa5f437dff9 RDX: 0000000000000c00 RSI: 0000000000000020 RDI: 0000000000000005 RBP: 00007fa5f43f0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000008000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fa5f4535f80 R15: 00007fffd44bd518