The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Eric Dumazet <edumazet@kernel.org>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	 Wei Fang <wei.fang@nxp.com>, Clark Wang <xiaoning.wang@nxp.com>,
	 Ioana Ciornei <ioana.ciornei@nxp.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 imx@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE
Date: Thu, 19 Nov 2026 10:44:33 +0200	[thread overview]
Message-ID: <av62HrrrRs8qwiHw@skbuf> (raw)
In-Reply-To: <CAL4WiipQ_=cN2+F0wFiMy8Ji-d2tfd6ZuBo3HCYiTEQ6RxF29g@mail.gmail.com>

Hi Eric,

On Thu, Nov 19, 2026 at 01:03:16AM +0100, Eric Dumazet wrote:
> > Bizarrely, enetc is the only affected driver, because the core
> > accidentally protects most other drivers against this bug in
> > gso_features_check(). There, we have this logic that saves the day:
> >
> >         /* NETIF_F_IPV6_CSUM does not support IPv6 extension headers,
> >          * so neither does TSO that depends on it.
> >          */
> >         if (features & NETIF_F_IPV6_CSUM &&
> >             skb_has_ipv6_extension_hdr(skb))
> >                 features &= ~(NETIF_F_IPV6_CSUM | NETIF_F_TSO6 | NETIF_F_GSO_UDP_L4);
> >
> > enetc is the outlier because it only advertises the more complete
> > NETIF_F_HW_CSUM, so for it, this fixup does not clear the NETIF_F_TSO6
> > and NETIF_F_GSO_UDP_L4 bits.
> >
> > [ astute reviewers may ask: what if we disable NETIF_F_IPV6_CSUM at
> >   runtime, via ethtool -k, so as to bypass this fixup, don't we make
> >   all drivers vulnerable?
> >   No, because netdev_fix_features() will trigger the code path which
> >   also prints "Dropping TSO6 features since no CSUM feature.\n".
> >   So TSO skbs will now be segmented in the stack. ]
> >
> > Surveying every driver that uses TSO_HEADER_SIZE:
> >
> >  Driver  | TSO6 | Checksum feature    | Core guard fires? | Verdict
> >  ---------------|---------------------|-------------------|---------
> >  enetc   | yes  | NETIF_F_HW_CSUM     | no                | vulnerable
> >  bnxt    | yes  | NETIF_F_IPV6_CSUM   | yes               | safe
> >  nicvf   | yes  | NETIF_F_IPV6_CSUM   | yes               | safe
> >  otx2    | yes  | NETIF_F_IPV6_CSUM   | yes               | safe
> >  fec     | no   | NETIF_F_IPV6_CSUM   | n/a               | safe
> >  mvneta  | no   | NETIF_F_IPV6_CSUM   | n/a               | safe
> >  mvpp2   | no   | NETIF_F_IPV6_CSUM   | n/a               | safe
> >  mv643xx | no   | NETIF_F_IP_CSUM     | n/a               | safe
> >  dpaa2   | no   | NETIF_F_IPV6_CSUM   | n/a               | safe (*)
> >
> > (*) dpaa2 also uses a fixed-size kmalloc(TSO_HEADER_SIZE) per segment,
> > so the identical overflow would apply if it ever gained NETIF_F_TSO6.
> >
> > The above survey is what influenced the decision to make a localized
> > patch in enetc_features_check() rather than create a huge disturbance in
> > the core, even though, IMO, TSO_HEADER_SIZE is a huge foot gun.
> 
> I should probably rework my series :
> https://lore.kernel.org/netdev/20260403043237.3909226-1-edumazet@google.com/

Do you disagree with my analysis that only enetc risks corruption? I mean,
for a second layer of defense, having tso_features_check() everywhere
TSO_HEADER_SIZE is used probably makes sense, but I opted for a targeted
fix because I couldn't justify it for the other drivers.

  reply	other threads:[~2026-11-19  8:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 23:50 [PATCH v2 net 0/4] ENETC GSO fixes Vladimir Oltean
2026-11-18 23:50 ` [PATCH v2 net 1/4] net: enetc: let core segment GSO skb when TSO would not fit the TX ring Vladimir Oltean
2026-11-18 23:50 ` [PATCH v2 net 2/4] net: enetc: reserve VLAN extension BDs for software TSO Vladimir Oltean
2026-11-18 23:50 ` [PATCH v2 net 3/4] net: enetc: fall back to software TX csum for too long L3 headers Vladimir Oltean
2026-11-18 23:50 ` [PATCH v2 net 4/4] net: enetc: let core segment GSO skb when headers exceed TSO_HEADER_SIZE Vladimir Oltean
2026-11-19  0:03   ` Eric Dumazet
2026-11-19  8:44     ` Vladimir Oltean [this message]
2026-11-19  9:38       ` Eric Dumazet
2026-11-19  9:43         ` Vladimir Oltean
2026-11-19  9:42 ` [PATCH v2 net 0/4] ENETC GSO fixes Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=av62HrrrRs8qwiHw@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wei.fang@nxp.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=xiaoning.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox