syzbot


possible deadlock in queue_stack_map_push_elem

Status: upstream: reported C repro on 2024/04/17 21:25
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+252bc5c744d0bba917e1@syzkaller.appspotmail.com
First crash: 151d, last: 11d
Cause bisection: failed (error log, bisect log)
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bpf?] possible deadlock in queue_stack_map_push_elem 0 (1) 2024/04/17 21:25
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in queue_stack_map_push_elem origin:upstream C 9 25d 154d 0/3 upstream: reported C repro on 2024/04/11 18:39
Last patch testing requests (5)
Created Duration User Patch Repo Result
2024/08/30 20:40 22m retest repro bpf-next report log
2024/08/30 20:40 19m retest repro bpf-next report log
2024/07/05 09:06 19m retest repro bpf report log
2024/07/05 09:06 15m retest repro bpf report log
2024/07/05 09:06 1h42m retest repro bpf report log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.10.0-rc1-syzkaller-00163-gd6301802607b #0 Not tainted
--------------------------------------------
strace-static-x/5093 is trying to acquire lock:
ffff8880234c21d8 (&qs->lock){-.-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210

but task is already holding lock:
ffff8880237cf1d8 (&qs->lock){-.-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210

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 strace-static-x/5093:
 #0: ffff88801f644c68 (&pipe->mutex){+.+.}-{3:3}, at: pipe_write+0x1c9/0x1a40 fs/pipe.c:455
 #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline]
 #1: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2444
 #2: ffff8880237cf1d8 (&qs->lock){-.-.}-{2:2}, at: queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210
 #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline]
 #3: ffffffff8e333f60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2444

stack backtrace:
CPU: 0 PID: 5093 Comm: strace-static-x Not tainted 6.10.0-rc1-syzkaller-00163-gd6301802607b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 check_deadlock kernel/locking/lockdep.c:3062 [inline]
 validate_chain+0x15d3/0x5900 kernel/locking/lockdep.c:3856
 __lock_acquire+0x1346/0x1fd0 kernel/locking/lockdep.c:5137
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5754
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd5/0x120 kernel/locking/spinlock.c:162
 queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210
 bpf_prog_216c997a1f42e404+0x3f/0x43
 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline]
 __bpf_prog_run include/linux/filter.h:691 [inline]
 bpf_prog_run include/linux/filter.h:698 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline]
 bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2444
 __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+0xb81/0xdc0 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
 queue_stack_map_push_elem+0x1b2/0x660 kernel/bpf/queue_stack_maps.c:210
 bpf_prog_216c997a1f42e404+0x3f/0x43
 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline]
 __bpf_prog_run include/linux/filter.h:691 [inline]
 bpf_prog_run include/linux/filter.h:698 [inline]
 __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline]
 bpf_trace_run2+0x2ec/0x540 kernel/trace/bpf_trace.c:2444
 __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
 pipe_write+0x1c9/0x1a40 fs/pipe.c:455
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xa72/0xc90 fs/read_write.c:590
 ksys_write+0x1a0/0x2c0 fs/read_write.c:643
 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:0x4e8593
Code: c7 c2 a8 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18
RSP: 002b:00007ffc9baac2e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 000000000000002b RCX: 00000000004e8593
RDX: 000000000000002b RSI: 0000000001f68140 RDI: 0000000000000002
RBP: 0000000001f68140 R08: 0000000000000007 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000002b
R13: 000000000063f460 R14: 000000000000002b R15: 000000000063f160
 </TASK>

Crashes (50):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/04 13:25 net d6301802607b a1feae05 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/10 22:46 bpf 3e9bc0472b91 f7c35481 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/06 17:43 net a26ff37e624d c035c6de .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/04/27 17:33 bpf b2ff42c6d3ab 07b455f9 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/04/14 09:19 net f99c5f563c17 c8349e48 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/04/13 21:22 bpf 443574b03387 c8349e48 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/19 06:16 bpf-next 6f130e4d4a5f c0f1611a .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/06 08:25 bpf-next a9e7715ce8b3 610f2a54 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/21 05:09 upstream 72ece20127a3 c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in queue_stack_map_push_elem
2024/05/15 16:42 upstream 1b294a1f3561 0b3dad46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in queue_stack_map_push_elem
2024/05/10 21:13 upstream f4345f05c0df f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in queue_stack_map_push_elem
2024/05/07 06:27 upstream ee5b455b0ada c035c6de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in queue_stack_map_push_elem
2024/05/05 00:27 upstream 7367539ad4b0 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in queue_stack_map_push_elem
2024/05/02 05:03 upstream 0106679839f7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in queue_stack_map_push_elem
2024/05/21 01:27 upstream 6e51b4b5bbc0 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in queue_stack_map_push_elem
2024/05/21 01:25 upstream 6e51b4b5bbc0 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in queue_stack_map_push_elem
2024/05/07 12:28 upstream dccb07f2914c cb2dcc0e .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in queue_stack_map_push_elem
2024/05/06 08:30 upstream dd5a440a31fa d884b519 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in queue_stack_map_push_elem
2024/05/06 06:30 upstream b9158815de52 610f2a54 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in queue_stack_map_push_elem
2024/05/06 09:23 upstream dd5a440a31fa d884b519 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in queue_stack_map_push_elem
2024/08/06 13:52 bpf 92c4ee25208d e1bdb00a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/07/18 09:04 bpf 6caf9efaa169 03114f55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/07/14 04:59 bpf 528dd46d0fc3 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/06/09 09:41 bpf d30d0e49da71 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/06/02 13:36 bpf 7d0b3953f6d8 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/21 01:27 net b1fa60ec252f c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/21 01:25 net b1fa60ec252f c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/02 12:25 net 8953285d7bd6 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/02 10:19 net 8953285d7bd6 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/04/30 18:00 bpf b867247555c4 9e0e6af1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/04/14 10:39 bpf 443574b03387 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/09/01 12:11 bpf-next 2ad6d23f465a 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/08/31 00:50 net-next fbdaffe41adc f885a8ff .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/08/16 17:22 bpf-next fdf1c728fac5 76120936 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/08/02 10:19 bpf-next b7ea631b9a79 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/07/29 20:40 bpf-next 7d30b8aa4fc3 5187fc86 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/07/25 05:50 net-next d7e78951a8b8 b24754ac .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/07/19 21:51 net-next 51835949dda3 ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/07/07 16:56 bpf-next fd8db07705c5 bc4ebbb5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/06/21 07:29 net-next a6ec08beec9e dac2aa43 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/06/16 16:34 bpf-next dedf56d775c0 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/18 02:29 net-next 1b294a1f3561 c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/11 01:51 bpf-next fcd1ed89a043 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/08 22:15 bpf-next e612b5c1d3ee 20bf80e1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/08 19:32 bpf-next e612b5c1d3ee 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/08 17:13 bpf-next e612b5c1d3ee 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/06 04:04 bpf-next a9e7715ce8b3 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/05 17:48 bpf-next a9e7715ce8b3 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/04 17:41 bpf-next a9e7715ce8b3 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
2024/05/02 05:00 bpf-next ac2f438c2a85 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in queue_stack_map_push_elem
* Struck through repros no longer work on HEAD.