Re: [PATCH] net: stmmac: guard FCS stripping against runt frames

From: Lorenzo Bianconi

Date: Thu Sep 24 2026 - 04:00:01 EST


> > > @@ -5808,10 +5809,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
> > >
> > > /* ACS is disabled; strip manually. */
> > > if (likely(!(status & rx_not_ls))) {
> > > - if (buf2_len) {
> > > + if (buf2_len >= ETH_FCS_LEN) {
> >
> > I do not think this approach is correct since, at least theoretically, the FCS can be
> > splitted between buf1 and buf2.
>
> We are talking about runt frames here, so less than 64 bytes in
> size. Can such a frame be split over two buffers? What is the minimum
> size of the first buffer?

Why are talking just about runt frames? According to my understanding,
this codebase (at least the one in stmmac_rx()) is executed on all
'last fragments'. Am I missing something?

Regards,
Lorenzo

>
> Andrew

Attachment: signature.asc
Description: PGP signature