[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97fdd70554fd30d8e9d83051ddc9f820a5e45302.camel@infradead.org>
Date: Fri, 25 Jun 2021 20:00:54 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: netdev@...r.kernel.org, Jason Wang <jasowang@...hat.com>,
Eugenio PĂ©rez <eperezma@...hat.com>
Subject: Re: [PATCH v3 4/5] net: tun: fix tun_xdp_one() for IFF_TUN mode
On Fri, 2021-06-25 at 14:43 -0400, Willem de Bruijn wrote:
> On Thu, Jun 24, 2021 at 8:30 AM David Woodhouse <dwmw2@...radead.org> wrote:
> >
> > From: David Woodhouse <dwmw@...zon.co.uk>
> >
> > In tun_get_user(), skb->protocol is either taken from the tun_pi header
> > or inferred from the first byte of the packet in IFF_TUN mode, while
> > eth_type_trans() is called only in the IFF_TAP mode where the payload
> > is expected to be an Ethernet frame.
> >
> > The equivalent code path in tun_xdp_one() was unconditionally using
> > eth_type_trans(), which is the wrong thing to do in IFF_TUN mode and
> > corrupts packets.
> >
> > Pull the logic out to a separate tun_skb_set_protocol() function, and
> > call it from both tun_get_user() and tun_xdp_one().
>
> I think this should be two patches. The support for parsing pi is an
> independent fix.
As things stand, this patch *doesn't* change the pskb_may_pull()
behaviour. I think we should make that unconditional, and can indeed do
so in a separate subsequent patch.
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5174 bytes)
Powered by blists - more mailing lists