syzbot


possible deadlock in __stack_map_get

Status: upstream: reported C repro on 2024/04/18 20:00
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+dddd99ae26c656485d89@syzkaller.appspotmail.com
First crash: 220d, last: 13d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] Monthly bpf report (Oct 2024) 0 (1) 2024/10/15 21:53
[syzbot] [bpf?] possible deadlock in __stack_map_get 2 (5) 2024/04/19 14:12
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in __stack_map_get origin:upstream C 10 29d 222d 0/3 upstream: reported C repro on 2024/04/12 22:39
Last patch testing requests (9)
Created Duration User Patch Repo Result
2024/11/05 05:49 45m retest repro bpf-next report log
2024/10/19 02:09 16m retest repro bpf-next report log
2024/09/06 08:32 16m retest repro net report log
2024/08/23 07:48 24m retest repro bpf report log
2024/08/23 07:48 26m retest repro bpf report log
2024/08/23 07:48 14m retest repro net-next report log
2024/07/08 15:32 20m retest repro bpf-next report log
2024/04/19 11:03 1h35m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git f99c5f563c17 OK log
2024/04/18 23:09 2h20m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git f99c5f563c17 report log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.11.0-syzkaller-10555-gbcd28cfd04eb #0 Not tainted
--------------------------------------------
syz-executor268/5243 is trying to acquire lock:
ffff88802abb91e0 (&qs->lock){..-.}-{2:2}, at: __stack_map_get+0x14b/0x4b0 kernel/bpf/queue_stack_maps.c:140

but task is already holding lock:
ffff88802abb81e0 (&qs->lock){..-.}-{2:2}, at: __stack_map_get+0x14b/0x4b0 kernel/bpf/queue_stack_maps.c:140

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-executor268/5243:
 #0: ffffffff8ea171e8 (pcpu_alloc_mutex){+.+.}-{3:3}, at: pcpu_alloc_noprof+0x27f/0x16e0 mm/percpu.c:1795
 #1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline]
 #1: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2359
 #2: ffff88802abb81e0 (&qs->lock){..-.}-{2:2}, at: __stack_map_get+0x14b/0x4b0 kernel/bpf/queue_stack_maps.c:140
 #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:337 [inline]
 #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
 #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2317 [inline]
 #3: ffffffff8e937ee0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2359

stack backtrace:
CPU: 1 UID: 0 PID: 5243 Comm: syz-executor268 Not tainted 6.11.0-syzkaller-10555-gbcd28cfd04eb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
 __stack_map_get+0x14b/0x4b0 kernel/bpf/queue_stack_maps.c:140
 bpf_prog_9e8ebb70d9ac7f8d+0x45/0x49
 bpf_dispatcher_nop_func include/linux/bpf.h:1257 [inline]
 __bpf_prog_run include/linux/filter.h:701 [inline]
 bpf_prog_run include/linux/filter.h:708 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2318 [inline]
 bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2359
 __traceiter_contention_end+0x7b/0xb0 include/trace/events/lock.h:122
 trace_contention_end+0x114/0x140 include/trace/events/lock.h:122
 __pv_queued_spin_lock_slowpath+0xb7e/0xdb0 kernel/locking/qspinlock.c:557
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
 queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 do_raw_spin_lock+0x272/0x370 kernel/locking/spinlock_debug.c:116
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xe1/0x120 kernel/locking/spinlock.c:162
 __stack_map_get+0x14b/0x4b0 kernel/bpf/queue_stack_maps.c:140
 bpf_prog_9e8ebb70d9ac7f8d+0x45/0x49
 bpf_dispatcher_nop_func include/linux/bpf.h:1257 [inline]
 __bpf_prog_run include/linux/filter.h:701 [inline]
 bpf_prog_run include/linux/filter.h:708 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2318 [inline]
 bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2359
 __traceiter_contention_end+0x7b/0xb0 include/trace/events/lock.h:122
 trace_contention_end+0xf5/0x120 include/trace/events/lock.h:122
 __mutex_lock_common kernel/locking/mutex.c:617 [inline]
 __mutex_lock+0x2e5/0xd70 kernel/locking/mutex.c:752
 pcpu_alloc_noprof+0x27f/0x16e0 mm/percpu.c:1795
 bpf_prog_alloc_no_stats+0x10d/0x4b0 kernel/bpf/core.c:113
 bpf_prog_alloc+0x3a/0x1b0 kernel/bpf/core.c:145
 bpf_prog_load+0x7f7/0x20f0 kernel/bpf/syscall.c:2756
 __sys_bpf+0x4ee/0x810 kernel/bpf/syscall.c:5634
 __do_sys_bpf kernel/bpf/syscall.c:5741 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5739 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5739
 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:0x7f2ff4c52e69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffa41c8b58 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2ff4c52e69
