====================================================== WARNING: possible circular locking dependency detected 6.1.140-syzkaller #0 Not tainted ------------------------------------------------------ syz.1.2722/16964 is trying to acquire lock: ffff88805c451b60 (mapping.invalidate_lock#12){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] ffff88805c451b60 (mapping.invalidate_lock#12){++++}-{3:3}, at: filemap_fault+0x53c/0x1670 mm/filemap.c:3220 but task is already holding lock: ffff88803082ae58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] ffff88803082ae58 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5322 [inline] ffff88803082ae58 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2f0 mm/memory.c:5384 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&mm->mmap_lock){++++}-{3:3}: __might_fault+0xc2/0x120 mm/memory.c:5852 _copy_to_user+0x27/0x130 lib/usercopy.c:36 copy_to_user include/linux/uaccess.h:169 [inline] ni_fiemap+0x4ec/0x1300 fs/ntfs3/frecord.c:2140 ntfs_fiemap+0xd7/0x130 fs/ntfs3/file.c:1170 ioctl_fiemap fs/ioctl.c:219 [inline] do_vfs_ioctl+0x1425/0x1d10 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&ni->ni_lock/5){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x120/0xaf0 kernel/locking/mutex.c:747 ni_lock fs/ntfs3/ntfs_fs.h:1102 [inline] ntfs_fallocate+0x71d/0xf20 fs/ntfs3/file.c:567 vfs_fallocate+0x584/0x6f0 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+0xbd/0x100 fs/open.c:352 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (mapping.invalidate_lock#12){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] filemap_fault+0x53c/0x1670 mm/filemap.c:3220 __do_fault+0x13b/0x4e0 mm/memory.c:4280 do_read_fault mm/memory.c:4631 [inline] do_fault mm/memory.c:4760 [inline] handle_pte_fault mm/memory.c:5031 [inline] __handle_mm_fault mm/memory.c:5173 [inline] handle_mm_fault+0x28ca/0x3e70 mm/memory.c:5294 do_user_addr_fault+0x51f/0xb10 arch/x86/mm/fault.c:1340 handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 copy_user_short_string+0xa/0x40 arch/x86/lib/copy_user_64.S:231 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:52 [inline] _copy_from_user+0xf4/0x170 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:161 [inline] ioctl_fiemap fs/ioctl.c:209 [inline] do_vfs_ioctl+0x5c3/0x1d10 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Chain exists of: mapping.invalidate_lock#12 --> &ni->ni_lock/5 --> &mm->mmap_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock); lock(&ni->ni_lock/5); lock(&mm->mmap_lock); lock(mapping.invalidate_lock#12); *** DEADLOCK *** 1 lock held by syz.1.2722/16964: #0: ffff88803082ae58 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline] #0: ffff88803082ae58 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5322 [inline] #0: ffff88803082ae58 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x2e/0x2f0 mm/memory.c:5384 stack backtrace: CPU: 0 PID: 16964 Comm: syz.1.2722 Not tainted 6.1.140-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 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 kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:813 [inline] filemap_fault+0x53c/0x1670 mm/filemap.c:3220 __do_fault+0x13b/0x4e0 mm/memory.c:4280 do_read_fault mm/memory.c:4631 [inline] do_fault mm/memory.c:4760 [inline] handle_pte_fault mm/memory.c:5031 [inline] __handle_mm_fault mm/memory.c:5173 [inline] handle_mm_fault+0x28ca/0x3e70 mm/memory.c:5294 do_user_addr_fault+0x51f/0xb10 arch/x86/mm/fault.c:1340 handle_page_fault arch/x86/mm/fault.c:1431 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0010:copy_user_short_string+0xa/0x40 arch/x86/lib/copy_user_64.S:232 Code: 83 f8 12 74 0a 89 d1 f3 a4 89 c8 0f 01 ca c3 89 d0 0f 01 ca c3 01 ca eb e7 90 90 90 90 90 90 90 89 d1 83 e2 07 c1 e9 03 74 12 <4c> 8b 06 4c 89 07 48 8d 76 08 48 8d 7f 08 ff c9 75 ee 21 d2 74 10 RSP: 0018:ffffc90010657a88 EFLAGS: 00050202 RAX: ffffffff8407b401 RBX: 0000000000000020 RCX: 0000000000000004 RDX: 0000000000000000 RSI: 0000200000000080 RDI: ffffc90010657dd0 RBP: 0000000000000000 R08: dffffc0000000000 R09: fffff520020cafbe R10: fffff520020cafbe R11: 1ffff920020cafba R12: 00007fffffffefe0 R13: 1ffff920020caf5c R14: ffffc90010657dd0 R15: 0000200000000080 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_from_user arch/x86/include/asm/uaccess_64.h:52 [inline] _copy_from_user+0xf4/0x170 lib/usercopy.c:23 copy_from_user include/linux/uaccess.h:161 [inline] ioctl_fiemap fs/ioctl.c:209 [inline] do_vfs_ioctl+0x5c3/0x1d10 fs/ioctl.c:810 __do_sys_ioctl fs/ioctl.c:868 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f4314d8e969 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:00007f4315ba3038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f4314fb6080 RCX: 00007f4314d8e969 RDX: 0000200000000080 RSI: 00000000c020660b RDI: 0000000000000005 RBP: 00007f4314e10ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4314fb6080 R15: 00007ffcaeb918d8 usbtmc 2-1:16.0: usb_control_msg returned -32 ---------------- Code disassembly (best guess): 0: 83 f8 12 cmp $0x12,%eax 3: 74 0a je 0xf 5: 89 d1 mov %edx,%ecx 7: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 9: 89 c8 mov %ecx,%eax b: 0f 01 ca clac e: c3 ret f: 89 d0 mov %edx,%eax 11: 0f 01 ca clac 14: c3 ret 15: 01 ca add %ecx,%edx 17: eb e7 jmp 0x0 19: 90 nop 1a: 90 nop 1b: 90 nop 1c: 90 nop 1d: 90 nop 1e: 90 nop 1f: 90 nop 20: 89 d1 mov %edx,%ecx 22: 83 e2 07 and $0x7,%edx 25: c1 e9 03 shr $0x3,%ecx 28: 74 12 je 0x3c * 2a: 4c 8b 06 mov (%rsi),%r8 <-- trapping instruction 2d: 4c 89 07 mov %r8,(%rdi) 30: 48 8d 76 08 lea 0x8(%rsi),%rsi 34: 48 8d 7f 08 lea 0x8(%rdi),%rdi 38: ff c9 dec %ecx 3a: 75 ee jne 0x2a 3c: 21 d2 and %edx,%edx 3e: 74 10 je 0x50