From: Eduard Zingerman <eddyz87@gmail.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Emil Tsalapatis <emil@etsalapatis.com>, Tejun Heo <tj@kernel.org>,
kkd@meta.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next v1 3/3] selftests/bpf: Cover generic __uninit kfunc output buffers
Date: Tue, 15 Sep 2026 22:56:36 -0700 [thread overview]
Message-ID: <595090cd29f18845ed00d87f13b49907aa4b4c12.camel@gmail.com> (raw)
In-Reply-To: <20260915141004.1196460-4-memxor@gmail.com>
On Tue, 2026-09-15 at 16:10 +0200, Kumar Kartikeya Dwivedi wrote:
> Exercise scalar, scalar-only struct and sized output buffers, both with
> uninitialized stack storage and with a checkpoint that poisons prior stores.
> Run the accepted programs and check the values written by the kfuncs.
>
> Use the annotation-driven loader to repeat cases with CAP_BPF and
> CAP_NET_ADMIN, but without CAP_PERFMON or CAP_SYS_ADMIN. Prepare module BTF
> before dropping capabilities with __prepare_priv so the cases reach the
> verifier. Cover stack-passed output pointers and outputs following by-value
> arguments in both capability modes.
>
> Cover multiple outputs, an independent output next to a variable-size
> buffer, variable offsets, and write-only maps. Check that read-only maps,
> out-of-bounds outputs, uninitialized aliased inputs, and reads beyond the
> initialized range retain their expected rejection.
>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> ---
I think this is a bit over-enthusiastic on adding more tests.
For the actual fix only the following tests are necessary:
- struct_poisoned_at_checkpoint
- sized_buffer_poisoned_at_checkpoint
- uninitialized_input_alias
Also __prepare_priv is kind of a hack.
It works now, but I don't think libbpf was designed with an idea of
dropping capabilities mid-flight in mind.
...
next prev parent reply other threads:[~2026-09-16 5:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 14:10 [PATCH bpf-next v1 0/3] Fix generic __uninit kfunc output buffers Kumar Kartikeya Dwivedi
2026-09-15 14:10 ` [PATCH bpf-next v1 1/3] bpf: " Kumar Kartikeya Dwivedi
2026-09-15 14:24 ` sashiko-bot
2026-09-15 17:20 ` Amery Hung
2026-09-16 5:19 ` Eduard Zingerman
2026-09-16 16:08 ` Kumar Kartikeya Dwivedi
2026-09-15 14:10 ` [PATCH bpf-next v1 2/3] selftests/bpf: Allow privileged preparation for capability tests Kumar Kartikeya Dwivedi
2026-09-15 15:01 ` bot+bpf-ci
2026-09-15 14:10 ` [PATCH bpf-next v1 3/3] selftests/bpf: Cover generic __uninit kfunc output buffers Kumar Kartikeya Dwivedi
2026-09-15 15:01 ` bot+bpf-ci
2026-09-16 5:56 ` Eduard Zingerman [this message]
2026-09-15 14:14 ` [PATCH bpf-next v1 0/3] Fix " Kumar Kartikeya Dwivedi
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=595090cd29f18845ed00d87f13b49907aa4b4c12.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=emil@etsalapatis.com \
--cc=kernel-team@meta.com \
--cc=kkd@meta.com \
--cc=memxor@gmail.com \
--cc=tj@kernel.org \
/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.