BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jakub Sitnicki" <jakub@cloudflare.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next v2 05/14] selftests/bpf: Test skb_ext on cloned skbs
Date: Fri, 11 Sep 2026 15:09:03 +0000	[thread overview]
Message-ID: <20260911150904.44CF61F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260910-bpf-meta-inside-skb-ext-v2-5-0b21e42180b0@cloudflare.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing __msg() macro in __failure verifier tests.
--

commit 3dc92388d2fd6ba878aeec16668062f704faf681
Author: Jakub Sitnicki <jakub@cloudflare.com>

selftests/bpf: Test skb_ext on cloned skbs

This commit adds coverage for skb_ext behavior when an skb is cloned,
using TC mirred and bpf_clone_redirect(). It tests whether extensions are
readable across clones and verifies copy-on-write isolation.

[ ... ]

> diff --git a/tools/testing/selftests/bpf/progs/verifier_skb_ext.c b/tools/testing/selftests/bpf/progs/verifier_skb_ext.c
> index db43f10514001..c2611c9315aa7 100644
> --- a/tools/testing/selftests/bpf/progs/verifier_skb_ext.c
> +++ b/tools/testing/selftests/bpf/progs/verifier_skb_ext.c
> @@ -7,6 +7,51 @@
>  
>  __u64 flags;
>  
> +SEC("tc")
> +__description("skb_ext slice is invalidated by bpf_clone_redirect")
> +__failure

[Severity: Medium]
Should this test include a __msg("...") macro to verify the exact error
string from the verifier?

If the test fails to load due to an unrelated verifier error (such as a
syntax issue, invalid BTF, or missing kfunc declarations), the test loader
merely checks if loading fails for any reason. This can incorrectly report
a PASS, hiding regressions in the specific slice invalidation logic it is
designed to test.

> +int skb_ext_stale_slice_after_clone_redirect(struct __sk_buff *ctx)
> +{
> +	struct bpf_dynptr meta;
> +	__u8 *slice;

[ ... ]

> +	bpf_clone_redirect(ctx, 1, 0);
> +
> +	/* Stale: the clone shares the ext block the slice points into. */
> +	*slice = 0;
> +
> +	return 0;
> +}
> +
> +SEC("tc")
> +__description("skb_ext slice is invalidated when ext is re-opened with F_CREATE")
> +__failure

[Severity: Medium]
Similarly, does this test also need a __msg() macro? 

Without exact error message string verification, the test infrastructure
will pass this test if it fails to load for any reason, rather than
verifying the intended failure reason.

> +int skb_ext_stale_slice_after_recreate(struct __sk_buff *ctx)
> +{
> +	struct bpf_dynptr d1, d2;
> +	__u8 *slice;

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260910-bpf-meta-inside-skb-ext-v2-0-0b21e42180b0@cloudflare.com?part=5

  reply	other threads:[~2026-09-11 15:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 14:02 [PATCH net-next v2 00/14] skb extension for BPF metadata Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 01/14] bpf: Introduce per-packet metadata storage for BPF programs Jakub Sitnicki
2026-09-11 10:19   ` Jiayuan Chen
2026-09-10 14:02 ` [PATCH net-next v2 02/14] bpf: Allow access to bpf_sock_ops_kern->skb Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 03/14] bpf: Make BPF skb extension survive packet scrubbing Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 04/14] selftests/bpf: Add tests for bpf_dynptr_from_skb_ext Jakub Sitnicki
2026-09-11 15:09   ` sashiko-bot
2026-09-10 14:02 ` [PATCH net-next v2 05/14] selftests/bpf: Test skb_ext on cloned skbs Jakub Sitnicki
2026-09-11 15:09   ` sashiko-bot [this message]
2026-09-10 14:02 ` [PATCH net-next v2 06/14] selftests/bpf: Test skb_ext survival across veth and GRE Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 07/14] selftests/bpf: Test skb_ext read from cgroup_skb and sk_filter hooks Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 08/14] selftests/bpf: Test skb_ext read from sock_ops and LSM hooks Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 09/14] selftests/bpf: Test skb_ext read from kfree_skb tracepoint Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 10/14] selftests/bpf: Test skb_ext read from netfilter hook Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 11/14] selftests/bpf: Test skb_ext from LWT in, out, and xmit hooks Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 12/14] selftests/bpf: Test skb_ext read from seg6local End.BPF hook Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 13/14] selftests/bpf: Test skb_ext read from sk_skb stream verdict hook Jakub Sitnicki
2026-09-10 14:02 ` [PATCH net-next v2 14/14] selftests/bpf: Use non-trivial test payload in xdp_context tests Jakub Sitnicki
2026-09-10 15:56 ` [PATCH net-next v2 00/14] skb extension for BPF metadata Alexei Starovoitov
2026-09-11 11:33   ` Jakub Sitnicki
2026-09-12  3:32     ` Alexei Starovoitov

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=20260911150904.44CF61F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jakub@cloudflare.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox