ntfs3: loop5: Failed to load $Extend (-2).
ntfs3: loop5: Failed to initialize $Extend.
======================================================
WARNING: possible circular locking dependency detected
6.6.95-syzkaller #0 Not tainted
------------------------------------------------------
syz.5.415/7972 is trying to acquire lock:
ffff88805dc71b60 (mapping.invalidate_lock#4){++++}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:859 [inline]
ffff88805dc71b60 (mapping.invalidate_lock#4){++++}-{3:3}, at: filemap_fault+0x5db/0x15a0 mm/filemap.c:3330
but task is already holding lock:
ffff88807ee11e20 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline]
ffff88807ee11e20 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5358 [inline]
ffff88807ee11e20 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x300 mm/memory.c:5418
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #2 (&mm->mmap_lock){++++}-{3:3}:
__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+0x89d/0xbe0 fs/ntfs3/frecord.c:2060
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
-> #1 (&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+0x7b2/0xfd0 fs/ntfs3/file.c:554
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
-> #0 (mapping.invalidate_lock#4){++++}-{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
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
do_strncpy_from_user lib/strncpy_from_user.c:-1 [inline]
strncpy_from_user+0xff/0x2e0 lib/strncpy_from_user.c:139
getname_flags+0xf6/0x500 fs/namei.c:151
user_path_at_empty+0x2c/0x60 fs/namei.c:2908
user_path_at include/linux/namei.h:57 [inline]
path_listxattr+0xa3/0x1b0 fs/xattr.c:863
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:
mapping.invalidate_lock#4 --> &ni->ni_lock/5 --> &mm->mmap_lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
rlock(&mm->mmap_lock);
lock(&ni->ni_lock/5);
lock(&mm->mmap_lock);
rlock(mapping.invalidate_lock#4);
*** DEADLOCK ***
1 lock held by syz.5.415/7972:
#0: ffff88807ee11e20 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:165 [inline]
#0: ffff88807ee11e20 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:5358 [inline]
#0: ffff88807ee11e20 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x32/0x300 mm/memory.c:5418
stack backtrace:
CPU: 0 PID: 7972 Comm: syz.5.415 Not tainted 6.6.95-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
<TASK>
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
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
RIP: 0010:do_strncpy_from_user lib/strncpy_from_user.c:41 [inline]
RIP: 0010:strncpy_from_user+0xff/0x2e0 lib/strncpy_from_user.c:139
Code: 4c 89 ee e8 83 f7 33 fd 49 83 fd 07 0f 86 a1 00 00 00 4c 89 74 24 08 48 c7 44 24 10 f8 ff ff ff 45 31 e4 4c 89 3c 24 49 89 de <4f> 8b 3c 27 48 b8 ff fe fe fe fe fe fe fe 49 8d 1c 07 4c 89 fd 48
RSP: 0018:ffffc9000b527d90 EFLAGS: 00050246
RAX: ffffffff8451a31d RBX: ffff88801e6e2220 RCX: ffff88802bf93c00
RDX: 0000000000000002 RSI: 0000000000000fe0 RDI: 0000000000000007
RBP: 0000200000000100 R08: ffffea000079b807 R09: 1ffffd40000f3700
R10: dffffc0000000000 R11: fffff940000f3701 R12: 0000000000000000
R13: 0000000000000fe0 R14: ffff88801e6e2220 R15: 0000200000000100
getname_flags+0xf6/0x500 fs/namei.c:151
user_path_at_empty+0x2c/0x60 fs/namei.c:2908
user_path_at include/linux/namei.h:57 [inline]
path_listxattr+0xa3/0x1b0 fs/xattr.c:863
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:0x7f8de058e929
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:00007f8de14df038 EFLAGS: 00000246 ORIG_RAX: 00000000000000c3
RAX: ffffffffffffffda RBX: 00007f8de07b5fa0 RCX: 00007f8de058e929
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000100
RBP: 00007f8de0610b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f8de07b5fa0 R15: 00007ffc3bf1cc38
</TASK>
----------------
Code disassembly (best guess):
0: 4c 89 ee mov %r13,%rsi
3: e8 83 f7 33 fd call 0xfd33f78b
8: 49 83 fd 07 cmp $0x7,%r13
c: 0f 86 a1 00 00 00 jbe 0xb3
12: 4c 89 74 24 08 mov %r14,0x8(%rsp)
17: 48 c7 44 24 10 f8 ff movq $0xfffffffffffffff8,0x10(%rsp)
1e: ff ff
20: 45 31 e4 xor %r12d,%r12d
23: 4c 89 3c 24 mov %r15,(%rsp)
27: 49 89 de mov %rbx,%r14
* 2a: 4f 8b 3c 27 mov (%r15,%r12,1),%r15 <-- trapping instruction
2e: 48 b8 ff fe fe fe fe movabs $0xfefefefefefefeff,%rax
35: fe fe fe
38: 49 8d 1c 07 lea (%r15,%rax,1),%rbx
3c: 4c 89 fd mov %r15,%rbp
3f: 48 rex.W