loop1: detected capacity change from 0 to 4096 ntfs3: loop1: Different NTFS sector size (2048) and media sector size (512). ====================================================== WARNING: possible circular locking dependency detected 6.6.101-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.2181/14268 is trying to acquire lock: ffff88807ddac420 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0xaa/0x120 mm/memory.c:5946 but task is already holding lock: ffff888077e42d40 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1120 [inline] ffff888077e42d40 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_fiemap+0xc8/0x130 fs/ntfs3/file.c:1211 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ni->ni_lock/5){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747 ni_lock fs/ntfs3/ntfs_fs.h:1120 [inline] ntfs_fallocate+0x898/0xfd0 fs/ntfs3/file.c:572 vfs_fallocate+0x58e/0x700 fs/open.c:324 ksys_fallocate fs/open.c:347 [inline] __do_sys_fallocate fs/open.c:355 [inline] __se_sys_fallocate fs/open.c:353 [inline] __x64_sys_fallocate+0xc1/0x110 fs/open.c:353 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (mapping.invalidate_lock#4){++++}-{3:3}: down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:859 [inline] filemap_fault+0x5db/0x15a0 mm/filemap.c:3330 __do_fault+0x13b/0x4e0 mm/memory.c:4243 do_read_fault mm/memory.c:4616 [inline] do_fault mm/memory.c:4753 [inline] do_pte_missing mm/memory.c:3688 [inline] handle_pte_fault mm/memory.c:5025 [inline] __handle_mm_fault mm/memory.c:5166 [inline] handle_mm_fault+0x3886/0x4920 mm/memory.c:5331 do_user_addr_fault+0x738/0x12e0 arch/x86/mm/fault.c:1373 handle_page_fault arch/x86/mm/fault.c:1465 [inline] exc_page_fault+0x67/0x110 arch/x86/mm/fault.c:1521 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:608 rep_movs_alternative+0x30/0x90 arch/x86/lib/copy_user_64.S:50 copy_user_generic arch/x86/include/asm/uaccess_64.h:112 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:127 [inline] _copy_from_user+0x8b/0xe0 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:183 [inline] ioctl_fiemap fs/ioctl.c:210 [inline] do_vfs_ioctl+0x3e0/0x1bb0 fs/ioctl.c:811 __do_sys_ioctl fs/ioctl.c:869 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&mm->mmap_lock){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 __might_fault+0xc6/0x120 mm/memory.c:5946 _copy_to_user+0x2a/0xa0 lib/usercopy.c:36 copy_to_user include/linux/uaccess.h:191 [inline] fiemap_fill_next_extent+0x1c1/0x390 fs/ioctl.c:145 ni_fiemap+0x7e6/0xbe0 fs/ntfs3/frecord.c:2038 ntfs_fiemap+0xdb/0x130 fs/ntfs3/file.c:1213 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x140c/0x1bb0 fs/ioctl.c:811 __do_sys_ioctl fs/ioctl.c:869 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/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: &mm->mmap_lock --> mapping.invalidate_lock#4 --> &ni->ni_lock/5 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ni->ni_lock/5); lock(mapping.invalidate_lock#4); lock(&ni->ni_lock/5); rlock(&mm->mmap_lock); *** DEADLOCK *** 1 lock held by syz.1.2181/14268: #0: ffff888077e42d40 (&ni->ni_lock/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1120 [inline] #0: ffff888077e42d40 (&ni->ni_lock/5){+.+.}-{3:3}, at: ntfs_fiemap+0xc8/0x130 fs/ntfs3/file.c:1211 stack backtrace: CPU: 0 PID: 14268 Comm: syz.1.2181 Not tainted 6.6.101-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106 check_noncircular+0x2bd/0x3c0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754 __might_fault+0xc6/0x120 mm/memory.c:5946 _copy_to_user+0x2a/0xa0 lib/usercopy.c:36 copy_to_user include/linux/uaccess.h:191 [inline] fiemap_fill_next_extent+0x1c1/0x390 fs/ioctl.c:145 ni_fiemap+0x7e6/0xbe0 fs/ntfs3/frecord.c:2038 ntfs_fiemap+0xdb/0x130 fs/ntfs3/file.c:1213 ioctl_fiemap fs/ioctl.c:220 [inline] do_vfs_ioctl+0x140c/0x1bb0 fs/ioctl.c:811 __do_sys_ioctl fs/ioctl.c:869 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4e6658eb69 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:00007f4e6742f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f4e667b5fa0 RCX: 00007f4e6658eb69 RDX: 0000200000000080 RSI: 00000000c020660b RDI: 0000000000000004 RBP: 00007f4e66611df1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4e667b5fa0 R15: 00007ffd9c647b68