[v6.6] possible deadlock in map_mft_record (2)

0 views
Skip to first unread message

syzbot

unread,
Mar 27, 2026, 9:29:27 PM (yesterday) Mar 27
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c09fbcd31ae6 Linux 6.6.130
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16f536da580000
kernel config: https://syzkaller.appspot.com/x/.config?x=c5b35c4db8465904
dashboard link: https://syzkaller.appspot.com/bug?extid=f39315374e982347d17f
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/58165bbf9941/disk-c09fbcd3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/73cbb84fb36b/vmlinux-c09fbcd3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/744ea33ec44b/bzImage-c09fbcd3.xz

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

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

but task is already holding lock:
ffff888060442a40 (&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+0x145d/0x2990 fs/ntfs/aops.c:436
filemap_read_folio+0x172/0x760 mm/filemap.c:2420
do_read_cache_folio+0x468/0x7d0 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+0x253/0x1ac0 fs/ntfs/mft.c:480
write_mft_record_nolock+0x1424/0x18f0 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+0xa7/0x1070 fs/ntfs/super.c:2268
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+0x43b/0x4d0 fs/namespace.c:1259
task_work_run+0x1d4/0x260 kernel/task_work.c:245
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:177
exit_to_user_mode_prepare+0xee/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/0xa0 arch/x86/entry/common.c:82
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+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
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+0x1b0/0x240 fs/open.c:66
vfs_truncate+0x266/0x300 fs/open.c:112
do_sys_truncate+0xf6/0x1c0 fs/open.c:135
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:

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.3050/12736:
#0: ffff8880240da418 (sb_writers#26){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:412
#1: ffff888060442dc0 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
#1: ffff888060442dc0 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: do_truncate+0x19c/0x240 fs/open.c:64
#2: ffff888060442a40 (&rl->lock){++++}-{3:3}, at: ntfs_truncate+0x218/0x28a0 fs/ntfs/inode.c:2378

stack backtrace:
CPU: 1 PID: 12736 Comm: syz.5.3050 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
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+0x1b0/0x240 fs/open.c:66
vfs_truncate+0x266/0x300 fs/open.c:112
do_sys_truncate+0xf6/0x1c0 fs/open.c:135
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:0x7f38d239c799
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:00007f38d05f6028 EFLAGS: 00000246 ORIG_RAX: 000000000000004c
RAX: ffffffffffffffda RBX: 00007f38d2615fa0 RCX: 00007f38d239c799
RDX: 0000000000000000 RSI: 0000000000001bf8 RDI: 0000200000000280
RBP: 00007f38d2432c99 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f38d2616038 R14: 00007f38d2615fa0 R15: 00007ffc306a6f98
</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