syzbot


possible deadlock in map_mft_record (2)

Status: upstream: reported on 2026/03/28 01:29
Reported-by: syzbot+f39315374e982347d17f@syzkaller.appspotmail.com
First crash: 93d, last: 11h15m
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in map_mft_record 4 13 820d 1196d 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 142d 653d 0/3 auto-obsoleted due to no activity on 2026/05/18 01:31
upstream possible deadlock in map_mft_record ntfs3 4 C error done 845 880d 1349d 25/29 fixed on 2024/03/20 11:33
linux-4.14 possible deadlock in map_mft_record ntfs 4 C 5 1228d 1322d 0/1 upstream: reported C repro on 2022/11/15 01:41
upstream possible deadlock in map_mft_record (2) fs 4 1 815d 811d 0/29 auto-obsoleted due to no activity on 2024/07/04 04:55
linux-5.15 possible deadlock in map_mft_record (2) 4 1 77d 77d 0/3 upstream: reported on 2026/04/13 05:09
linux-5.15 possible deadlock in map_mft_record 4 52 225d 1200d 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 C error 11 1247d 1359d 0/1 upstream: reported C repro on 2022/10/09 19:52
linux-6.6 possible deadlock in map_mft_record 4 1 197d 197d 0/2 auto-obsoleted due to no activity on 2026/03/24 19:46

Sample crash report:
ntfs: (device loop2): ntfs_read_locked_inode(): Failed with error code -2.  Marking corrupt inode 0xa as bad.  Run chkdsk.
ntfs: (device loop2): 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.2.1191/9423 is trying to acquire lock:
ffff888059010190 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x50/0x650 fs/ntfs/mft.c:154

but task is already holding lock:
ffff888059010100 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x505/0x43e0 fs/ntfs/attrib.c:2001

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&rl->lock){++++}-{3:3}:
       down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
       ntfs_read_block fs/ntfs/aops.c:248 [inline]
       ntfs_read_folio+0x1433/0x2960 fs/ntfs/aops.c:436
       filemap_read_folio+0x16b/0x790 mm/filemap.c:2420
       do_read_cache_folio+0x485/0x7f0 mm/filemap.c:3809
       do_read_cache_page+0x32/0x260 mm/filemap.c:3875
       read_mapping_page include/linux/pagemap.h:892 [inline]
       ntfs_map_page fs/ntfs/aops.h:75 [inline]
       ntfs_sync_mft_mirror+0x252/0x1a80 fs/ntfs/mft.c:480
       write_mft_record_nolock+0x120b/0x1990 fs/ntfs/mft.c:787
       write_mft_record+0x136/0x300 fs/ntfs/mft.h:95
       __ntfs_write_inode+0x6bb/0xbf0 fs/ntfs/inode.c:3051
       write_inode fs/fs-writeback.c:1483 [inline]
       __writeback_single_inode+0x720/0xee0 fs/fs-writeback.c:1700
       writeback_sb_inodes+0x813/0x1020 fs/fs-writeback.c:1926
       wb_writeback+0x45e/0xbe0 fs/fs-writeback.c:2105
       wb_do_writeback fs/fs-writeback.c:2252 [inline]
       wb_workfn+0x400/0xe60 fs/fs-writeback.c:2292
       process_one_work kernel/workqueue.c:2653 [inline]
       process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2730
       worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2811
       kthread+0x2fa/0x390 kernel/kthread.c:388
       ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
       ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

-> #0 (&ni->mrec_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+0x37ef/0x7d80 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+0x135/0xc80 kernel/locking/mutex.c:747
       map_mft_record+0x50/0x650 fs/ntfs/mft.c:154
       ntfs_attr_extend_allocation+0x50d/0x43e0 fs/ntfs/attrib.c:2002
       ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline]
       ntfs_file_write_iter+0x37d/0x1a80 fs/ntfs/file.c:1914
       call_write_iter include/linux/fs.h:2018 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x474/0x9a0 fs/read_write.c:584
       ksys_write+0x151/0x260 fs/read_write.c:637
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

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 ***

4 locks held by syz.2.1191/9423:
 #0: ffff88802f8339c8 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x2a3/0x330 fs/file.c:1040
 #1: ffff888030912418 (sb_writers#32){.+.+}-{0:0}, at: vfs_write+0x21e/0x9a0 fs/read_write.c:580
 #2: ffff888059010480 (&sb->s_type->i_mutex_key#46){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #2: ffff888059010480 (&sb->s_type->i_mutex_key#46){+.+.}-{3:3}, at: ntfs_file_write_iter+0x7b/0x1a80 fs/ntfs/file.c:1912
 #3: ffff888059010100 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x505/0x43e0 fs/ntfs/attrib.c:2001

stack backtrace:
CPU: 0 PID: 9423 Comm: syz.2.1191 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/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+0x37ef/0x7d80 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+0x135/0xc80 kernel/locking/mutex.c:747
 map_mft_record+0x50/0x650 fs/ntfs/mft.c:154
 ntfs_attr_extend_allocation+0x50d/0x43e0 fs/ntfs/attrib.c:2002
 ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline]
 ntfs_file_write_iter+0x37d/0x1a80 fs/ntfs/file.c:1914
 call_write_iter include/linux/fs.h:2018 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x474/0x9a0 fs/read_write.c:584
 ksys_write+0x151/0x260 fs/read_write.c:637
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fd16239ce59
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:00007fd1631bc028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fd162615fa0 RCX: 00007fd16239ce59
RDX: 0000000000000001 RSI: 0000200000000080 RDI: 0000000000000004
RBP: 00007fd162432e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd162616038 R14: 00007fd162615fa0 R15: 00007ffe6d1564e8
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/06/29 12:59 linux-6.6.y d1cfde2d5d15 6a0c72dc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in map_mft_record
2026/03/28 01:28 linux-6.6.y c09fbcd31ae6 356bdfc9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in map_mft_record
* Struck through repros no longer work on HEAD.