CVE-2026-139208: net: sparx5: fix tx DCB index drift in fdma xmit
In the Linux kernel, the following vulnerability has been resolved:
net: sparx5: fix tx DCB index drift in fdma xmit
sparx5fdmaxmit() advances dcbindex before checking that the FDMA is done with the DCB, and does not undo the advance when the check fails. Before commit f4aa7e361ae2 ("net: sparx5: use FDMA library for adding DCB's in the tx path") the next DCB was always the one after lastdcb. Since then dcbindex drifts one DCB further away from lastdcb on every failed transmit.
While the ring is full, this drops frames even though completed DCBs sit behind dcbindex. After a run of failures, dcbindex can also land on lastdcb itself. Re-adding lastdcb loses the frame, because the FDMA has already passed the tail of the chain, and that DCB is never completed again.
Fix this by making dcbindex the next DCB to use, and advancing it only after the DCB has been added, as the rx path does. dcbindex and lastdcb now only move together, so dcbindex always points at the DCB after lastdcb.
The issue was found by an AI code review agent. It was reproduced on a sparx5 PCB135 board with a modified kernel that forces 63 consecutive transmit failures. Afterwards, about 1 in 64 frames is lost for good. With the fix, the same test loses no frames.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In sparx5_fdma_xmit(), make dcb_index point to the next DCB to use and advance it only after the DCB has been added.