[v6.6] possible deadlock in map_mft_record

0 views
Skip to first unread message

syzbot

unread,
Dec 14, 2025, 2:45:33 PM (9 days ago) Dec 14
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 5fa4793a2d2d Linux 6.6.119
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=179c811a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=691a6769a86ac817
dashboard link: https://syzkaller.appspot.com/bug?extid=32fcc4e8de09159962b2
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/63699875f1dd/disk-5fa4793a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8506652fcb6f/vmlinux-5fa4793a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1b30ceed1710/bzImage-5fa4793a.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+32fcc4...@syzkaller.appspotmail.com

ntfs: volume version 3.1.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.9.289/8583 is trying to acquire lock:
ffff88805cc8c390 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x50/0x650 fs/ntfs/mft.c:154

but task is already holding lock:
ffff88805cc8c300 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x218/0x28a0 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+0x46/0x2e0 kernel/locking/rwsem.c:1520
ntfs_read_block fs/ntfs/aops.c:248 [inline]
ntfs_read_folio+0x144d/0x2980 fs/ntfs/aops.c:436
filemap_read_folio+0x167/0x760 mm/filemap.c:2420
do_read_cache_folio+0x470/0x7e0 mm/filemap.c:3804
do_read_cache_page+0x32/0x250 mm/filemap.c:3870
read_mapping_page include/linux/pagemap.h:892 [inline]
ntfs_map_page fs/ntfs/aops.h:75 [inline]
ntfs_sync_mft_mirror+0x236/0x1aa0 fs/ntfs/mft.c:480
write_mft_record_nolock+0x1407/0x18c0 fs/ntfs/mft.c:805
write_mft_record+0x136/0x300 fs/ntfs/mft.h:95
__ntfs_write_inode+0x731/0xc00 fs/ntfs/inode.c:3051
ntfs_commit_inode fs/ntfs/inode.h:300 [inline]
ntfs_put_super+0xeea/0x1070 fs/ntfs/super.c:2315
generic_shutdown_super+0x134/0x2b0 fs/super.c:693
kill_block_super+0x44/0x90 fs/super.c:1660
deactivate_locked_super+0x97/0x100 fs/super.c:481
cleanup_mnt+0x429/0x4c0 fs/namespace.c:1259
task_work_run+0x1ce/0x250 kernel/task_work.c:239
exit_task_work include/linux/task_work.h:43 [inline]
do_exit+0x90b/0x23c0 kernel/exit.c:883
do_group_exit+0x21b/0x2d0 kernel/exit.c:1024
get_signal+0x12fc/0x1400 kernel/signal.c:2902
arch_do_signal_or_restart+0x9c/0x7b0 arch/x86/kernel/signal.c:310
exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
exit_to_user_mode_prepare+0xf6/0x180 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline]
syscall_exit_to_user_mode+0x1a/0x50 kernel/entry/common.c:302
do_syscall_64+0x61/0xb0 arch/x86/entry/common.c:87
entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
map_mft_record+0x50/0x650 fs/ntfs/mft.c:154
ntfs_truncate+0x28a/0x28a0 fs/ntfs/inode.c:2383
ntfs_truncate_vfs fs/ntfs/inode.c:2863 [inline]
ntfs_setattr+0x34a/0x430 fs/ntfs/inode.c:2915
notify_change+0xb0d/0xe10 fs/attr.c:499
do_truncate+0x19b/0x220 fs/open.c:66
vfs_truncate+0x266/0x300 fs/open.c:112
do_sys_truncate+0xe0/0x1a0 fs/open.c:135
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:

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.9.289/8583:
#0: ffff888058d6a418 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
#1: ffff88805cc8c680 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
#1: ffff88805cc8c680 (&sb->s_type->i_mutex_key#23){+.+.}-{3:3}, at: do_truncate+0x187/0x220 fs/open.c:64
#2: ffff88805cc8c300 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x218/0x28a0 fs/ntfs/inode.c:2378

stack backtrace:
CPU: 1 PID: 8583 Comm: syz.9.289 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/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
__mutex_lock_common kernel/locking/mutex.c:603 [inline]
__mutex_lock+0x129/0xcc0 kernel/locking/mutex.c:747
map_mft_record+0x50/0x650 fs/ntfs/mft.c:154
ntfs_truncate+0x28a/0x28a0 fs/ntfs/inode.c:2383
ntfs_truncate_vfs fs/ntfs/inode.c:2863 [inline]
ntfs_setattr+0x34a/0x430 fs/ntfs/inode.c:2915
notify_change+0xb0d/0xe10 fs/attr.c:499
do_truncate+0x19b/0x220 fs/open.c:66
vfs_truncate+0x266/0x300 fs/open.c:112
do_sys_truncate+0xe0/0x1a0 fs/open.c:135
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:0x7f112b58f749
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:00007f112c3f5038 EFLAGS: 00000246 ORIG_RAX: 000000000000004c
RAX: ffffffffffffffda RBX: 00007f112b7e5fa0 RCX: 00007f112b58f749
RDX: 0000000000000000 RSI: 0000000000081c04 RDI: 0000200000000040
RBP: 00007f112b613f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f112b7e6038 R14: 00007f112b7e5fa0 R15: 00007ffcaa6acb98
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages