Re: [PATCH net v2] net: usb: smsc75xx: reject frames without a full header and FCS

From: Andrew Lunn

Date: Wed Nov 11 2026 - 12:06:05 EST


> + if (unlikely(size < ETH_HLEN + ETH_FCS_LEN)) {
> + netif_dbg(dev, rx_err, dev->net,
> + "size err rx_cmd_a=0x%08x\n",
> + rx_cmd_a);
> + return 0;
> + }

This looks good as far as it goes.

However:

static inline int rx_process(struct usbnet *dev, struct sk_buff *skb)
{
if (dev->driver_info->rx_fixup &&
!dev->driver_info->rx_fixup(dev, skb)) {
/* With RX_ASSEMBLE, rx_fixup() must update counters */
if (!(dev->driver_info->flags & FLAG_RX_ASSEMBLE))
dev->net->stats.rx_errors++;

What is the value of FLAG_RX_ASSEMBLE in flags?

return -EPROTO;
}
// else network stack removes extra byte if we forced a short packet

/* all data was already cloned from skb inside the driver */
if (dev->driver_info->flags & FLAG_MULTI_PACKET)
return -EALREADY;

if (skb->len < ETH_HLEN) {
dev->net->stats.rx_errors++;
dev->net->stats.rx_length_errors++;

Should rx_length_errors also be incremented?

Andrew