[v6.6] possible deadlock in vm_mmap_pgoff

0 views
Skip to first unread message

syzbot

unread,
Oct 25, 2025, 4:23:30 PM (6 days ago) Oct 25
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4a243110dc88 Linux 6.6.114
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17e3c258580000
kernel config: https://syzkaller.appspot.com/x/.config?x=12606d4b8832c7e4
dashboard link: https://syzkaller.appspot.com/bug?extid=c75228c2f7930880dbb8
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/1950ac2cd960/disk-4a243110.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d7dccd93693b/vmlinux-4a243110.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6f93496e2b47/bzImage-4a243110.xz

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

REISERFS (device loop9): Created .reiserfs_priv - reserved for xattr storage.
REISERFS warning (device loop9): vs-13060 reiserfs_update_sd_size: stat data of object [1 2 0x0 SD] (nlink == 1) not found (pos 2)
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.9.2336/14435 is trying to acquire lock:
ffff8880632aa090 (&sbi->lock){+.+.}-{3:3}, at: reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27

but task is already holding lock:
ffff88801eec4420 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline]
ffff88801eec4420 (&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}:
__might_fault+0xc6/0x120 mm/memory.c:5946
reiserfs_ioctl+0x143/0x2d0 fs/reiserfs/ioctl.c:96
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:871 [inline]
__se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
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 (&sbi->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
reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27
reiserfs_dirty_inode+0xf4/0x240 fs/reiserfs/super.c:704
__mark_inode_dirty+0x2cc/0xca0 fs/fs-writeback.c:2465
generic_update_time fs/inode.c:1981 [inline]
inode_update_time fs/inode.c:1994 [inline]
touch_atime+0x356/0x580 fs/inode.c:2065
file_accessed include/linux/fs.h:2358 [inline]
generic_file_mmap+0xc8/0x130 mm/filemap.c:3709
call_mmap include/linux/fs.h:2023 [inline]
mmap_file mm/internal.h:98 [inline]
__mmap_region mm/mmap.c:2790 [inline]
mmap_region+0xfa5/0x2020 mm/mmap.c:2941
do_mmap+0x92f/0x10a0 mm/mmap.c:1385
vm_mmap_pgoff+0x1c0/0x400 mm/util.c:556
ksys_mmap_pgoff+0x520/0x700 mm/mmap.c:1431
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(&sbi->lock);
lock(&mm->mmap_lock);
lock(&sbi->lock);

*** DEADLOCK ***

2 locks held by syz.9.2336/14435:
#0: ffff88801eec4420 (&mm->mmap_lock){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:124 [inline]
#0: ffff88801eec4420 (&mm->mmap_lock){++++}-{3:3}, at: vm_mmap_pgoff+0x168/0x400 mm/util.c:554
#1: ffff88804c3fa418 (sb_writers#13){.+.+}-{0:0}, at: file_accessed include/linux/fs.h:2358 [inline]
#1: ffff88804c3fa418 (sb_writers#13){.+.+}-{0:0}, at: generic_file_mmap+0xc8/0x130 mm/filemap.c:3709

stack backtrace:
CPU: 1 PID: 14435 Comm: syz.9.2336 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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
reiserfs_write_lock+0x79/0xd0 fs/reiserfs/lock.c:27
reiserfs_dirty_inode+0xf4/0x240 fs/reiserfs/super.c:704
__mark_inode_dirty+0x2cc/0xca0 fs/fs-writeback.c:2465
generic_update_time fs/inode.c:1981 [inline]
inode_update_time fs/inode.c:1994 [inline]
touch_atime+0x356/0x580 fs/inode.c:2065
file_accessed include/linux/fs.h:2358 [inline]
generic_file_mmap+0xc8/0x130 mm/filemap.c:3709
call_mmap include/linux/fs.h:2023 [inline]
mmap_file mm/internal.h:98 [inline]
__mmap_region mm/mmap.c:2790 [inline]
mmap_region+0xfa5/0x2020 mm/mmap.c:2941
do_mmap+0x92f/0x10a0 mm/mmap.c:1385
vm_mmap_pgoff+0x1c0/0x400 mm/util.c:556
ksys_mmap_pgoff+0x520/0x700 mm/mmap.c:1431
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:0x7fb74a78efc9
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:00007fb74b6ae038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007fb74a9e5fa0 RCX: 00007fb74a78efc9
RDX: 0000000000000002 RSI: 0000000000b36000 RDI: 0000200000000000
RBP: 00007fb74a811f91 R08: 000000000000000c R09: 0000000000000000
R10: 0000000000028011 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb74a9e6038 R14: 00007fb74a9e5fa0 R15: 00007ffea0f58538
</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