syzbot


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: 19h24m, last: 19h24m
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 743d 1119d 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 65d 576d 0/3 upstream: reported on 2024/09/14 09:25
upstream possible deadlock in map_mft_record ntfs3 4 C error done 845 803d 1272d 25/29 fixed on 2024/03/20 11:33
linux-4.14 possible deadlock in map_mft_record ntfs 4 C 5 1151d 1245d 0/1 upstream: reported C repro on 2022/11/15 01:41
upstream possible deadlock in map_mft_record (2) fs 4 1 738d 734d 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 1 16d 16d 0/2 upstream: reported on 2026/03/28 01:29
linux-5.15 possible deadlock in map_mft_record 4 52 148d 1123d 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 1170d 1282d 0/1 upstream: reported C repro on 2022/10/09 19:52
linux-6.6 possible deadlock in map_mft_record 4 1 120d 120d 0/2 auto-obsoleted due to no activity on 2026/03/24 19:46

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.5.250/5627 is trying to acquire lock:
ffff888060607510 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x4e/0x620 fs/ntfs/mft.c:154

but task is already holding lock:
ffff888060607480 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x52b/0x42a0 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+0x44/0x2e0 kernel/locking/rwsem.c:1498
       ntfs_read_block fs/ntfs/aops.c:248 [inline]
       ntfs_readpage+0x1294/0x2260 fs/ntfs/aops.c:435
       do_read_cache_page+0x8a1/0x1030 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+0x26c/0x1a20 fs/ntfs/mft.c:480
       write_mft_record_nolock+0x14d9/0x1810 fs/ntfs/mft.c:805
       write_mft_record fs/ntfs/mft.h:95 [inline]
       __ntfs_write_inode+0x7cb/0xdc0 fs/ntfs/inode.c:3050
       ntfs_commit_inode fs/ntfs/inode.h:300 [inline]
       ntfs_put_super+0xee6/0x1070 fs/ntfs/super.c:2307
       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+0x42d/0x4e0 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+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
       lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1e3/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/0x620 fs/ntfs/mft.c:154
       ntfs_attr_extend_allocation+0x533/0x42a0 fs/ntfs/attrib.c:2002
       ntfs_prepare_file_for_write fs/ntfs/file.c:395 [inline]
       ntfs_file_write_iter+0x46e/0x1d60 fs/ntfs/file.c:1919
       do_iter_readv_writev+0x47e/0x5f0 fs/read_write.c:-1
       do_iter_write+0x205/0x7b0 fs/read_write.c:855
       vfs_writev fs/read_write.c:928 [inline]
       do_pwritev+0x240/0x3a0 fs/read_write.c:1025
       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.5.250/5627:
 #0: ffff888073c34460 (sb_writers#31){.+.+}-{0:0}, at: vfs_writev fs/read_write.c:927 [inline]
 #0: ffff888073c34460 (sb_writers#31){.+.+}-{0:0}, at: do_pwritev+0x229/0x3a0 fs/read_write.c:1025
 #1: ffff8880606077f0 (&sb->s_type->i_mutex_key#39){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff8880606077f0 (&sb->s_type->i_mutex_key#39){+.+.}-{3:3}, at: ntfs_file_write_iter+0x7b/0x1d60 fs/ntfs/file.c:1916
 #2: ffff888060607480 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x52b/0x42a0 fs/ntfs/attrib.c:2001

stack backtrace:
CPU: 0 PID: 5627 Comm: syz.5.250 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/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+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1e3/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/0x620 fs/ntfs/mft.c:154
 ntfs_attr_extend_allocation+0x533/0x42a0 fs/ntfs/attrib.c:2002
 ntfs_prepare_file_for_write fs/ntfs/file.c:395 [inline]
 ntfs_file_write_iter+0x46e/0x1d60 fs/ntfs/file.c:1919
 do_iter_readv_writev+0x47e/0x5f0 fs/read_write.c:-1
 do_iter_write+0x205/0x7b0 fs/read_write.c:855
 vfs_writev fs/read_write.c:928 [inline]
 do_pwritev+0x240/0x3a0 fs/read_write.c:1025
 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:0x7f3fdbd4d819
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:00007f3fd9fa7028 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: ffffffffffffffda RBX: 00007f3fdbfc6fa0 RCX: 00007f3fdbd4d819
RDX: 0000000000000001 RSI: 00002000000000c0 RDI: 0000000000000005
RBP: 00007f3fdbde3c91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000005 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3fdbfc7038 R14: 00007f3fdbfc6fa0 R15: 00007ffe2fcf91a8
 </TASK>
ntfs: (device loop5): ntfs_read_block(): Failed to read from inode 0x6, attribute type 0x80, vcn 0x0, offset 0x0 because its location on disk could not be determined even after retrying (error code -5).
ntfs: (device loop5): ntfs_read_block(): Failed to read from inode 0x6, attribute type 0x80, vcn 0x0, offset 0x800 because its location on disk could not be determined even after retrying (error code -5).
ntfs: (device loop5): ntfs_cluster_alloc(): Failed to map page.
ntfs: (device loop5): ntfs_cluster_alloc(): Failed to allocate clusters, aborting (error -5).

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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.