====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.0.179/7000 is trying to acquire lock: ffff88805ffc00f0 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ni_lock fs/ntfs3/ntfs_fs.h:1127 [inline] ffff88805ffc00f0 (&ni->ni_lock#3/5){+.+.}-{4:4}, at: ntfs_fallocate+0x7ca/0x10b0 fs/ntfs3/file.c:689 but task is already holding lock: ffff88805ffc0578 (mapping.invalidate_lock#8){++++}-{4:4}, at: filemap_invalidate_lock include/linux/fs.h:1082 [inline] ffff88805ffc0578 (mapping.invalidate_lock#8){++++}-{4:4}, at: ntfs_fallocate+0x3be/0x10b0 fs/ntfs3/file.c:619 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (mapping.invalidate_lock#8){++++}-{4:4}: down_read+0x97/0x1f0 kernel/locking/rwsem.c:1537 filemap_invalidate_lock_shared include/linux/fs.h:1092 [inline] filemap_fault+0x5cc/0x12b0 mm/filemap.c:3537 __do_fault+0x138/0x390 mm/memory.c:5320 do_read_fault mm/memory.c:5755 [inline] do_fault mm/memory.c:5889 [inline] do_pte_missing+0x18ca/0x27a0 mm/memory.c:4401 handle_pte_fault mm/memory.c:6273 [inline] __handle_mm_fault mm/memory.c:6411 [inline] handle_mm_fault+0xcc1/0x1330 mm/memory.c:6580 faultin_page mm/gup.c:1126 [inline] __get_user_pages+0x166e/0x2830 mm/gup.c:1428 __get_user_pages_locked mm/gup.c:1692 [inline] __gup_longterm_locked+0x123f/0x1660 mm/gup.c:2476 gup_fast_fallback+0x1c95/0x21f0 mm/gup.c:3220 iov_iter_extract_user_pages lib/iov_iter.c:1763 [inline] iov_iter_extract_pages+0x35f/0x5e0 lib/iov_iter.c:1826 dio_refill_pages fs/direct-io.c:172 [inline] dio_get_page fs/direct-io.c:213 [inline] do_direct_IO fs/direct-io.c:915 [inline] __blockdev_direct_IO+0x1038/0x31f0 fs/direct-io.c:1243 blockdev_direct_IO include/linux/fs.h:3075 [inline] ntfs_direct_IO+0x20c/0x410 fs/ntfs3/inode.c:815 generic_file_direct_write+0x1dc/0x3e0 mm/filemap.c:4248 __generic_file_write_iter+0x120/0x240 mm/filemap.c:4417 ntfs_file_write_iter+0x74b/0x870 fs/ntfs3/file.c:1318 do_iter_readv_writev+0x635/0x8d0 fs/read_write.c:-1 vfs_writev+0x323/0x970 fs/read_write.c:1057 do_pwritev fs/read_write.c:1153 [inline] __do_sys_pwritev2 fs/read_write.c:1211 [inline] __se_sys_pwritev2+0x17c/0x2a0 fs/read_write.c:1202 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&mm->mmap_lock){++++}-{4:4}: __might_fault+0xcc/0x130 mm/memory.c:7174 _inline_copy_to_user include/linux/uaccess.h:201 [inline] _copy_to_user+0x2c/0xb0 lib/usercopy.c:26 copy_to_user include/linux/uaccess.h:236 [inline] fiemap_fill_next_extent+0x1c0/0x390 fs/ioctl.c:144 ni_fiemap+0x89c/0xbf0 fs/ntfs3/frecord.c:2009 ntfs_fiemap+0x11d/0x1a0 fs/ntfs3/file.c:1419 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x1188/0x1440 fs/ioctl.c:531 __do_sys_ioctl fs/ioctl.c:595 [inline] __se_sys_ioctl+0x82/0x170 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ni->ni_lock#3/5){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a6/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x107/0x340 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:533 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:552 ni_lock fs/ntfs3/ntfs_fs.h:1127 [inline] ntfs_fallocate+0x7ca/0x10b0 fs/ntfs3/file.c:689 vfs_fallocate+0x672/0x7f0 fs/open.c:339 ksys_fallocate fs/open.c:363 [inline] __do_sys_fallocate fs/open.c:368 [inline] __se_sys_fallocate fs/open.c:366 [inline] __x64_sys_fallocate+0xc0/0x110 fs/open.c:366 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &ni->ni_lock#3/5 --> &mm->mmap_lock --> mapping.invalidate_lock#8 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(mapping.invalidate_lock#8); lock(&mm->mmap_lock); lock(mapping.invalidate_lock#8); lock(&ni->ni_lock#3/5); *** DEADLOCK *** 3 locks held by syz.0.179/7000: #0: ffff88802e988480 (sb_writers#17){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2681 [inline] #0: ffff88802e988480 (sb_writers#17){.+.+}-{0:0}, at: vfs_fallocate+0x5f9/0x7f0 fs/open.c:338 #1: ffff88805ffc03a8 (&sb->s_type->i_mutex_key#26){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #1: ffff88805ffc03a8 (&sb->s_type->i_mutex_key#26){+.+.}-{4:4}, at: ntfs_fallocate+0x2f1/0x10b0 fs/ntfs3/file.c:605 #2: ffff88805ffc0578 (mapping.invalidate_lock#8){++++}-{4:4}, at: filemap_invalidate_lock include/linux/fs.h:1082 [inline] #2: ffff88805ffc0578 (mapping.invalidate_lock#8){++++}-{4:4}, at: ntfs_fallocate+0x3be/0x10b0 fs/ntfs3/file.c:619 stack backtrace: CPU: 0 UID: 0 PID: 7000 Comm: syz.0.179 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2043 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a6/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x107/0x340 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/rtmutex_api.c:533 [inline] mutex_lock_nested+0x5a/0x1d0 kernel/locking/rtmutex_api.c:552 ni_lock fs/ntfs3/ntfs_fs.h:1127 [inline] ntfs_fallocate+0x7ca/0x10b0 fs/ntfs3/file.c:689 vfs_fallocate+0x672/0x7f0 fs/open.c:339 ksys_fallocate fs/open.c:363 [inline] __do_sys_fallocate fs/open.c:368 [inline] __se_sys_fallocate fs/open.c:366 [inline] __x64_sys_fallocate+0xc0/0x110 fs/open.c:366 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2526e0f749 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:00007f252506e038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007f2527065fa0 RCX: 00007f2526e0f749 RDX: 0000000000004000 RSI: 0000000000000008 RDI: 0000000000000004 RBP: 00007f2526e93f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000004000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2527066038 R14: 00007f2527065fa0 R15: 00007ffd7984ce78