[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-KZSrh=5gH-yrtw4kcAjXn4T8Fm7xoik-OcmAWBTQ9BdA@mail.gmail.com>
Date: Fri, 26 Jul 2024 09:49:27 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
pabeni@...hat.com, mst@...hat.com, jasowang@...hat.com, arefev@...mel.ru,
alexander.duyck@...il.com, Willem de Bruijn <willemb@...gle.com>, stable@...r.kernel.org
Subject: Re: [PATCH net] net: drop bad gso csum_start and offset in virtio_net_hdr
On Fri, Jul 26, 2024 at 3:00 AM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Fri, Jul 26, 2024 at 4:34 AM Willem de Bruijn
> <willemdebruijn.kernel@...il.com> wrote:
> >
> > From: Willem de Bruijn <willemb@...gle.com>
>
> ...
>
> > /* Kernel has a special handling for GSO_BY_FRAGS. */
> > diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c
> > index 4b791e74529e1..9e49ffcc77071 100644
> > --- a/net/ipv4/tcp_offload.c
> > +++ b/net/ipv4/tcp_offload.c
> > @@ -140,6 +140,9 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb,
> > if (thlen < sizeof(*th))
> > goto out;
> >
> > + if (unlikely(skb->csum_start != skb->transport_header))
> > + goto out;
> > +
>
> Using skb_transport_header() will make sure DEBUG_NET_WARN_ON_ONCE()
> will fire for debug kernels,
> with no additional costs for non debug kernels (compiler will generate
> not use skb->head at all)
>
> if (unlikely(skb->csum_start != skb_transport_header(skb) - skb->head))
> goto out;
>
> (This will match the corresponding initialization in __tcp_v4_send_check())
Will do, thanks.
Powered by blists - more mailing lists