From: sashiko-bot@kernel.org
To: "Mike Bazov" <mikeba@sentinelone.com>, bpf@vger.kernel.org
Cc: linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v5 1/5] bpf: Avoid per-CPU private stack in preemptible tracing progs
Date: Tue, 01 Dec 2026 15:46:35 +0000 [thread overview]
Message-ID: <sashiko-outbox-243612@kernel.org> (raw)
In-Reply-To: <20261201-bpf-preempt-v2-r2-v5-1-a6bb30daae35@sentinelone.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] bpf: missing Fixes trailer for commit a76ab5731e32 in commit
message
--
commit b9bc691f12fd2d87c140aae92f53de48b0e0b644
Author: Mike Bazov <mikeba@sentinelone.com>
> bpf: Avoid per-CPU private stack in preemptible tracing progs
>
> A per-CPU private stack is only safe if a program never runs in two
> tasks at once on one CPU. Commit a76ab5731e32 ("bpf: Find eligible
> subprogs for private stack support") gave one to tracing, raw_tp and
> tracepoint programs, but they run preemptibly, and two tasks can
> already be inside one of them on a CPU:
>
> - Two raw_tp dispatchers that tail-call the same handler each pass
> their own per-CPU recursion check, so both tasks run the handler.
> - A tracepoint program attached to a syscall tracepoint and to a
> regular tracepoint can be entered by a second task through the
> regular one, which only checks bpf_prog_active.
>
> The second task then overwrites the preempted task's stack. Neither case
> can be seen when the program is loaded, so never give these program
> types a private stack.
>
> check_recursion() told tracing programs apart by whether they can get a
> private stack. Make it check the program type instead, so that
> recursive subprograms stay rejected in these program types.
>
> Move the selftests that relied on these program types having a private
> stack to kprobe.multi and perf_event programs. The stack argument test
> keeps a raw_tp copy, which still runs the program.
>
> Trade-offs:
>
> - These programs use the kernel stack again.
> - A program with two 2000-byte frames no longer loads: "combined stack
> size of 2 calls is 4000. Too large".
> - Unwinding on a private stack is no longer tested at run time: raw_tp
> was the only such program type that BPF_PROG_TEST_RUN runs.
>
> Signed-off-by: Mike Bazov <mikeba@sentinelone.com>
[Severity: Low]
Should this bug fix include a Fixes tag for the commit that enabled
private stacks for these program types:
Fixes: a76ab5731e32 ("bpf: Find eligible subprogs for private stack support")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-bpf-preempt-v2-r2-v5-0-a6bb30daae35@sentinelone.com?part=1
next prev parent reply other threads:[~2026-12-01 15:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 15:32 [PATCH bpf-next v5 0/5] bpf: Check recursion per task for preemptible programs Mike Bazov
2026-12-01 15:32 ` Mike Bazov via B4 Relay
2026-12-01 15:32 ` [PATCH bpf-next v5 1/5] bpf: Avoid per-CPU private stack in preemptible tracing progs Mike Bazov
2026-12-01 15:32 ` Mike Bazov via B4 Relay
2026-12-01 15:46 ` sashiko-bot [this message]
2026-12-01 15:32 ` [PATCH bpf-next v5 2/5] bpf: Mark programs that keep per-CPU state Mike Bazov
2026-12-01 15:32 ` Mike Bazov via B4 Relay
2026-12-01 15:32 ` [PATCH bpf-next v5 3/5] bpf: Check program recursion per task via bpf_ctx Mike Bazov
2026-12-01 15:32 ` Mike Bazov via B4 Relay
2026-12-01 16:05 ` sashiko-bot
2026-12-01 17:19 ` Mike Bazov
2026-12-01 21:12 ` Alexei Starovoitov
2026-12-01 15:32 ` [PATCH bpf-next v5 4/5] bpf: Remove the per-CPU recursion counter of programs Mike Bazov
2026-12-01 15:32 ` Mike Bazov via B4 Relay
2026-12-01 15:32 ` [PATCH bpf-next v5 5/5] selftests/bpf: Add preemption recursion test for tracing programs Mike Bazov
2026-12-01 15:32 ` Mike Bazov via B4 Relay
2026-12-01 21:10 ` [PATCH bpf-next v5 0/5] bpf: Check recursion per task for preemptible programs patchwork-bot+netdevbpf
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=sashiko-outbox-243612@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mikeba@sentinelone.com \
--cc=sashiko-reviews@lists.linux.dev \
/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.