Re: [PATCH net-next] net: ethernet: drop skbs with a short linear part in eth_type_trans()

Eric Dumazet <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-kernel
Message-ID <CANn89iKHSfHhrDVVsyFcu+dDwx9GM-Zc0e+p519-ERaRJ9ojdQ@mail.gmail.com>
On Mon, Aug 10, 2026 at 9:59 AM Pengfei Zhang <[email protected]> wrote:
>
> On Fri, Aug 7, 2026 at 6:52 PM Eric Dumazet <[email protected]> wrote:
> > This is obviously a wrong patch. Please fix  faulty drivers instead of
> > adding more code in our fast path.
> >
> > If you use header split, you are supposed to use modern NAPI api, like
> > napi_gro_frags() which will take care of that.
>
> Thanks for the review.
>
> I put the test in eth_type_trans() because I thought the stack should not
> be brought down by a driver handing it a malformed skb.  I take your point
> about the cost on the fast path, and that napi_gro_frags() already takes
> care of this.
>
> I will drop the patch.  I do not have amd-xgbe or dwc-xlgmac hardware, so
> I will not send an untested driver change; if I can get access to a device
> that behaves this way, I will fix and verify the driver there.

This function is primarily used by Ethernet drivers.

An Ethernet frame must at least contain an Ethernet header.

A frame smaller than that should be dropped early by the NIC.

If a NIC and/or driver provides the upper stack a packet without an
Ethernet header,
the bug is on them.

Let's not add checks in our fast path for a situation that should never happen.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.