public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Nick Hudson <nhudson@akamai.com>, sashiko@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v4 6/6] selftests/bpf: tc_tunnel validate decap GSO state
Date: Thu, 16 Apr 2026 12:46:53 -0700	[thread overview]
Message-ID: <2026416193859.IJ9_.martin.lau@linux.dev> (raw)
In-Reply-To: <20260416124324.B0CE6C2BCAF@smtp.kernel.org>

On Thu, Apr 16, 2026 at 12:43:24PM +0000, sashiko-bot@kernel.org wrote:
> Sashiko AI review found 3 potential issue(s):

> - [Low] Invalid pointer arithmetic (`kskb->head + kskb->end`) causes a compilation failure on 32-bit architectures.

> > @@ -655,6 +684,35 @@ 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 cause a compilation failure on 32-bit architectures?
> 
> On 32-bit architectures without NET_SKBUFF_DATA_USES_OFFSET, sk_buff::end
> is defined as a pointer (unsigned char *) rather than an offset. Adding two
> pointers is an invalid operation in C and will result in a build error.

Other tests have been using it to get shinfo already. I would leave it as is.
If it really would be needed to run and compile on 32-bit in the future,
it could use bpf_core_field_size(kskb->end) and then do things differently.

      reply	other threads:[~2026-04-16 19:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16  7:55 [PATCH bpf-next v4 0/6] bpf: decap flags and GSO state updates Nick Hudson
2026-04-16  7:55 ` [PATCH bpf-next v4 1/6] bpf: name the enum for BPF_FUNC_skb_adjust_room flags Nick Hudson
2026-04-16 10:02   ` sashiko-bot
2026-04-16 14:18     ` Alexei Starovoitov
2026-04-17 11:44       ` Hudson, Nick
2026-04-16  7:55 ` [PATCH bpf-next v4 2/6] bpf: refactor masks for ADJ_ROOM flags and encap validation Nick Hudson
2026-04-16  7:55 ` [PATCH bpf-next v4 3/6] bpf: add BPF_F_ADJ_ROOM_DECAP_* flags for tunnel decapsulation Nick Hudson
2026-04-16  7:55 ` [PATCH bpf-next v4 4/6] bpf: allow new DECAP flags and add guard rails Nick Hudson
2026-04-16  7:55 ` [PATCH bpf-next v4 5/6] bpf: clear decap tunnel GSO state in skb_adjust_room Nick Hudson
2026-04-16  8:34   ` bot+bpf-ci
2026-04-16 12:03   ` sashiko-bot
2026-04-16 12:32   ` Willem de Bruijn
2026-04-17 12:27     ` Hudson, Nick
2026-04-16  7:55 ` [PATCH bpf-next v4 6/6] selftests/bpf: tc_tunnel validate decap GSO state Nick Hudson
2026-04-16 12:33   ` Willem de Bruijn
2026-04-16 12:43   ` sashiko-bot
2026-04-16 19:46     ` Martin KaFai Lau [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=2026416193859.IJ9_.martin.lau@linux.dev \
    --to=martin.lau@linux.dev \
    --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