[PATCH net v4 0/2] net: atl1c: fix the RX buffer leak on errored frames
From: Federico Musto
Date: Tue Nov 17 2026 - 17:56:43 EST
Patch 2 is v4 of the fix for the skb and the DMA mapping leaked by every
RX frame whose descriptor reports an error. The Sashiko review of v3
pointed out that freeing the buffer there trusts the RFD index and count
written by the device. v4 checks them against the driver's own ring state
first and resets on a mismatch, as alx does for the same descriptor
layout.
Patch 1 is new. It closes the race between the RX poll and the ring reset
of the link-down path, which the same review flagged on v2 and on v3 as
pre-existing but made worse by a free in that window.
The per-patch changelogs are below the "---" of each patch.
Both problems were found by code inspection. Build-tested with W=1 and
sparse on netdev/net: no new warnings, three "restricted __le32" sparse
warnings fewer with patch 2.
The candidate was also runtime-tested with diagnostic instrumentation on
a MikroTik CCR2004-1G-2XS-PCIe, which exposes emulated AR8151 functions,
on a 7.0.14-29-pve kernel. More than 1.5 million RRDs passed the count and
index validation in a single traffic run, with no mismatch. The candidate
survived more than 15 MTU-change resets without an RX poll-wait timeout,
deadlock, Oops or warning. The errored-descriptor path itself was not
exercised, and this is not a test on a physical AR8151 controller.
v3: https://lore.kernel.org/netdev/20261103225218.19206-1-federico@xxxxxxxxxxxxx/
v2: https://lore.kernel.org/netdev/20261102215253.68185-1-federico@xxxxxxxxxxxxx/
v1: https://lore.kernel.org/netdev/20261027115156.17128-1-federico@xxxxxxxxxxxxx/
Federico Musto (2):
net: atl1c: wait for in-flight RX polls before the link-down ring
reset
net: atl1c: free the RX buffer when the descriptor reports an error
.../net/ethernet/atheros/atl1c/atl1c_main.c | 118 +++++++++++-------
1 file changed, 73 insertions(+), 45 deletions(-)
--
2.47.3