From: sashiko-bot@kernel.org
To: "Weiming Shi" <bestswngs@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v4 2/2] selftests/bpf: cover stale CB after LWT IP encapsulation
Date: Mon, 21 Sep 2026 17:56:47 +0000 [thread overview]
Message-ID: <20260921175647.9F4871F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260921173910.90847-3-bestswngs@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] bpf: bpf_lwt_encap_stale breaks lwt_ip_encap_vxlan test due to auto-loading
--
commit 62bf6da3e832e187b8a03919cec2518d27ebceed
Author: Weiming Shi <bestswngs@gmail.com>
selftests/bpf: cover stale CB after LWT IP encapsulation
This commit adds regression coverage to the LWT IP encapsulation test. It
verifies that the restored protocol control block no longer contains the
inner header's cached option offsets after LWT program execution.
Link: https://lore.kernel.org/bpf/DLKB3UXOH0IS.1UL8NV9HSJFXG@gmail.com/
> diff --git a/tools/testing/selftests/bpf/progs/test_lwt_ip_encap.c b/tools/testing/selftests/bpf/progs/test_lwt_ip_encap.c
> index 4a934fccf8f5b..8b57c7fb7fa8a 100644
> --- a/tools/testing/selftests/bpf/progs/test_lwt_ip_encap.c
> +++ b/tools/testing/selftests/bpf/progs/test_lwt_ip_encap.c
[ ... ]
> @@ -80,6 +83,29 @@ int bpf_lwt_encap_gre6(struct __sk_buff *skb)
> return BPF_LWT_REROUTE;
> }
>
> +SEC("encap_stale")
> +int bpf_lwt_encap_stale(struct __sk_buff *skb)
> +{
[Severity: Medium]
Will this new program cause the existing lwt_ip_encap_vxlan() test to fail
unconditionally?
Since "encap_" is an unknown section name prefix for libbpf, it defaults to
the BPF_PROG_TYPE_UNSPEC program type.
The existing lwt_ip_encap_vxlan() test function relies on
test_lwt_ip_encap__load(skel) to load the skeleton. It manually disables
auto-loading for preexisting programs (like encap_gre and encap_vxlan) but
was not updated to disable auto-loading for this newly added encap_stale
program.
Consequently, libbpf attempts to load it, sees BPF_PROG_TYPE_UNSPEC, and
returns -EINVAL, which immediately fails the lwt_ip_encap_vxlan() test.
Should this program's auto-loading be explicitly disabled in the existing
tests?
> + struct iphdr iph = {};
> +
> + /* Exercise CB restore before post-run invalidation. */
> + if (skb->cb[0])
> + return BPF_DROP;
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260921173910.90847-1-bestswngs@gmail.com?part=2
next prev parent reply other threads:[~2026-09-21 17:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 17:39 [PATCH v4 0/2] bpf: clear stale IPv4 options after LWT encapsulation Weiming Shi
2026-09-21 17:39 ` [PATCH v4 1/2] " Weiming Shi
2026-09-21 17:39 ` [PATCH v4 2/2] selftests/bpf: cover stale CB after LWT IP encapsulation Weiming Shi
2026-09-21 17:56 ` sashiko-bot [this message]
2026-09-21 18:38 ` bot+bpf-ci
2026-09-22 13:37 ` Daniel Borkmann
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=20260921175647.9F4871F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bestswngs@gmail.com \
--cc=bpf@vger.kernel.org \
--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