syzbot


possible deadlock in mmap_read_lock

Status: auto-obsoleted due to no activity on 2024/09/13 20:00
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+c0f0941337ade4c26ed1@syzkaller.appspotmail.com
First crash: 149d, last: 149d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [mm?] possible deadlock in mmap_read_lock 1 (2) 2024/07/20 01:39

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.10.0-rc7-next-20240712-syzkaller #0 Not tainted
--------------------------------------------
mount/4518 is trying to acquire lock:
ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock+0x1c/0x60 include/linux/mmap_lock.h:144

but task is already holding lock:
ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline]
ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: exit_mmap+0x159/0xc80 mm/mmap.c:3396

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&mm->mmap_lock);
  lock(&mm->mmap_lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

1 lock held by mount/4518:
 #0: ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:144 [inline]
 #0: ffff88801d2b1498 (&mm->mmap_lock){++++}-{3:3}, at: exit_mmap+0x159/0xc80 mm/mmap.c:3396

stack backtrace:
CPU: 1 UID: 0 PID: 4518 Comm: mount Not tainted 6.10.0-rc7-next-20240712-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3034
 check_deadlock kernel/locking/lockdep.c:3086 [inline]
 validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3888
 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5199
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5822
 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1526
 mmap_read_lock+0x1c/0x60 include/linux/mmap_lock.h:144
 unmap_single_vma+0x2a0/0x330 mm/memory.c:1832
 unmap_vmas+0x3cc/0x5f0 mm/memory.c:1904
 exit_mmap+0x264/0xc80 mm/mmap.c:3412
 __mmput+0x115/0x390 kernel/fork.c:1347
 exit_mm+0x220/0x310 kernel/exit.c:571
 do_exit+0x9b2/0x27f0 kernel/exit.c:869
 do_group_exit+0x207/0x2c0 kernel/exit.c:1031
 __do_sys_exit_group kernel/exit.c:1042 [inline]
 __se_sys_exit_group kernel/exit.c:1040 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1040
 x64_sys_call+0x26c3/0x26d0 arch/x86/include/generated/asm/syscalls_64.h:232
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd19a876a90
Code: Unable to access opcode bytes at 0x7fd19a876a66.
RSP: 002b:00007ffd90b476e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007fd19a967860 RCX: 00007fd19a876a90
RDX: 00000000000000e7 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00007fd19a967860 R08: 00007ffd90b47560 R09: 00007ffd90b47640
R10: 00007ffd90b475a0 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fd19a96b658 R15: 0000000000000001
 </TASK>
mount (4518) used greatest stack depth: 23680 bytes left

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/15 19:59 linux-next 3fe121b62282 efee4ed2 .config console log report [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in mmap_read_lock
* Struck through repros no longer work on HEAD.