syzbot


possible deadlock in ntfs_fallocate (2)

Status: upstream: reported on 2026/03/26 14:11
Reported-by: syzbot+6ceeede1c3d0a74e5a6f@syzkaller.appspotmail.com
First crash: 2d17h, last: 2d17h
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ntfs_fallocate ntfs3 4 C error error 522 41d 1205d 0/29 upstream: reported C repro on 2022/12/09 08:57
linux-6.1 possible deadlock in ntfs_fallocate origin:lts-only 4 C inconclusive 59 89d 857d 0/3 upstream: reported C repro on 2023/11/22 18:34
linux-6.6 possible deadlock in ntfs_fallocate 4 2 141d 239d 0/2 auto-obsoleted due to no activity on 2026/02/16 00:08

Sample crash report:
loop0: detected capacity change from 0 to 4096
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.328/6952 is trying to acquire lock:
ffff88805d5a0860 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ni_lock fs/ntfs3/ntfs_fs.h:1120 [inline]
ffff88805d5a0860 (&ni->ni_lock#3/5){+.+.}-{3:3}, at: ntfs_fallocate+0x7a7/0x1040 fs/ntfs3/file.c:557

but task is already holding lock:
ffff88805d5a0ca0 (mapping.invalidate_lock#3){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:849 [inline]
ffff88805d5a0ca0 (mapping.invalidate_lock#3){++++}-{3:3}, at: ntfs_fallocate+0x3bf/0x1040 fs/ntfs3/file.c:487

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (mapping.invalidate_lock#3){++++}-{3:3}:
       down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
       filemap_invalidate_lock_shared include/linux/fs.h:859 [inline]
       filemap_fault+0x616/0x15b0 mm/filemap.c:3330
       __do_fault+0x13b/0x4d0 mm/memory.c:4244
       do_read_fault mm/memory.c:4638 [inline]
       do_fault mm/memory.c:4775 [inline]
       do_pte_missing mm/memory.c:3689 [inline]
       handle_pte_fault mm/memory.c:5047 [inline]
       __handle_mm_fault mm/memory.c:5188 [inline]
       handle_mm_fault+0x2299/0x4c00 mm/memory.c:5353
       do_user_addr_fault+0x730/0x12c0 arch/x86/mm/fault.c:1371
       handle_page_fault arch/x86/mm/fault.c:1463 [inline]
       exc_page_fault+0x64/0x100 arch/x86/mm/fault.c:1516
       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/0x2d0 lib/strncpy_from_user.c:139
       getname_flags+0xf6/0x500 fs/namei.c:151
       getname fs/namei.c:219 [inline]
       __do_sys_mkdirat fs/namei.c:4159 [inline]
       __se_sys_mkdirat fs/namei.c:4157 [inline]
       __x64_sys_mkdirat+0x7c/0xa0 fs/namei.c:4157
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #1 (&mm->mmap_lock){++++}-{3:3}:
       __might_fault+0xc6/0x120 mm/memory.c:5968
       _copy_to_user+0x2a/0xa0 lib/usercopy.c:36
       copy_to_user include/linux/uaccess.h:191 [inline]
       fiemap_fill_next_extent+0x1de/0x3b0 fs/ioctl.c:145
       ni_fiemap+0x3c3/0xca0 fs/ntfs3/frecord.c:1950
       ntfs_fiemap+0xdb/0x130 fs/ntfs3/file.c:1220
       ioctl_fiemap fs/ioctl.c:220 [inline]
       do_vfs_ioctl+0x1505/0x1cc0 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:46 [inline]
       do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&ni->ni_lock#3/5){+.+.}-{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+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x136/0xcc0 kernel/locking/mutex.c:747
       ni_lock fs/ntfs3/ntfs_fs.h:1120 [inline]
       ntfs_fallocate+0x7a7/0x1040 fs/ntfs3/file.c:557
       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:46 [inline]
       do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  &ni->ni_lock#3/5 --> &mm->mmap_lock --> mapping.invalidate_lock#3

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(mapping.invalidate_lock#3);
                               lock(&mm->mmap_lock);
                               lock(mapping.invalidate_lock#3);
  lock(&ni->ni_lock#3/5);

 *** DEADLOCK ***

3 locks held by syz.0.328/6952:
 #0: ffff8880774d8418 (sb_writers#14){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2711 [inline]
 #0: ffff8880774d8418 (sb_writers#14){.+.+}-{0:0}, at: vfs_fallocate+0x4fb/0x700 fs/open.c:323
 #1: ffff88805d5a0b10 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #1: ffff88805d5a0b10 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: ntfs_fallocate+0x2fb/0x1040 fs/ntfs3/file.c:473
 #2: ffff88805d5a0ca0 (mapping.invalidate_lock#3){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:849 [inline]
 #2: ffff88805d5a0ca0 (mapping.invalidate_lock#3){++++}-{3:3}, at: ntfs_fallocate+0x3bf/0x1040 fs/ntfs3/file.c:487

stack backtrace:
CPU: 0 PID: 6952 Comm: syz.0.328 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 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+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
 __mutex_lock_common kernel/locking/mutex.c:603 [inline]
 __mutex_lock+0x136/0xcc0 kernel/locking/mutex.c:747
 ni_lock fs/ntfs3/ntfs_fs.h:1120 [inline]
 ntfs_fallocate+0x7a7/0x1040 fs/ntfs3/file.c:557
 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:46 [inline]
 do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f151b59c799
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f151c3fd028 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007f151b815fa0 RCX: 00007f151b59c799
RDX: 0000000000004000 RSI: 0000000000000008 RDI: 0000000000000004
RBP: 00007f151b632c99 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000010000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f151b816038 R14: 00007f151b815fa0 R15: 00007ffda6ca5908
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/03/26 14:11 linux-6.6.y c09fbcd31ae6 766b6434 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ntfs_fallocate
* Struck through repros no longer work on HEAD.