[v6.6] possible deadlock in ntfs_file_mmap

4 views
Skip to first unread message

syzbot

unread,
Jul 3, 2025, 9:12:40 PM7/3/25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f5b4c104b7d Linux 6.6.95
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=149ab3d4580000
kernel config: https://syzkaller.appspot.com/x/.config?x=747dbf84b0ecd30c
dashboard link: https://syzkaller.appspot.com/bug?extid=b58b96cb5ac8d4ad1cbc
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/421f6e2d0cd1/disk-3f5b4c10.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/90250695b20b/vmlinux-3f5b4c10.xz
kernel image: https://storage.googleapis.com/syzbot-assets/32250e77bce9/bzImage-3f5b4c10.xz

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

======================================================
WARNING: possible circular locking dependency detected
6.6.95-syzkaller #0 Not tainted
------------------------------------------------------
syz.8.3980/15969 is trying to acquire lock:
ffff88805ce7dc30 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
ffff88805ce7dc30 (&sb->s_type->i_mutex_key#30){+.+.}-{3:3}, at: ntfs_file_mmap+0x54c/0x730 fs/ntfs3/file.c:302

but task is already holding lock:
ffff88802d8f27a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline]
ffff88802d8f27a0 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x168/0x400 mm/util.c:554

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&mm->mmap_lock){++++}-{3:3}:
internal_get_user_pages_fast+0x21d/0x2730 mm/gup.c:3195
iov_iter_extract_user_pages lib/iov_iter.c:1785 [inline]
iov_iter_extract_pages+0x393/0x790 lib/iov_iter.c:1848
dio_refill_pages fs/direct-io.c:173 [inline]
dio_get_page fs/direct-io.c:214 [inline]
do_direct_IO fs/direct-io.c:914 [inline]
__blockdev_direct_IO+0x10d6/0x3420 fs/direct-io.c:1248
blockdev_direct_IO include/linux/fs.h:3047 [inline]
ntfs_direct_IO+0x196/0x3a0 fs/ntfs3/inode.c:801
generic_file_direct_write+0x1d4/0x3e0 mm/filemap.c:3941
__generic_file_write_iter+0x11b/0x230 mm/filemap.c:4097
ntfs_file_write_iter+0x61c/0x700 fs/ntfs3/file.c:1120
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x79a/0xc70 fs/read_write.c:860
vfs_writev fs/read_write.c:933 [inline]
do_writev+0x252/0x410 fs/read_write.c:976
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

-> #0 (&sb->s_type->i_mutex_key#30){+.+.}-{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
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ntfs_file_mmap+0x54c/0x730 fs/ntfs3/file.c:302
call_mmap include/linux/fs.h:2023 [inline]
mmap_file mm/internal.h:98 [inline]
__mmap_region mm/mmap.c:2786 [inline]
mmap_region+0xe57/0x1f80 mm/mmap.c:2937
do_mmap+0x8d1/0xfd0 mm/mmap.c:1381
vm_mmap_pgoff+0x1c0/0x400 mm/util.c:556
ksys_mmap_pgoff+0x520/0x700 mm/mmap.c:1427
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(&mm->mmap_lock);
lock(&sb->s_type->i_mutex_key#30);
lock(&mm->mmap_lock);
lock(&sb->s_type->i_mutex_key#30);

*** DEADLOCK ***

1 lock held by syz.8.3980/15969:
#0: ffff88802d8f27a0 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline]
#0: ffff88802d8f27a0 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x168/0x400 mm/util.c:554

stack backtrace:
CPU: 1 PID: 15969 Comm: syz.8.3980 Not tainted 6.6.95-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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
down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:804 [inline]
ntfs_file_mmap+0x54c/0x730 fs/ntfs3/file.c:302
call_mmap include/linux/fs.h:2023 [inline]
mmap_file mm/internal.h:98 [inline]
__mmap_region mm/mmap.c:2786 [inline]
mmap_region+0xe57/0x1f80 mm/mmap.c:2937
do_mmap+0x8d1/0xfd0 mm/mmap.c:1381
vm_mmap_pgoff+0x1c0/0x400 mm/util.c:556
ksys_mmap_pgoff+0x520/0x700 mm/mmap.c:1427
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:0x7fa087b8e929
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:00007fa088a09038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007fa087db5fa0 RCX: 00007fa087b8e929
RDX: 0000000000000002 RSI: 0000000000001000 RDI: 0000200000001000
RBP: 00007fa087c10b39 R08: 0000000000000004 R09: 0000000000000000
R10: 0000000000000011 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fa087db5fa0 R15: 00007ffe6ab0f6c8
</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

syzbot

unread,
Oct 23, 2025, 4:58:21 PM10/23/25
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages