[PATCH net v5] net: stmmac: Prevent DSA tags from breaking COE
Romain Gantois
romain.gantois at bootlin.com
Tue Jan 16 04:14:15 PST 2024
Hi Jakub,
On Fri, 12 Jan 2024, Jakub Kicinski wrote:
> > @@ -4997,7 +5020,7 @@ static void stmmac_dispatch_skb_zc(struct stmmac_priv *priv, u32 queue,
> > stmmac_rx_vlan(priv->dev, skb);
> > skb->protocol = eth_type_trans(skb, priv->dev);
> >
> > - if (unlikely(!coe))
> > + if (unlikely(!coe) || !stmmac_has_ip_ethertype(skb))
>
> The lack of Rx side COE checking in this driver is kinda crazy.
> Looking at enh_desc_coe_rdes0() it seems like RDES0_FRAME_TYPE
> may be the indication we need here?
I don't think that RDES0_FRAME_TYPE would be enough, at least not on its own.
That bit is set by checking the length/ethertype field to see if is an
Ethernet II frame or an IEEE802.3 frame. But even Ethernet II frames with non-IP
ethertypes will not be checksummed. Also protocols with a non-fixed ethertype
field such as DSA_TAG_PROTO could trigger the bit, or not, depending on what
they put in the DSA tag.
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the linux-arm-kernel
mailing list