RDX: 0000000000000090 RSI: 0000000020000a40 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 00000000000000a0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (49):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/05 01:47 bpf bcd28cfd04eb d7906eff .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/05/11 05:05 bpf 3e9bc0472b91 9026e142 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/04/15 11:26 net f99c5f563c17 c8349e48 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __stack_map_get
2024/04/14 19:51 bpf 443574b03387 c8349e48 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/10/22 05:04 bpf-next d39100d01ce1 a93682b3 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/31 23:22 bpf-next 3f8fde319524 3113787f .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/14 18:22 net-next 5c1672705a1a fdb4c10c .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __stack_map_get
2024/11/07 16:16 upstream ff7afaeca1a1 c069283c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in __stack_map_get
2024/09/09 09:35 upstream da3ea35007d0 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in __stack_map_get
2024/06/24 14:41 upstream f2661062f16b edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in __stack_map_get
2024/06/24 14:40 upstream f2661062f16b edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in __stack_map_get
2024/04/25 10:15 upstream e88c4cfcb7b8 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in __stack_map_get
2024/04/25 03:19 upstream e88c4cfcb7b8 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in __stack_map_get
2024/09/07 13:23 upstream b31c44928842 9750182a .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __stack_map_get
2024/09/09 17:10 upstream da3ea35007d0 8f722c94 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __stack_map_get
2024/06/15 20:34 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __stack_map_get
2024/06/15 08:46 upstream 2ccbdf43d5e7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __stack_map_get
2024/09/18 00:20 bpf b831f83e40a2 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/07/27 12:00 bpf 225990c487c1 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/06/24 14:38 net 058722ee350c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __stack_map_get
2024/06/24 14:38 net 058722ee350c edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __stack_map_get
2024/06/15 07:51 bpf 36534d3c5453 8d849073 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/06/11 08:13 bpf 93792130a938 048c640a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/05/26 11:34 bpf 95348e463eab a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/05/04 04:00 bpf 3e9bc0472b91 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/04/27 23:21 net b2ff42c6d3ab 07b455f9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __stack_map_get
2024/04/20 11:09 bpf 443574b03387 af24b050 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __stack_map_get
2024/09/23 08:09 net-next 151ac45348af 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __stack_map_get
2024/08/09 07:43 net-next 91d516d4de48 61405512 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __stack_map_get
2024/08/05 07:49 net-next 3608d6aca5e7 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __stack_map_get
2024/07/21 06:02 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/07/18 16:06 net-next 51835949dda3 7403ec00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __stack_map_get
2024/06/24 14:39 bpf-next 5a532459aa91 edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/06/24 02:34 bpf-next 5a532459aa91 edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/06/23 15:58 net-next 84562f9953ec edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __stack_map_get
2024/06/18 13:03 bpf-next f6afdaf72af7 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/26 11:30 bpf-next f980f13e4eb2 a10a183e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/24 20:37 net-next 4b377b4868ef 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __stack_map_get
2024/05/16 04:09 bpf-next 5c1672705a1a ef5d53ed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/15 01:35 bpf-next 5c1672705a1a fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/14 18:32 bpf-next 5c1672705a1a fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/14 16:13 bpf-next 5c1672705a1a fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/13 15:08 bpf-next ba39486d2c43 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/13 01:30 bpf-next 20a759df3bba 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/11 05:05 bpf-next fcd1ed89a043 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/10 14:34 bpf-next fcd1ed89a043 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/09 16:36 bpf-next 009367099eb6 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __stack_map_get
2024/05/15 21:18 linux-next 82d92a9a1b9e 0b3dad46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in __stack_map_get
* Struck through repros no longer work on HEAD.