au1000_tx() copies skb->len bytes into a MAX_BUF_SIZE coherent buffer without checking the length. The copy can corrupt neighboring DMA buffers or run beyond the coherent allocation. AF_PACKET with PACKET_VNET_HDR can deliver oversized frames through both plain sendmsg() and PACKET_TX_RING. In packet_snd(), a nonzero virtio GSO type bypasses the MTU checks, even when the supplied gso_size is large enough that virtio_net_hdr_to_skb() leaves the skb non-GSO. Genuine GSO packets can also reach the driver as oversized frames: au1000 has no TSO, and software segmentation using a user-supplied gso_size can produce segments larger than MAX_BUF_SIZE. Drop oversized packets before touching the ring or copying any data, and account them in tx_dropped. Use an IRQ-safe skb free for netpoll. Identified by Sashiko AI review; implementation and validation assisted by OpenAI Codex. An extracted-function harness passed ASan/UBSan checks for 2049- and 4096-byte drops and a 2048-byte accepted frame, as well as TX ring regression cases. MIPS driver compilation and checkpatch passed. Sashiko AI review identified the additional sendmsg and GSO routes; OpenAI Codex assisted source-path verification and message revision. The complete AF_PACKET triggers and hardware operation were not tested. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Florian Fainelli Reviewed-by: Simon Horman --- drivers/net/ethernet/amd/au1000_eth.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c index 5bfafe52020f..2a15cd1f5655 100644 --- a/drivers/net/ethernet/amd/au1000_eth.c +++ b/drivers/net/ethernet/amd/au1000_eth.c @@ -1100,6 +1100,12 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev) int i; unsigned long flags; + if (unlikely(skb->len > MAX_BUF_SIZE)) { + dev->stats.tx_dropped++; + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + netif_dbg(aup, tx_queued, dev, "tx: aup %x len=%d, data=%p, head %d\n", (unsigned)aup, skb->len, skb->data, aup->tx_head); -- 2.53.0