[v5.15] possible deadlock in __bpf_ringbuf_reserve (2)

0 views
Skip to first unread message

syzbot

unread,
May 30, 2026, 11:49:35 PM (13 hours ago) May 30
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 241d66fa280c Linux 5.15.208
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=140f3f36580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=479dd17882eeaafdb2b5
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/aa5371307962/disk-241d66fa.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/df72e55b8c3c/vmlinux-241d66fa.xz
kernel image: https://storage.googleapis.com/syzbot-assets/96a6e7e64a47/bzImage-241d66fa.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+479dd1...@syzkaller.appspotmail.com

============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.6.566/6806 is trying to acquire lock:
ffffc900011b6098 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330

but task is already holding lock:
ffffc90003311098 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330

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

3 locks held by syz.6.566/6806:
#0: ffffffff8c31f320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:313
#1: ffffc90003311098 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330
#2: ffffffff8c31f320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:312

stack backtrace:
CPU: 1 PID: 6806 Comm: syz.6.566 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
__lock_acquire+0x1236/0x7d10 kernel/locking/lockdep.c:-1
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:381 [inline]
bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:373
bpf_prog_80ea4633ad9a84fe+0x2d/0x2cc
bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline]
__bpf_prog_run include/linux/filter.h:621 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
BPF_PROG_RUN_ARRAY include/linux/bpf.h:1439 [inline]
trace_call_bpf+0x32d/0x5b0 kernel/trace/bpf_trace.c:127
perf_trace_run_bpf_submit+0x79/0x1c0 kernel/events/core.c:10016
perf_trace_lock+0x301/0x390 include/trace/events/lock.h:39
trace_lock_release include/trace/events/lock.h:58 [inline]
lock_release+0x84a/0x8a0 kernel/locking/lockdep.c:5634
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:158 [inline]
_raw_spin_unlock_irqrestore+0x6d/0x120 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:419 [inline]
__bpf_ringbuf_reserve+0x45e/0x5a0 kernel/bpf/ringbuf.c:368
____bpf_ringbuf_output kernel/bpf/ringbuf.c:456 [inline]
bpf_ringbuf_output+0x65/0x1e0 kernel/bpf/ringbuf.c:446
bpf_prog_c74688a29e5e6c87+0x3f/0x1b8
bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline]
__bpf_prog_run include/linux/filter.h:621 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
bpf_test_run+0x4ae/0x800 net/bpf/test_run.c:119
bpf_prog_test_run_skb+0x9cc/0x1180 net/bpf/test_run.c:674
bpf_prog_test_run+0x31e/0x390 kernel/bpf/syscall.c:3374
__sys_bpf+0x5a5/0x6f0 kernel/bpf/syscall.c:4675
__do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f9cd5abee59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9cd3d18028 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f9cd5d37fa0 RCX: 00007f9cd5abee59
RDX: 0000000000000050 RSI: 00002000000004c0 RDI: 000000000000000a
RBP: 00007f9cd5b54d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9cd5d38038 R14: 00007f9cd5d37fa0 R15: 00007ffd997658f8
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
12:25 AM (13 hours ago) 12:25 AM
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 241d66fa280c Linux 5.15.208
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13b546f2580000
kernel config: https://syzkaller.appspot.com/x/.config?x=353ae28c40b35af5
dashboard link: https://syzkaller.appspot.com/bug?extid=479dd17882eeaafdb2b5
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=167a512e580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12979b5e580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/aa5371307962/disk-241d66fa.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/df72e55b8c3c/vmlinux-241d66fa.xz
kernel image: https://storage.googleapis.com/syzbot-assets/96a6e7e64a47/bzImage-241d66fa.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+479dd1...@syzkaller.appspotmail.com

============================================
WARNING: possible recursive locking detected
syzkaller #0 Not tainted
--------------------------------------------
syz.0.17/4334 is trying to acquire lock:
ffffc90001216098 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330

but task is already holding lock:
ffffc90002ea1098 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330

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

3 locks held by syz.0.17/4334:
#0: ffffffff8c31f320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x9/0x30 include/linux/rcupdate.h:313
#1: ffffc90002ea1098 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330
#2: ffffffff8c31f320 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:312

stack backtrace:
CPU: 0 PID: 4334 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
__lock_acquire+0x1236/0x7d10 kernel/locking/lockdep.c:-1
lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xb0/0x100 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1db/0x5a0 kernel/bpf/ringbuf.c:330
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:381 [inline]
bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:373
bpf_prog_80ea4633ad9a84fe+0x2d/0x9d4
bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
BPF_PROG_RUN_ARRAY include/linux/bpf.h:1439 [inline]
trace_call_bpf+0x2b1/0x5b0 kernel/trace/bpf_trace.c:127
perf_trace_run_bpf_submit+0x79/0x1c0 kernel/events/core.c:10016
perf_trace_lock+0x301/0x390 include/trace/events/lock.h:39
trace_lock_release include/trace/events/lock.h:58 [inline]
lock_release+0x84a/0x8a0 kernel/locking/lockdep.c:5634
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:158 [inline]
_raw_spin_unlock_irqrestore+0x6d/0x120 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:419 [inline]
__bpf_ringbuf_reserve+0x45e/0x5a0 kernel/bpf/ringbuf.c:368
____bpf_ringbuf_output kernel/bpf/ringbuf.c:456 [inline]
bpf_ringbuf_output+0x65/0x1e0 kernel/bpf/ringbuf.c:446
bpf_prog_c74688a29e5e6c87+0x3f/0x520
bpf_dispatcher_nop_func include/linux/bpf.h:888 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
bpf_test_run+0x2a8/0x800 net/bpf/test_run.c:119
bpf_prog_test_run_skb+0x9cc/0x1180 net/bpf/test_run.c:674
bpf_prog_test_run+0x31e/0x390 kernel/bpf/syscall.c:3374
__sys_bpf+0x5a5/0x6f0 kernel/bpf/syscall.c:4675
__do_sys_bpf kernel/bpf/syscall.c:4761 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4759 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4759
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fd13e50be59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc31e92098 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007fd13e784fa0 RCX: 00007fd13e50be59
RDX: 0000000000000050 RSI: 00002000000004c0 RDI: 000000000000000a
RBP: 00007fd13e5a1d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd13e784fac R14: 00007fd13e784fa0 R15: 00007fd13e784fa0
</TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
Reply all
Reply to author
Forward
0 new messages