From: Slava Imameev <slava.imameev@crowdstrike.com>
To: <eddyz87@gmail.com>
Cc: <andrii@kernel.org>, <ast@kernel.org>, <bpf@vger.kernel.org>,
<daniel@iogearbox.net>, <davem@davemloft.net>,
<edumazet@google.com>, <haoluo@google.com>, <horms@kernel.org>,
<john.fastabend@gmail.com>, <jolsa@kernel.org>,
<kpsingh@kernel.org>, <kuba@kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-open-source@crowdstrike.com>, <martin.lau@linux.dev>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>, <sdf@fomichev.me>,
<shuah@kernel.org>, <slava.imameev@crowdstrike.com>,
<song@kernel.org>, <yonghong.song@linux.dev>
Subject: Re: [PATCH bpf-next v4 2/2] selftests/bpf: Add trampolines single and multi-level pointer params test coverage
Date: Wed, 4 Mar 2026 09:14:29 +1100 [thread overview]
Message-ID: <20260303221429.8585-1-slava.imameev@crowdstrike.com> (raw)
In-Reply-To: <24dceff5bf15b6c3e204c69617ac249de497b034.camel@gmail.com>
On Tue, 03 Mar 2026 12:08:44, Eduard Zingerman wrote:
> On Tue, 2026-03-03 at 20:54 +1100, Slava Imameev wrote:
> > Single and multi-level pointer params and return value test coverage
> > for BPF trampolines:
> > - fentry/fexit programs covering struct and void double/triple
> > pointer parameters and return values
> > - verifier context tests covering pointers as parameters, these
> > tests cover single and double pointers to int, enum 32 and 64,
> > void, function, and double pointers to struct, triple pointers
> > for void
> > - verifier context tests covering single and double pointers to
> > float, to check proper error is returned as pointers to float
> > are not supported
> > - verifier context tests covering pointers as return values
> > - verifier context tests for lsm to check trusted parameters
> > handling
> > - verifier context tests covering out-of-bound access after cast
> > - verifier BPF helper tests to validate no change in verifier
> > behavior
> >
> > Signed-off-by: Slava Imameev <slava.imameev@crowdstrike.com>
> > ---
>
> Again, I probably miss a point, but with current implementation it
> seems sufficient in verifier_ctx_ptr_param() to add one or two
> tests accessing void** or similar and checking verification log
> to validate that parameter has expected type scalar().
> Why so many tests are necessary?
This reflects my belief in more comprehensive test coverage.
I can certainly reduce the number of tests if this seems excessive,
but I made 90% of the added tests one-liners to keep them maintainable.
These changes add support for multilevel pointers, so double and
triple pointers need to be checked at minimum. I think adding checks
for any new type support is beneficial. I tried to verify a broader
set of conditions that might be broken by future changes. I tried to
make most tests one-liners to facilitate future modification.
prev parent reply other threads:[~2026-03-03 22:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 9:54 [PATCH bpf-next v4 0/2] bpf: Add multi-level pointer parameter support for trampolines Slava Imameev
2026-03-03 9:54 ` [PATCH bpf-next v4 1/2] bpf: Support new pointer param types via SCALAR_VALUE " Slava Imameev
2026-03-03 20:05 ` Eduard Zingerman
2026-03-03 21:49 ` Slava Imameev
2026-03-03 22:43 ` Eduard Zingerman
2026-03-04 0:22 ` Slava Imameev
2026-03-04 0:36 ` Alexei Starovoitov
2026-03-04 0:38 ` Eduard Zingerman
2026-03-10 12:16 ` Slava Imameev
2026-03-10 18:52 ` Eduard Zingerman
2026-03-11 13:07 ` Slava Imameev
2026-03-11 16:31 ` Eduard Zingerman
2026-03-03 9:54 ` [PATCH bpf-next v4 2/2] selftests/bpf: Add trampolines single and multi-level pointer params test coverage Slava Imameev
2026-03-03 20:08 ` Eduard Zingerman
2026-03-03 22:14 ` Slava Imameev [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=20260303221429.8585-1-slava.imameev@crowdstrike.com \
--to=slava.imameev@crowdstrike.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=haoluo@google.com \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-open-source@crowdstrike.com \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=yonghong.song@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox