syzbot


possible deadlock in __stack_map_get

Status: upstream: reported C repro on 2024/04/12 22:39
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+56936a2c1630efed0af2@syzkaller.appspotmail.com
First crash: 505d, last: 16d
Bug presence (3)
Date Name Commit Repro Result
2025/01/30 linux-6.1.y (ToT) 75cefdf153f5 C [report] possible deadlock in __stack_map_get
2024/04/29 upstream (ToT) e67572cd2204 C [report] possible deadlock in __stack_map_get
2025/01/30 upstream (ToT) 72deda0abee6 C Didn't crash
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.6 possible deadlock in __stack_map_get origin:lts-only 4 C 1 21d 21d 0/2 upstream: reported C repro on 2025/08/09 11:39
upstream possible deadlock in __stack_map_get bpf 4 C error error 56 146d 499d 0/29 upstream: reported C repro on 2024/04/18 20:00
Fix bisection attempts (9)
Created Duration User Patch Repo Result
2025/08/10 11:14 2h07m bisect fix linux-6.1.y OK (0) job log log
2025/07/10 21:17 1h26m bisect fix linux-6.1.y OK (0) job log log
2025/06/08 19:38 1h42m bisect fix linux-6.1.y OK (0) job log log
2025/03/31 15:17 2h36m fix candidate upstream OK (0) job log log
2025/03/03 14:03 1h42m bisect fix linux-6.1.y OK (0) job log log
2025/01/10 05:06 1h16m bisect fix linux-6.1.y OK (0) job log log
2024/12/02 15:51 2h33m bisect fix linux-6.1.y OK (0) job log log
2024/10/23 01:02 1h56m bisect fix linux-6.1.y OK (0) job log log
2024/08/04 07:19 1h22m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.1.147-syzkaller #0 Not tainted
--------------------------------------------
syz-executor/4379 is trying to acquire lock:
ffff88802870a218 (&qs->lock){-.-.}-{2:2}, at: __stack_map_get+0x11a/0x440 kernel/bpf/queue_stack_maps.c:144

but task is already holding lock:
ffff88807b43c218 (&qs->lock){-.-.}-{2:2}, at: __stack_map_get+0x11a/0x440 kernel/bpf/queue_stack_maps.c:144

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-executor/4379:
 #0: ffff88814cf3e308 (&xt[i].mutex){+.+.}-{3:3}, at: xt_find_table_lock+0x5e/0x360 net/netfilter/x_tables.c:1242
 #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline]
 #1: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324
 #2: ffff88807b43c218 (&qs->lock){-.-.}-{2:2}, at: __stack_map_get+0x11a/0x440 kernel/bpf/queue_stack_maps.c:144
 #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline]
 #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324

stack backtrace:
CPU: 1 PID: 4379 Comm: syz-executor Not tainted 6.1.147-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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
 __stack_map_get+0x11a/0x440 kernel/bpf/queue_stack_maps.c:144
 bpf_prog_00798911c748094f+0x3a/0x3e
 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
 __stack_map_get+0x11a/0x440 kernel/bpf/queue_stack_maps.c:144
 bpf_prog_00798911c748094f+0x3a/0x3e
 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
 xt_find_table_lock+0x5e/0x360 net/netfilter/x_tables.c:1242
 xt_request_find_table_lock+0x22/0x100 net/netfilter/x_tables.c:1284
 get_info net/ipv4/netfilter/ip_tables.c:965 [inline]
 do_ipt_get_ctl+0x6e8/0x10f0 net/ipv4/netfilter/ip_tables.c:1661
 nf_getsockopt+0x25e/0x280 net/netfilter/nf_sockopt.c:116
 ip_getsockopt+0x1bd/0x210 net/ipv4/ip_sockglue.c:1826
 __sys_getsockopt+0x1b0/0x230 net/socket.c:2332
 __do_sys_getsockopt net/socket.c:2347 [inline]
 __se_sys_getsockopt net/socket.c:2344 [inline]
 __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2344
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f184179092a
Code: ff c3 66 0f 1f 44 00 00 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb b8 0f 1f 44 00 00 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 a8 ff ff ff f7
RSP: 002b:00007ffd94b2bc08 EFLAGS: 00000242 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00007ffd94b2bc30 RCX: 00007f184179092a
RDX: 0000000000000040 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007ffd94b2bc2c R09: 00007ffd94b2c047
R10: 00007ffd94b2bc30 R11: 0000000000000242 R12: 00007f1841985520
R13: 00007ffd94b2bc2c R14: 0000000000000000 R15: 00007f1841987020
 </TASK>

Crashes (20):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/14 11:57 linux-6.1.y 3594f306da12 22ec1469 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/05/02 02:17 linux-6.1.y 535ec20c5027 51b137cd .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/12/09 21:46 linux-6.1.y e4d90d63d385 9ac0fdc6 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/05/09 03:40 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 __stack_map_get
2024/04/12 22:38 linux-6.1.y bf1e3b1cb1e0 c8349e48 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/05/09 10:12 linux-6.1.y 02b72ccb5f9d bb813bcc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/05/09 02:41 linux-6.1.y ac7079a42ea5 bb813bcc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/05/09 02:31 linux-6.1.y ac7079a42ea5 bb813bcc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/05/08 22:07 linux-6.1.y ac7079a42ea5 dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/05/08 10:18 linux-6.1.y ac7079a42ea5 dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/05/06 20:02 linux-6.1.y ac7079a42ea5 350f4ffc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2025/03/10 18:28 linux-6.1.y 6ae7ac5c4251 16256247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/09/20 10:33 linux-6.1.y e526b12bf916 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/08/21 08:37 linux-6.1.y ee5e09825b81 9f0ab3fb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/06/24 14:59 linux-6.1.y eb44d83053d6 edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/06/06 14:37 linux-6.1.y 88690811da69 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/06/06 14:37 linux-6.1.y 88690811da69 121701b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/05/26 15:58 linux-6.1.y 88690811da69 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/05/20 02:07 linux-6.1.y 4078fa637fcd c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
2024/04/23 11:02 linux-6.1.y 6741e066ec76 21339d7b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __stack_map_get
* Struck through repros no longer work on HEAD.