possible deadlock in map_mft_record (2)

Status: upstream: reported on 2026/04/13 05:09
Reported-by: syzbot+089fbfd4971b484153cd@syzkaller.appspotmail.com
First crash: 108d, last: 20d
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in map_mft_record 4 13 850d 1226d 0/3 auto-obsoleted due to no activity on 2024/07/09 13:58
linux-6.1 possible deadlock in map_mft_record (2) 4 17 173d 683d 0/3 auto-obsoleted due to no activity on 2026/05/18 01:31
upstream possible deadlock in map_mft_record ntfs3 4 syz, C error done 845 911d 1380d 25/29 fixed on 2024/03/20 11:33
linux-4.14 possible deadlock in map_mft_record ntfs 4 syz, C 5 1259d 1353d 0/1 upstream: reported C repro on 2022/11/15 01:41
upstream possible deadlock in map_mft_record (2) fs 4 1 846d 842d 0/29 auto-obsoleted due to no activity on 2024/07/04 04:55
linux-6.6 possible deadlock in map_mft_record (2) 4 2 30d 124d 0/2 upstream: reported on 2026/03/28 01:29
linux-6.1 possible deadlock in map_mft_record (3) 4 1 22d 22d 0/3 upstream: reported on 2026/07/07 14:09
linux-5.15 possible deadlock in map_mft_record 4 52 255d 1230d 0/3 auto-obsoleted due to no activity on 2026/02/24 09:06
linux-4.19 possible deadlock in map_mft_record ntfs 4 syz, C error 11 1277d 1389d 0/1 upstream: reported C repro on 2022/10/09 19:52
linux-6.6 possible deadlock in map_mft_record 4 1 227d 227d 0/2 auto-obsoleted due to no activity on 2026/03/24 19:46

Sample crash report:
ntfs: (device loop0): load_and_init_upcase(): Failed to load $UpCase from the volume. Using default.
ntfs: volume version 3.1.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.8445/22446 is trying to acquire lock:
ffff88805d0789d0 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x4e/0x5f0 fs/ntfs/mft.c:154

but task is already holding lock:
ffff88805d078940 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x213/0x2760 fs/ntfs/inode.c:2378

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&rl->lock){++++}-{3:3}:
       down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
       ntfs_read_block fs/ntfs/aops.c:248 [inline]
       ntfs_readpage+0x1267/0x2140 fs/ntfs/aops.c:435
       do_read_cache_page+0x882/0x1010 mm/filemap.c:-1
       read_mapping_page include/linux/pagemap.h:515 [inline]
       ntfs_map_page+0x24/0x390 fs/ntfs/aops.h:75
       ntfs_sync_mft_mirror+0x251/0x1990 fs/ntfs/mft.c:480
       write_mft_record_nolock+0x13be/0x16e0 fs/ntfs/mft.c:805
       write_mft_record fs/ntfs/mft.h:95 [inline]
       __ntfs_write_inode+0x79c/0xda0 fs/ntfs/inode.c:3050
       ntfs_commit_inode fs/ntfs/inode.h:300 [inline]
       ntfs_put_super+0x94/0x1050 fs/ntfs/super.c:2260
       generic_shutdown_super+0x130/0x300 fs/super.c:475
       kill_block_super+0x7c/0xe0 fs/super.c:1427
       deactivate_locked_super+0x93/0xf0 fs/super.c:335
       cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148
       task_work_run+0x125/0x1a0 kernel/task_work.c:188
       tracehook_notify_resume include/linux/tracehook.h:189 [inline]
       exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
       exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
       __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
       syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
       do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&ni->mrec_lock){+.+.}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
       lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       map_mft_record+0x4e/0x5f0 fs/ntfs/mft.c:154
       ntfs_truncate+0x286/0x2760 fs/ntfs/inode.c:2383
       ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline]
       ntfs_setattr+0x2b6/0x390 fs/ntfs/inode.c:2914
       notify_change+0xbc6/0xee0 fs/attr.c:505
       do_truncate+0x1ac/0x240 fs/open.c:65
       handle_truncate fs/namei.c:3273 [inline]
       do_open fs/namei.c:3620 [inline]
       path_openat+0x293b/0x2fb0 fs/namei.c:3750
       do_filp_open+0x1df/0x400 fs/namei.c:3777
       do_sys_openat2+0x14b/0x500 fs/open.c:1255
       do_sys_open fs/open.c:1271 [inline]
       __do_sys_openat fs/open.c:1287 [inline]
       __se_sys_openat fs/open.c:1282 [inline]
       __x64_sys_openat+0x135/0x160 fs/open.c:1282
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&rl->lock);
                               lock(&ni->mrec_lock);
                               lock(&rl->lock);
  lock(&ni->mrec_lock);

 *** DEADLOCK ***

3 locks held by syz.0.8445/22446:
 #0: ffff8880772c6460 (sb_writers#27){.+.+}-{0:0}, at: mnt_want_write+0x3d/0x90 fs/namespace.c:386
 #1: ffff88805d078cb0 (&sb->s_type->i_mutex_key#38){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff88805d078cb0 (&sb->s_type->i_mutex_key#38){+.+.}-{3:3}, at: do_truncate+0x198/0x240 fs/open.c:63
 #2: ffff88805d078940 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x213/0x2760 fs/ntfs/inode.c:2378

stack backtrace:
CPU: 0 PID: 22446 Comm: syz.0.8445 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012
 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 map_mft_record+0x4e/0x5f0 fs/ntfs/mft.c:154
 ntfs_truncate+0x286/0x2760 fs/ntfs/inode.c:2383
 ntfs_truncate_vfs fs/ntfs/inode.c:2862 [inline]
 ntfs_setattr+0x2b6/0x390 fs/ntfs/inode.c:2914
 notify_change+0xbc6/0xee0 fs/attr.c:505
 do_truncate+0x1ac/0x240 fs/open.c:65
 handle_truncate fs/namei.c:3273 [inline]
 do_open fs/namei.c:3620 [inline]
 path_openat+0x293b/0x2fb0 fs/namei.c:3750
 do_filp_open+0x1df/0x400 fs/namei.c:3777
 do_sys_openat2+0x14b/0x500 fs/open.c:1255
 do_sys_open fs/open.c:1271 [inline]
 __do_sys_openat fs/open.c:1287 [inline]
 __se_sys_openat fs/open.c:1282 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1282
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f44b8d6ce59
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:00007f44b6fc5028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f44b8ff4fa0 RCX: 00007f44b8d6ce59
RDX: 0000000000183b41 RSI: 00002000000004c0 RDI: ffffffffffffff9c
RBP: 00007f44b8e02e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f44b8ff5038 R14: 00007f44b8ff4fa0 R15: 00007fff734002d8
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/09 12:15 linux-5.15.y c86c4726e7f0 a0c310a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in map_mft_record
2026/04/13 05:08 linux-5.15.y 91d48252ad4b 38c8e246 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in map_mft_record
* Struck through repros no longer work on HEAD.