From: sashiko-bot@kernel.org
To: "Nick Hudson" <nhudson@akamai.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v6 6/6] selftests/bpf: tc_tunnel - validate decap GSO and encapsulation state
Date: Tue, 05 May 2026 04:14:31 +0000 [thread overview]
Message-ID: <20260505041431.CD280C2BCB4@smtp.kernel.org> (raw)
In-Reply-To: <20260504101759.3319427-7-nhudson@akamai.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Pointer arithmetic `kskb->head + kskb->end` causes build failures and runtime logic errors on 32-bit kernels.
- [Medium] Missing kernel feature causes test to fail instead of skip, breaking CI on older kernels.
--
commit f73fb4725baa7b601a1b82c32e5095c6b4294f5c
Author: Nick Hudson <nhudson@akamai.com>
selftests/bpf: tc_tunnel - validate decap GSO and encapsulation state
This commit enhances the tc_tunnel selftest to validate post-decap tunnel
state for both GSO and non-GSO packets, and checks IPXIP decap for IPIP/SIT
paths.
> diff --git a/tools/testing/selftests/bpf/progs/test_tc_tunnel.c b/tools/testing/selftests/bpf/progs/test_tc_tunnel.c
> index 7376df405a6b..853bca962910 100644
> --- a/tools/testing/selftests/bpf/progs/test_tc_tunnel.c
> +++ b/tools/testing/selftests/bpf/progs/test_tc_tunnel.c
[ ... ]
> @@ -621,6 +645,11 @@ static int decap_internal(struct __sk_buff *skb, int off, int len, char proto)
> break;
> case IPPROTO_GRE:
> olen += sizeof(struct gre_hdr);
> + if (!bpf_core_enum_value_exists(enum bpf_adj_room_flags,
> + BPF_F_ADJ_ROOM_DECAP_L4_GRE))
> + return TC_ACT_SHOT;
If the kernel is missing support for these new decapsulation flags, will
returning TC_ACT_SHOT cause the test harness to time out and fail the test?
Since selftests often run on older kernels, should missing features gracefully
skip the test instead of failing it to prevent false positives and CI
breakages on stable or LTS branches?
[ ... ]
> @@ -655,6 +688,40 @@ static int decap_internal(struct __sk_buff *skb, int off, int len, char proto)
> if (bpf_skb_adjust_room(skb, -olen, BPF_ADJ_ROOM_MAC, flags))
> return TC_ACT_SHOT;
>
> + kskb = bpf_cast_to_kern_ctx(skb);
> + shinfo = bpf_core_cast(kskb->head + kskb->end, struct skb_shared_info);
Will this arithmetic work correctly on 32-bit kernels?
On 64-bit architectures, sk_buff_data_t is an integer offset, so
kskb->head + kskb->end works. However, on 32-bit platforms, sk_buff_data_t is
a pointer (unsigned char *), making the addition of two pointers invalid C and
causing build failures.
Furthermore, even if cross-compiled with a 64-bit vmlinux.h, adding
kskb->head to an absolute kskb->end pointer would yield an invalid address at
runtime.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260504101759.3319427-1-nhudson@akamai.com?part=6
prev parent reply other threads:[~2026-05-05 4:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 10:17 [PATCH bpf-next v6 0/6] bpf: decap flags and GSO state updates Nick Hudson
2026-05-04 10:17 ` [PATCH v6 1/6] bpf: name the enum for BPF_FUNC_skb_adjust_room flags Nick Hudson
2026-05-04 11:03 ` bot+bpf-ci
2026-05-04 10:17 ` [PATCH v6 2/6] bpf: refactor masks for ADJ_ROOM flags and encap validation Nick Hudson
2026-05-04 11:03 ` bot+bpf-ci
2026-05-04 17:14 ` Willem de Bruijn
2026-05-04 10:17 ` [PATCH v6 3/6] bpf: add BPF_F_ADJ_ROOM_DECAP_* flags for tunnel decapsulation Nick Hudson
2026-05-04 11:03 ` bot+bpf-ci
2026-05-05 4:14 ` sashiko-bot
2026-05-04 10:17 ` [PATCH v6 4/6] bpf: allow new DECAP flags and add guard rails Nick Hudson
2026-05-05 4:14 ` sashiko-bot
2026-05-04 10:17 ` [PATCH v6 5/6] bpf: clear decap state on skb_adjust_room shrink path Nick Hudson
2026-05-04 17:15 ` Willem de Bruijn
2026-05-05 4:14 ` sashiko-bot
2026-05-04 10:17 ` [PATCH v6 6/6] selftests/bpf: tc_tunnel - validate decap GSO and encapsulation state Nick Hudson
2026-05-05 4:14 ` sashiko-bot [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=20260505041431.CD280C2BCB4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=nhudson@akamai.com \
--cc=sashiko@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