Re: [syzbot] [net?] WARNING in mpls_gso_segment

From: Eric Dumazet
Date: Thu Feb 22 2024 - 08:27:51 EST


On Thu, Feb 22, 2024 at 1:57 PM Florian Westphal <fw@xxxxxxxxx> wrote:
>
> Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
> > I was thinking about adding a debug check in skb_inner_network_header(skb)
> > if inner_network_header is zero (that would mean it is not 'set' yet),
> > but this would trigger even after your patch.
>
> What about adding:
>
> static inline bool skb_inner_network_header_was_set(const struct sk_buff *skb)
> {
> return skb->inner_network_header > 0;
> }
>
> ... and using that instead of checking for negative header length
> post-subtraction?

SGTM