syzbot


possible deadlock in __bpf_ringbuf_reserve

Status: upstream: reported C repro on 2024/03/08 23:13
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+f85ef54ebfb2b7619272@syzkaller.appspotmail.com
First crash: 269d, last: 6d21h
Bug presence (1)
Date Name Commit Repro Result
2024/03/09 upstream (ToT) 10d48d70e82d C [report] possible deadlock in __bpf_ringbuf_reserve
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in __bpf_ringbuf_reserve bpf C error 1707 9d19h 265d 0/28 upstream: reported C repro on 2024/03/12 16:41
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2024/11/26 16:19 3h02m bisect fix linux-6.1.y OK (0) job log log
2024/10/20 11:45 3h30m bisect fix linux-6.1.y OK (0) job log log
2024/09/19 04:24 1h31m bisect fix linux-6.1.y OK (0) job log log
2024/04/09 05:19 1h54m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.1.90-syzkaller #0 Not tainted
--------------------------------------------
syz-executor322/3563 is trying to acquire lock:
ffffc900042f10d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410

but task is already holding lock:
ffffc90004b290d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410

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

       CPU0
       ----
  lock(&rb->spinlock);
  lock(&rb->spinlock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

4 locks held by syz-executor322/3563:
 #0: ffff88807e6a6d38 (&tsk->futex_exit_mutex){+.+.}-{3:3}, at: futex_cleanup_begin kernel/futex/core.c:1076 [inline]
 #0: ffff88807e6a6d38 (&tsk->futex_exit_mutex){+.+.}-{3:3}, at: futex_exit_release+0x30/0x1e0 kernel/futex/core.c:1128
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312
 #2: ffffc90004b290d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410
 #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
 #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312

stack backtrace:
CPU: 1 PID: 3563 Comm: syz-executor322 Not tainted 6.1.90-syzkaller #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+0x1e3/0x2cb lib/dump_stack.c:106
 print_deadlock_bug kernel/locking/lockdep.c:2983 [inline]
 check_deadlock kernel/locking/lockdep.c:3026 [inline]
 validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812
 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
 lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
 __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410
 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:445 [inline]
 bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:437
 bpf_prog_385141c453c15099+0x2d/0x54
 bpf_dispatcher_nop_func include/linux/bpf.h:989 [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:2273 [inline]
 bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
 __traceiter_contention_begin+0x74/0xa0 include/trace/events/lock.h:95
 trace_contention_begin+0x14f/0x1a0 include/trace/events/lock.h:95
 __pv_queued_spin_lock_slowpath+0x111/0xc50 kernel/locking/qspinlock.c:405
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [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+0x269/0x370 kernel/locking/spinlock_debug.c:115
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
 _raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162
 __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410
 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:445 [inline]
 bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:437
 bpf_prog_385141c453c15099+0x2d/0x54
 bpf_dispatcher_nop_func include/linux/bpf.h:989 [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:2273 [inline]
 bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312
 __traceiter_contention_begin+0x74/0xa0 include/trace/events/lock.h:95
 trace_contention_begin+0x12f/0x170 include/trace/events/lock.h:95
 __mutex_lock_common kernel/locking/mutex.c:605 [inline]
 __mutex_lock+0x143/0xd80 kernel/locking/mutex.c:747
 futex_cleanup_begin kernel/futex/core.c:1076 [inline]
 futex_exit_release+0x30/0x1e0 kernel/futex/core.c:1128
 exit_mm_release+0x16/0x30 kernel/fork.c:1505
 exit_mm+0xa9/0x300 kernel/exit.c:535
 do_exit+0x9f6/0x26a0 kernel/exit.c:856
 do_group_exit+0x202/0x2b0 kernel/exit.c:1019
 __do_sys_exit_group kernel/exit.c:1030 [inline]
 __se_sys_exit_group kernel/exit.c:1028 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f7a91191079
Code: 90 49 c7 c0 b8 ff ff ff be e7 00 00 00 ba 3c 00 00 00 eb 12 0f 1f 44 00 00 89 d0 0f 05 48 3d 00 f0 ff ff 77 1c f4 89 f0 0f 05 <48> 3d 00 f0 ff ff 76 e7 f7 d8 64 41 89 00 eb df 0f 1f 80 00 00 00
RSP: 002b:00007ffc6f345bf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7a91191079
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000
RBP: 00007f7a9120c2b0 R08: ffffffffffffffb8 R09: 00000000000000a0
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7a9120c2b0
R13: 0000000000000000 R14: 00007f7a9120cd20 R15: 00007f7a91162210
 </TASK>

Crashes (47):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/08 20:39 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 __bpf_ringbuf_reserve
2024/03/08 23:12 linux-6.1.y 61adba85cc40 8e75c913 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/08/16 23:53 linux-6.1.y 117ac406ba90 e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/08/16 16:23 linux-6.1.y 117ac406ba90 e1c76ab2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/08/13 09:07 linux-6.1.y 36790ef5e00b 7b0f4b46 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/07/25 07:36 linux-6.1.y 9b3f9a5b12dc d1a1b0ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/07/25 07:35 linux-6.1.y 9b3f9a5b12dc d1a1b0ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/07/25 07:34 linux-6.1.y 9b3f9a5b12dc d1a1b0ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/07/25 07:34 linux-6.1.y 9b3f9a5b12dc d1a1b0ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/07/13 08:29 linux-6.1.y 266ee8e06d5b eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/06/18 17:46 linux-6.1.y eb44d83053d6 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/06/18 17:46 linux-6.1.y eb44d83053d6 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/06/18 17:05 linux-6.1.y eb44d83053d6 639d6cdf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/29 01:12 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/29 01:12 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/29 00:43 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/29 00:43 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/28 19:58 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/28 19:57 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/28 19:36 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/28 19:34 linux-6.1.y 88690811da69 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/26 03:46 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 __bpf_ringbuf_reserve
2024/05/26 03:46 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 __bpf_ringbuf_reserve
2024/05/26 03:07 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 __bpf_ringbuf_reserve
2024/05/14 01:16 linux-6.1.y 909ba1f1b414 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/12 08:41 linux-6.1.y 909ba1f1b414 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/11 09:21 linux-6.1.y 909ba1f1b414 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/10 16:10 linux-6.1.y 909ba1f1b414 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/10 15:52 linux-6.1.y 909ba1f1b414 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/10 15:52 linux-6.1.y 909ba1f1b414 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/10 13:16 linux-6.1.y 909ba1f1b414 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/10 13:07 linux-6.1.y 909ba1f1b414 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/10 13:07 linux-6.1.y 909ba1f1b414 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/10 02:14 linux-6.1.y 909ba1f1b414 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/10 02:11 linux-6.1.y 909ba1f1b414 de979bc2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/09 08:55 linux-6.1.y 909ba1f1b414 05079661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/09 08:55 linux-6.1.y 909ba1f1b414 05079661 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/08 17:29 linux-6.1.y 909ba1f1b414 20bf80e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/08 16:53 linux-6.1.y 909ba1f1b414 20bf80e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/08 16:53 linux-6.1.y 909ba1f1b414 20bf80e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/08 02:31 linux-6.1.y 909ba1f1b414 4cf3f9b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/04 09:42 linux-6.1.y 909ba1f1b414 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
2024/05/03 17:15 linux-6.1.y 909ba1f1b414 dd26401e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in __bpf_ringbuf_reserve
2024/05/03 12:37 linux-6.1.y 909ba1f1b414 dd26401e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf possible deadlock in __bpf_ringbuf_reserve
* Struck through repros no longer work on HEAD.