From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>, <bpf@vger.kernel.org>
Cc: "Nicholas Carlini" <npc@anthropic.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Emil Tsalapatis" <emil@etsalapatis.com>, <kkd@meta.com>,
<kernel-team@meta.com>
Subject: Re: [PATCH bpf-next v2 1/2] bpf: Verify global subprogs in each sleepability context
Date: Sat, 05 Sep 2026 15:39:32 -0700 [thread overview]
Message-ID: <DL7QSF4BZB1E.3U5O9EBHDN2LE@gmail.com> (raw)
In-Reply-To: <20260905051224.2325381-2-memxor@gmail.com>
On Fri Sep 4, 2026 at 10:12 PM PDT, Kumar Kartikeya Dwivedi wrote:
>
> Record whether each global subprogram is called with either in_sleepable
> value and verify it once for every observed value.
...
> Since a global subprogram may now be verified twice, accumulate both passes
> in subprog_info[].insns_total.
Only after reading the patch carefully I realized that above is saying 'may'.
Just by reading commit log it sounds that all global progs are now verified twice.
Please reword to make it clear that glob progs are verifier in the specific
context when it's actually reachable.
>
> -/* Check if we're in a sleepable context. */
> +/*
> + * This predicate is the inverse of in_rcu_cs(): non-sleepable programs and
> + * every condition that prevents sleeping also provide RCU protection. Global
> + * subprog verification relies on this equivalence to represent the caller's
> + * execution context using only the in_sleepable bit.
> + */
> static inline bool in_sleepable_context(struct bpf_verifier_env *env)
> {
> return !env->cur_state->active_rcu_locks &&
Since it is !in_rcu_cs() let's make it so in the code.
pw-bot: cr
next prev parent reply other threads:[~2026-09-05 22:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 5:12 [PATCH bpf-next v2 0/2] Fix global subprog verification context Kumar Kartikeya Dwivedi
2026-09-05 5:12 ` [PATCH bpf-next v2 1/2] bpf: Verify global subprogs in each sleepability context Kumar Kartikeya Dwivedi
2026-09-05 5:32 ` sashiko-bot
2026-09-05 5:40 ` Kumar Kartikeya Dwivedi
2026-09-05 6:05 ` bot+bpf-ci
2026-09-05 6:13 ` Kumar Kartikeya Dwivedi
2026-09-05 22:39 ` Alexei Starovoitov [this message]
2026-09-11 19:12 ` Eduard Zingerman
2026-09-05 5:12 ` [PATCH bpf-next v2 2/2] selftests/bpf: Test global subprog callback contexts Kumar Kartikeya Dwivedi
2026-09-05 6:05 ` bot+bpf-ci
2026-09-11 20:20 ` Eduard Zingerman
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=DL7QSF4BZB1E.3U5O9EBHDN2LE@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=kernel-team@meta.com \
--cc=kkd@meta.com \
--cc=memxor@gmail.com \
--cc=npc@anthropic.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