syzbot


possible deadlock in __bpf_ringbuf_reserve

Status: upstream: reported C repro on 2024/03/12 16:41
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+850aaf14624dc0c6d366@syzkaller.appspotmail.com
First crash: 136d, last: 52m
Cause bisection: failed (error log, bisect log)
  
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly bpf report (Jul 2024) 0 (1) 2024/07/15 11:52
[syzbot] Monthly bpf report (Jun 2024) 0 (1) 2024/06/12 22:41
[syzbot] [bpf?] possible deadlock in __bpf_ringbuf_reserve 6 (8) 2024/03/13 12:13
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in __bpf_ringbuf_reserve origin:upstream C 37 9d09h 135d 0/3 upstream: reported C repro on 2024/03/08 23:13
Last patch testing requests (3)
Created Duration User Patch Repo Result
2024/03/24 09:45 21m retest repro bpf report log
2024/03/24 09:45 17m retest repro bpf-next report log
2024/03/13 10:46 24m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log

Sample crash report:
============================================
WARNING: possible recursive locking detected
6.9.0-syzkaller-12128-g068648aab72c #0 Not tainted
--------------------------------------------
syz-executor169/5111 is trying to acquire lock:
ffffc90004ab10d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x211/0x4f0 kernel/bpf/ringbuf.c:424

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

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-executor169/5111:
 #0: ffffffff8e3808a8 (tracepoints_mutex){+.+.}-{3:3}, at: tracepoint_probe_register_prio_may_exist+0xbb/0x190 kernel/tracepoint.c:478
 #1: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #1: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #1: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline]
 #1: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2444
 #2: ffffc90004b350d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x211/0x4f0 kernel/bpf/ringbuf.c:424
 #3: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
 #3: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline]
 #3: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline]
 #3: ffffffff8e333e60 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1fc/0x540 kernel/trace/bpf_trace.c:2444

stack backtrace:
CPU: 0 PID: 5111 Comm: syz-executor169 Not tainted 6.9.0-syzkaller-12128-g068648aab72c #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
 __bpf_ringbuf_reserve+0x211/0x4f0 kernel/bpf/ringbuf.c:424
 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:459 [inline]
 bpf_ringbuf_reserve+0x5c/0x70 kernel/bpf/ringbuf.c:451
 bpf_prog_385141c453c15099+0x35/0x5c
 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_begin+0x7b/0xb0 include/trace/events/lock.h:95
 trace_contention_begin+0x117/0x140 include/trace/events/lock.h:95
 __pv_queued_spin_lock_slowpath+0x114/0xdc0 kernel/locking/qspinlock.c:402
 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
 __bpf_ringbuf_reserve+0x211/0x4f0 kernel/bpf/ringbuf.c:424
 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:459 [inline]
 bpf_ringbuf_reserve+0x5c/0x70 kernel/bpf/ringbuf.c:451
 bpf_prog_385141c453c15099+0x35/0x5c
 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_begin+0x7b/0xb0 include/trace/events/lock.h:95
 trace_contention_begin+0xf5/0x120 include/trace/events/lock.h:95
 __mutex_lock_common kernel/locking/mutex.c:610 [inline]
 __mutex_lock+0x147/0xd70 kernel/locking/mutex.c:752
 tracepoint_probe_register_prio_may_exist+0xbb/0x190 kernel/tracepoint.c:478
 bpf_raw_tp_link_attach+0x48b/0x6e0 kernel/bpf/syscall.c:3874
 bpf_raw_tracepoint_open+0x1c2/0x240 kernel/bpf/syscall.c:3905
 __sys_bpf+0x3c0/0x810 kernel/bpf/syscall.c:5729
 __do_sys_bpf kernel/bpf/syscall.c:5794 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5792 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5792
 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:0x7f253d860f29
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:00007ffc7fd5c758 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f253d860f29
RDX: 0000000000000010 RSI: 0000000020000200 RDI: 0000000000000011
RBP: 0000000000000000 R08: 00000000000000a0 R09: 00000000000000a0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>

Crashes (1012):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/31 02:02 net 068648aab72c 34889ee3 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/05/10 17:57 bpf 3e9bc0472b91 f7c35481 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/03/08 17:14 bpf df4793505abd cf82cde1 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/03/08 19:47 bpf-next a27e89673abf cf82cde1 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/12 16:12 upstream 43db1e03c086 eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in __bpf_ringbuf_reserve
2024/07/12 10:17 upstream 8a18fda0febb eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in __bpf_ringbuf_reserve
2024/06/16 07:14 upstream 2ccbdf43d5e7 f429ab00 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in __bpf_ringbuf_reserve
2024/05/28 23:25 upstream e0cce98fe279 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in __bpf_ringbuf_reserve
2024/06/03 05:50 upstream c3f38fa61af7 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in __bpf_ringbuf_reserve
2024/05/10 13:19 upstream 448b3fe5a0ea 375932ce .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in __bpf_ringbuf_reserve
2024/07/22 15:59 bpf 13c9b702e6cb f063dfd9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 14:26 bpf 0be9ae5486cd f063dfd9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 11:33 bpf 0be9ae5486cd f063dfd9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 08:41 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 08:25 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 07:18 net d7e78951a8b8 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 05:33 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 04:14 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 02:59 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/22 00:56 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 20:55 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 16:25 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 14:05 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 12:04 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 10:24 net d7e78951a8b8 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 08:13 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 07:02 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 04:41 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 03:24 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 02:19 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 02:00 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 00:42 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 22:21 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 21:17 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 18:24 net d7e78951a8b8 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 15:14 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 09:56 net d7e78951a8b8 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 02:19 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 01:17 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/19 23:42 bpf 0be9ae5486cd b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/19 22:13 bpf 0be9ae5486cd ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/19 21:11 bpf 0be9ae5486cd ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/19 20:13 bpf 0be9ae5486cd ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/19 18:52 net 4359836129d9 ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/19 17:19 bpf 0be9ae5486cd ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/19 15:06 bpf 6caf9efaa169 ee4e11c8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 23:44 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 22:24 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 19:44 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 10:39 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/21 05:59 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 23:32 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 18:41 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 17:17 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 16:15 bpf-next 0986ac1408ab b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 06:53 bpf-next 51f1bb929647 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/07/20 04:33 bpf-next 51f1bb929647 b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/05/10 14:05 net-next 383eed2de529 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in __bpf_ringbuf_reserve
2024/05/10 16:38 linux-next 75fa778d74b7 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in __bpf_ringbuf_reserve
* Struck through repros no longer work on HEAD.