From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Xu Yunxiang <xyx2021@mail.ustc.edu.cn>
Cc: Willy Tarreau <w@1wt.eu>, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
security@kernel.org, andrii@kernel.org, memxor@gmail.com,
eddyz87@gmail.com, Amery Hung <ameryhung@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] bpf: Invalidate dynptr clones in every call frame on release
Date: Fri, 28 Aug 2026 07:24:09 +0200 [thread overview]
Message-ID: <2026082839-cosmos-whiny-e081@gregkh> (raw)
In-Reply-To: <apESuZfLOKdGsqCx@DESKTOP-F439VFF.localdomain>
On Fri, Aug 28, 2026 at 12:46:49PM +0800, Xu Yunxiang wrote:
> unmark_stack_slots_dynptr() walks clones only in the submitting
> pointer's frame. A program that clones a ringbuf dynptr in a subprog,
> submits the clone, then submits the original in the caller is therefore
> accepted: the caller's STACK_DYNPTR slot is never cleared. The second
> bpf_ringbuf_commit() flips BUSY on an already-committed header and a
> userspace consumer stalls.
>
> Walk every frame and invalidate matching STACK_DYNPTR slots, the same
> per-slot work destroy_if_dynptr_stack_slot() already does in one frame.
> Leave the existing WARN_ON_ONCE(release_reference()) as a swallow: a
> hard -EINVAL would reject legitimate programs that release once in a
> different frame than they acquired (6.6/6.12/6.13), and on 6.14+ the
> second lookup fails because the ref was already deleted.
>
> Depends on "bpf: Invalidate dynptr slices by dynptr_id on release" only
> for the slice helper call inside the new loop; the frame walk is
> independent.
>
> This is the minimal stable equivalent of the cross-frame half of
> 308c7a0ae8859. That refactor is not a viable cherry-pick for stable.
>
> Cc: stable@vger.kernel.org # 6.6.y 6.12.y 6.18.y
>
> Signed-off-by: Xu Yunxiang <xyx2021@mail.ustc.edu.cn>
> ---
> kernel/bpf/verifier.c | 43 +++++++++++++++++++++
> 1 file changed
Same here, you lost the authorship and signed-off-by of the original.
greg k-h
prev parent reply other threads:[~2026-08-28 5:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <apD0GtLd8lXgXD2e@1wt.eu>
2026-08-28 4:46 ` [PATCH 2/2] bpf: Invalidate dynptr clones in every call frame on release Xu Yunxiang
2026-08-28 5:24 ` Greg Kroah-Hartman [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=2026082839-cosmos-whiny-e081@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=memxor@gmail.com \
--cc=security@kernel.org \
--cc=stable@vger.kernel.org \
--cc=w@1wt.eu \
--cc=xyx2021@mail.ustc.edu.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.