Sashiko discussions
 help / color / mirror / Atom feed
* Re: [PATCH bpf-next v4 6/6] selftests/bpf: tc_tunnel validate decap GSO state
       [not found] ` <20260416124324.B0CE6C2BCAF@smtp.kernel.org>
@ 2026-04-16 19:46   ` Martin KaFai Lau
  0 siblings, 0 replies; only message in thread
From: Martin KaFai Lau @ 2026-04-16 19:46 UTC (permalink / raw)
  To: Nick Hudson, sashiko; +Cc: bpf

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-04-16 19:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260416075514.927101-7-nhudson@akamai.com>
     [not found] ` <20260416124324.B0CE6C2BCAF@smtp.kernel.org>
2026-04-16 19:46   ` [PATCH bpf-next v4 6/6] selftests/bpf: tc_tunnel validate decap GSO state Martin KaFai Lau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox