Re: [PATCH net v3] net: atl1c: free the RX buffer when the descriptor reports an error
From: Federico Musto
Date: Tue Nov 17 2026 - 17:56:45 EST
Thank you for the detailed review. The findings are addressed in a
two-patch v4 series.
The new finding on the device-written RFD count and index is valid. Patch
2/2 now requires rfd_num == 1, rfd_index == rfd_ring->next_to_clean and a
non-NULL skb in the expected slot before unmapping or freeing anything.
On a mismatch it leaves all buffers alone and schedules a reset, following
alx_clean_rx_irq(). Both the good and error paths then use the software
index. The multi-RFD free loop from v3 is removed.
The same validation also rejects rfd_num == 0, so an errored descriptor
with a zero count can no longer be re-read indefinitely.
The pre-existing link-down reset race is addressed by the new patch 1/2.
After netif_carrier_off(), it waits for RX polls already in flight before
resetting the rings. Polls entered later see the carrier off and return
without touching them. napi_disable() is not used because the work item is
not serialized against atl1c_down(); a second disable can deadlock against
the first caller's napi_enable() while holding the netdev instance lock.
The missing dma_rmb() between the valid-bit check and word0, and the
pre-existing raw word3 endian accesses, remain outside this series. They
are independent issues and are left to a separate change rather than
expanding the leak fix further.
Validation on netdev/net:
- git apply --check and git diff --check pass;
- checkpatch --strict reports no errors, warnings or checks;
- baseline and patched W=1 + Sparse builds succeed with no new warnings.
The candidate was also tested with diagnostic instrumentation on a
MikroTik CCR2004-1G-2XS-PCIe, which exposes emulated AR8151 functions.
More than 1.5 million RRDs passed the count and index validation in one
traffic run without a mismatch. The candidate survived more than 15
MTU-change resets without a 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.
pw-bot: cr