CVE-2026-143344: net: stmmac: drop multi-buffer frames in XDP mode
In the Linux kernel, the following vulnerability has been resolved:
net: stmmac: drop multi-buffer frames in XDP mode
stmmacrx() runs the XDP program once per descriptor buffer and uses skb == NULL as the only marker for the start of a frame. A frame larger than one buffer is split by the hardware across several descriptors; GMAC4 enables jumbo frames unconditionally (GMACCONFIGJE in GMACCOREINIT), so an on-link peer can deliver such a frame even when the interface MTU is left at 1500.
When an XDP verdict ends a non-last descriptor, skb is cleared and the next descriptor of the same hardware frame is parsed as a new frame. For XDPCONSUMED this happens via readagain with len preserved, so stmmacrxbuf1len() then returns min(dmabufsz, plen - len) for the last descriptor, which can be as small as 0-3 bytes. buf1len -= ETHFCSLEN underflows and xdppreparebuff() puts dataend far past data; on XDPPASS this produces an skb whose length is close to 4G that reaches the network stack (skb->tail and skb->len are 32-bit and wrap below skb->end, so skboverpanic() does not fire). A 4+ byte tail is instead offered to the XDP program and delivered as a standalone mid-payload Ethernet frame on XDPPASS. XDPTX/XDPREDIRECT instead falls through to the next iteration, resetting the running length, so the tail is re-parsed as a full-size new frame.
The same fault exists when a single descriptor uses its second buffer: buffer2 is now handed to the hardware for non-SPH frames on GMAC4/XGMAC, so a frame up to 2 dmabufsz can land on a single descriptor while the XDP program still only sees the first buffer. XDPTX then transmits a truncated frame, and XDPPASS appends the second buffer only after the program has already run over the first one.
XDP does not support scatter-gather frames until the multi-buffer rework, so drop the whole frame instead. When a non-last descriptor is seen while an XDP program is attached, mark the frame as errored and drain the remaining descriptors, including the last. A descriptor that uses its second buffer is dropped directly before the program runs as well; in XDP mode it is necessarily the last descriptor of the frame, so it does not need the error marker. Removing the re-parse lets both XDP verdict branches simply complete the packet via next.
The buffers consumed by the discard path are no longer returned to the page pool, and the new SG and second-buffer drops do not return them either. They stay in rxq->bufpool[] and stmmacrxrefill() reuses them in place, allocating only when a slot is empty. This is safe because the drop checks run before the buffer is synced for CPU access or prefetched. The discard-path change and the in-place reuse apply with or without an XDP program attached.
The !error guard on the discard check also changes the accounting for errored multi-descriptor frames on dwmac100/dwmac1000: rxerrors is incremented once per frame instead of once per descriptor. This too is independent of XDP mode.
Note: the subsequent "net: stmmac: rework stmmacrx to support XDP rx multi-buff" accumulates the whole frame into a single xdpbuff and supersedes this patch; the fix is kept so the net portion of the series stands on its own.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.66 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.7
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux kernel stmmac Ethernet driver with XDP mode enabled are exposed. An on-link peer can trigger the condition by sending a frame that the hardware splits across multiple receive descriptors, including jumbo frames even when the interface MTU remains 1500.
Does exploitation require local access or elevated privileges?
The described trigger is network-reachable from an on-link peer; the attacker needs to be able to deliver crafted multi-buffer Ethernet frames to the affected interface. The provided data does not state that local access or privileges are required.
What can happen when a malformed multi-buffer frame is processed?
Depending on the XDP verdict, the driver can create an skb with a length close to 4 GB and pass it to the network stack, or present a 4+ byte mid-payload tail as a separate Ethernet frame to the XDP program and network stack. This results from an underflow when the final descriptor has too little data after the Ethernet FCS is removed.
What is a practical mitigation if the kernel fix cannot be deployed immediately?
Disable XDP mode on affected stmmac interfaces to avoid the vulnerable receive path. Limiting exposure to untrusted on-link peers also reduces the ability to deliver the triggering frames.