syzbot


possible deadlock in queue_stack_map_push_elem

Status: upstream: reported C repro on 2024/04/11 18:39
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+11cdb632b3437d02da7d@syzkaller.appspotmail.com
First crash: 449d, last: 1d09h
Bug presence (3)
Date Name Commit Repro Result
2025/01/29 linux-6.1.y (ToT) 75cefdf153f5 C [report] possible deadlock in queue_stack_map_push_elem
2024/04/25 upstream (ToT) c942a0cd3603 C [report] possible deadlock in queue_stack_map_push_elem
2025/01/29 upstream (ToT) 05dbaf8dd8bf C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in queue_stack_map_push_elem bpf C error 78 90d 442d 28/29 fixed on 2025/06/10 16:19
Fix bisection attempts (9)
Created Duration User Patch Repo Result
2025/05/17 16:07 1h59m bisect fix linux-6.1.y OK (0) job log log
2025/04/16 00:25 1h28m bisect fix linux-6.1.y OK (0) job log log
2025/03/12 15:09 1h29m bisect fix linux-6.1.y OK (0) job log log
2025/02/10 03:36 1h21m fix candidate upstream OK (0) job log log
2024/12/02 22:19 1h01m bisect fix linux-6.1.y OK (0) job log log
2024/10/23 06:01 1h27m bisect fix linux-6.1.y OK (0) job log log
2024/09/20 20:49 1h47m bisect fix linux-6.1.y OK (0) job log log
2024/08/17 20:15 59m bisect fix linux-6.1.y OK (0) job log log
2024/06/13 08:24 1h29m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.1.142-syzkaller #0 Not tainted
--------------------------------------------
syz.0.1191/5678 is trying to acquire lock:
ffff88807d864218 (&qs->lock){-.-.}-{2:2}, at: queue_stack_map_push_elem+0x16c/0x5e0 kernel/bpf/queue_stack_maps.c:214

but task is already holding lock:
ffff88807d865a18 (&qs->lock){-.-.}-{2:2}, at: queue_stack_map_push_elem+0x16c/0x5e0 kernel/bpf/queue_stack_maps.c:214

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

       CPU0
       ----
  lock(&qs->lock);
  lock(&qs->lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by syz.0.1191/5678:
 #0: ffffffff8c971f08 (tracepoints_mutex){+.+.}-{3:3}, at: tracepoint_probe_unregister+0x2c/0x930 kernel/tracepoint.c:548
 #1: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #1: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #1: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline]
 #1: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324
 #2: ffff88807d865a18 (&qs->lock){-.-.}-{2:2}, at: queue_stack_map_push_elem+0x16c/0x5e0 kernel/bpf/queue_stack_maps.c:214
 #3: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #3: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #3: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline]
 #3: ffffffff8c92aaa0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324

stack backtrace:
CPU: 1 PID: 5678 Comm: syz.0.1191 Not tainted 6.1.142-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 __lock_acquire+0x122f/0x7c50 kernel/locking/lockdep.c:-1
 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162
 queue_stack_map_push_elem+0x16c/0x5e0 kernel/bpf/queue_stack_maps.c:214
 bpf_prog_228e6f3dfd1f515c+0x3d/0x41
 bpf_dispatcher_nop_func include/linux/bpf.h:1001 [inline]
 __bpf_prog_run include/linux/filter.h:603 [inline]
 bpf_prog_run include/linux/filter.h:610 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2285 [inline]
 bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324
 __traceiter_contention_end+0x74/0xa0 include/trace/events/lock.h:122
 trace_contention_end+0x13f/0x190 include/trace/events/lock.h:122
 __pv_queued_spin_lock_slowpath+0x7e8/0x9c0 kernel/locking/qspinlock.c:560
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline]
 queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xb0/0xf0 kernel/locking/spinlock.c:162
 queue_stack_map_push_elem+0x16c/0x5e0 kernel/bpf/queue_stack_maps.c:214
 bpf_prog_228e6f3dfd1f515c+0x3d/0x41
 bpf_dispatcher_nop_func include/linux/bpf.h:1001 [inline]
 __bpf_prog_run include/linux/filter.h:603 [inline]
 bpf_prog_run include/linux/filter.h:610 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2285 [inline]
 bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324
 __traceiter_contention_end+0x74/0xa0 include/trace/events/lock.h:122
 trace_contention_end+0x123/0x170 include/trace/events/lock.h:122
 __mutex_lock_common kernel/locking/mutex.c:612 [inline]
 __mutex_lock+0x194/0xaf0 kernel/locking/mutex.c:747
 tracepoint_probe_unregister+0x2c/0x930 kernel/tracepoint.c:548
 bpf_raw_tp_link_release+0x5f/0x80 kernel/bpf/syscall.c:3190
 bpf_link_free kernel/bpf/syscall.c:2759 [inline]
 bpf_link_put+0x22a/0x2c0 kernel/bpf/syscall.c:2785
 bpf_link_release+0x37/0x40 kernel/bpf/syscall.c:2794
 __fput+0x22c/0x920 fs/file_table.c:320
 task_work_run+0x1ca/0x250 kernel/task_work.c:203
 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+0xb1/0x140 kernel/entry/common.c:210
 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1b93b8e929
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:00007fffe969f8d8 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 000000000001e645 RCX: 00007f1b93b8e929
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000001 R09: 00000005e969fbcf
R10: 00007f1b93800000 R11: 0000000000000246 R12: 00007f1b93db5fac
R13: 00007f1b93db5fa0 R14: ffffffffffffffff R15: 0000000000000003
 </TASK>

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/03 09:39 linux-6.1.y 7e69c33e4858 115ceea7 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2025/06/06 05:13 linux-6.1.y 58485ff1a74f 6b6b5f21 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2025/01/17 19:04 linux-6.1.y 60ceadf9247e 953d1c45 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/12/27 04:12 linux-6.1.y 29f02ec58a94 d3ccff63 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/05/08 23:01 linux-6.1.y 909ba1f1b414 20bf80e1 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/04/26 15:18 linux-6.1.y 6741e066ec76 059e9963 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/04/11 18:39 linux-6.1.y bf1e3b1cb1e0 95ed9ece .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2025/01/22 20:15 linux-6.1.y f4f677285b38 a44b0418 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2025/01/22 20:15 linux-6.1.y f4f677285b38 a44b0418 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/07/18 11:10 linux-6.1.y cac15753b8ce 0f902625 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/05/14 01:26 linux-6.1.y 909ba1f1b414 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in queue_stack_map_push_elem
2024/05/14 01:26 linux-6.1.y 909ba1f1b414 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in queue_stack_map_push_elem
2024/05/07 19:24 linux-6.1.y 909ba1f1b414 cb2dcc0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/05/07 05:56 linux-6.1.y 909ba1f1b414 fa7a5cf0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
2024/05/02 18:59 linux-6.1.y 909ba1f1b414 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in queue_stack_map_push_elem
* Struck through repros no longer work on HEAD.