From: Greg KH <gregkh@linuxfoundation.org>
To: Feng Yang <yangfeng59949@163.com>
Cc: bpf@vger.kernel.org, stable@vger.kernel.org, andrii@kernel.org,
eddyz87@gmail.com, ast@kernel.org, daniel@iogearbox.net,
memxor@gmail.com, martin.lau@linux.dev, song@kernel.org
Subject: Re: [BUG: 6.6.y] bpf fentry hook on _raw_spin_lock_irqsave triggers hard lockup
Date: Wed, 29 Jul 2026 10:29:15 +0200 [thread overview]
Message-ID: <2026072938-broaden-curator-e89d@gregkh> (raw)
In-Reply-To: <20260729075322.628521-1-yangfeng59949@163.com>
On Wed, Jul 29, 2026 at 03:53:22PM +0800, Feng Yang wrote:
> When attaching fentry programs to _raw_spin_lock_irqsave/_raw_spin_unlock_irqrestore on
> the v6.6 kernel and using the BPF ring buffer within BPF programs, we encounter a hard LOCKUP.
>
> Reproducible BPF code is shown below:
>
> static inline int test(void *ctx)
> {
> struct event *event;
>
> event = reserve_buf(sizeof(*event));
> if (!event)
> return 0;
>
> submit_buf(ctx, event, sizeof(*event));
>
> return 0;
> }
>
> SEC("fentry/_raw_spin_lock_irqsave")
> int BPF_PROG(aa)
> {
> return test(ctx);
> }
>
> SEC("fentry/_raw_spin_unlock_irqrestore")
> int BPF_PROG(bb)
> {
> return test(ctx);
> }
>
> We suspect the hard LOCKUP is caused by the call chain:
> aa->test->reserve_buf->_raw_spin_lock_irqsave->_raw_spin_unlock_irqrestore->bb->test->reserve_buf->_raw_spin_lock_irqsave.
>
> Mainline has merged the rqspinlock patchset
> (https://lore.kernel.org/all/20250411101759.4061366-1-memxor@gmail.com/)
> which resolves this issue. Should we backport the fix?
>
> Alternatively, would a fix modeled after this patch
> https://lore.kernel.org/bpf/20201029071925.3103400-3-songliubraving@fb.com/
> as outlined below be viable?
Do not do stable-only patches, that's not how the stable trees work.
Fix the issue in Linus's tree first, and then backport the needed
changes to the older trees.
thanks,
greg k-h
prev parent reply other threads:[~2026-07-29 8:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 7:53 [BUG: 6.6.y] bpf fentry hook on _raw_spin_lock_irqsave triggers hard lockup Feng Yang
2026-07-29 8:29 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026072938-broaden-curator-e89d@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=stable@vger.kernel.org \
--cc=yangfeng59949@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox