Re: [PATCH net 2/2] ip6_gre: Fix skb_under_panic in __gre6_xmit()

From: Peilin Ye
Date: Thu Apr 14 2022 - 16:09:03 EST


Hi Jakub,

On Thu, Apr 14, 2022 at 01:14:24PM +0200, Jakub Kicinski wrote:
> On Mon, 11 Apr 2022 15:33:00 -0700 Peilin Ye wrote:
> > I couldn't find a proper Fixes: tag for this fix; please comment if you
> > have any sugguestions. Thanks!
>
> What's wrong with
>
> Fixes: 6712abc168eb ("ip6_gre: add ip6 gre and gretap collect_md mode")
>
> ?

Thanks! I will add this in v2 soon.

> > diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> > index b43a46449130..976236736146 100644
> > --- a/net/ipv6/ip6_gre.c
> > +++ b/net/ipv6/ip6_gre.c
> > @@ -733,9 +733,6 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
> > else
> > fl6->daddr = tunnel->parms.raddr;
> >
> > - if (skb_cow_head(skb, dev->needed_headroom ?: tunnel->hlen))
> > - return -ENOMEM;
> > -
> > /* Push GRE header. */
> > protocol = (dev->type == ARPHRD_ETHER) ? htons(ETH_P_TEB) : proto;
> >
> > @@ -763,6 +760,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
> > (TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ);
>
> We should also reject using SEQ with collect_md, but that's a separate
> issue.

Could you explain this a bit more? It seems that commit 77a5196a804e
("gre: add sequence number for collect md mode.") added this
intentionally.

Thanks,
Peilin Ye