syzbot


possible deadlock in local_lock_acquire

Status: fixed on 2024/09/19 18:24
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+05dc59184abf0cf80ebd@syzkaller.appspotmail.com
Fix commit: d240b789dded mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer
First crash: 239d, last: 97d
Fix bisection: fixed by (bisect log) :
commit d240b789dded28e4fb9f28b4265dbaf67050d870
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: Fri Jun 21 01:08:41 2024 +0000

  mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer

  
Bug presence (3)
Date Name Commit Repro Result
2024/09/08 linux-5.15.y (ToT) 14e468424d3e C [report] WARNING in bpf_get_stack_raw_tp
2024/04/25 upstream (ToT) a93289b830ce C [report] possible deadlock in __mmap_lock_do_trace_acquire_returned
2024/09/08 upstream (ToT) d1f2d51b711a C Didn't crash
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2024/09/16 20:16 3h50m bisect fix linux-5.15.y OK (1) job log
2024/08/09 05:36 1h46m bisect fix linux-5.15.y OK (0) job log log
2024/07/02 08:03 1h34m bisect fix linux-5.15.y OK (0) job log log
2024/05/21 21:09 1h12m bisect fix linux-5.15.y OK (0) job log log

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.15.164-syzkaller #0 Not tainted
--------------------------------------------
syz-executor267/3563 is trying to acquire lock:
ffff8880b9b35bb8 (
lock#8){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28

but task is already holding lock:
ffff8880b9b35bb8 (lock#8){+.+.}-{2:2}
, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28

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

       CPU0
       ----
  lock(lock
#8);
  lock(lock#8);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

5 locks held by syz-executor267/3563:
 #0: ffff888019901d28 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
 #0: ffff888019901d28 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault arch/x86/mm/fault.c:1298 [inline]
 #0: ffff888019901d28 (&mm->mmap_lock){++++}-{3:3}, at: handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 #0: ffff888019901d28 (&mm->mmap_lock){++++}-{3:3}, at: exc_page_fault+0x181/0x700 arch/x86/mm/fault.c:1501
 #1: ffff8880b9b35bb8 (lock#8){+.+.}-{2:2}, at: local_lock_acquire+0xd/0x170 include/linux/local_lock_internal.h:28
 #2: ffffffff8c91fb20 (rcu_read_lock){....}-{1:2}
, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
 #3: ffffffff8c91fb20
 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:311
 #4: ffff888019901d28 (&mm->mmap_lock){++++}-{3:3}
, at: mmap_read_trylock include/linux/mmap_lock.h:136 [inline]
, at: stack_map_get_build_id_offset+0x23e/0x930 kernel/bpf/stackmap.c:185

stack backtrace:
CPU: 1 PID: 3563 Comm: syz-executor267 Not tainted 5.15.164-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline]
 check_deadlock kernel/locking/lockdep.c:2989 [inline]
 validate_chain+0x46d2/0x5930 kernel/locking/lockdep.c:3775
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 local_lock_acquire+0x29/0x170 include/linux/local_lock_internal.h:29
 __mmap_lock_do_trace_acquire_returned+0x7c/0x340 mm/mmap_lock.c:237
 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
 mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
 stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
 __bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
 bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
 bpf_prog_ec3b2eefa702d8d3+0x3a/0x414
 bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
 __bpf_prog_run include/linux/filter.h:628 [inline]
 bpf_prog_run include/linux/filter.h:635 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
 bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
 trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
 __mmap_lock_do_trace_acquire_returned+0x2d6/0x340 mm/mmap_lock.c:237
 __mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
 mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
 do_user_addr_fault arch/x86/mm/fault.c:1298 [inline]
 handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 exc_page_fault+0x564/0x700 arch/x86/mm/fault.c:1501
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0033:0x7fa14bc510d0
Code: 41 54 55 48 89 f5 53 89 fb 48 83 ec 18 48 83 3d 1d 0f 0a 00 00 89 54 24 0c 74 08 84 c9 0f 85 09 02 00 00 31 c0 ba 01 00 00 00 <f0> 0f b1 15 10 3c 0a 00 0f 85 0f 02 00 00 4c 8d 25 03 3c 0a 00 4c
RSP: 002b:00007ffd8f464e20 EFLAGS: 00010246

RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 00007fa14bcf2118 RDI: 0000000000000000
RBP: 00007fa14bcf2118 R08: 0000000000000006 R09: 0000000000000006
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (54):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/15 16:02 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 14:56 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 13:07 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 12:35 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 12:04 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 11:10 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 10:44 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 10:15 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 09:21 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 08:44 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/03/28 16:10 linux-5.15.y 9465fef4ae35 e91187ee .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/17 13:06 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/17 08:58 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 23:50 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 18:28 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/16 14:35 linux-5.15.y 7e89efd3ae1c e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 07:30 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 06:48 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 06:47 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 06:46 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 06:45 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 06:44 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/16 06:38 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/16 06:38 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/15 17:37 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 11:42 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/15 11:42 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/15 11:33 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/15 07:38 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 07:38 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 07:33 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 07:33 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 07:19 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 07:19 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 07:05 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 07:04 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 06:23 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 06:20 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 06:18 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 06:16 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
2024/08/15 00:02 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/15 00:02 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/08/15 00:02 linux-5.15.y 7e89efd3ae1c e6b88e20 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/05/28 10:11 linux-5.15.y c61bd26ae81a f550015e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/04/18 11:07 linux-5.15.y c52b9710c83d af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in local_lock_acquire
2024/04/12 22:42 linux-5.15.y cdfd0a7f0139 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf possible deadlock in local_lock_acquire
* Struck through repros no longer work on HEAD.