From: Federico Musto <federico@rimpianto.com>
To: Chris Snook <chris.snook@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Federico Musto <federico@rimpianto.com>
Subject: [PATCH net v4 0/2] net: atl1c: fix the RX buffer leak on errored frames
Date: Tue, 17 Nov 2026 23:55:19 +0100 [thread overview]
Message-ID: <20261117225521.19689-1-federico@rimpianto.com> (raw)
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@rimpianto.com/
v2: https://lore.kernel.org/netdev/20261102215253.68185-1-federico@rimpianto.com/
v1: https://lore.kernel.org/netdev/20261027115156.17128-1-federico@rimpianto.com/
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
next reply other threads:[~2026-11-17 22:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 22:55 Federico Musto [this message]
2026-11-17 22:55 ` [PATCH net v4 1/2] net: atl1c: wait for in-flight RX polls before the link-down ring reset Federico Musto
2026-11-21 23:18 ` netdev-bot+sashiko
2026-11-17 22:55 ` [PATCH net v4 2/2] net: atl1c: free the RX buffer when the descriptor reports an error Federico Musto
2026-11-21 23:18 ` netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261117225521.19689-1-federico@rimpianto.com \
--to=federico@rimpianto.com \
--cc=andrew+netdev@lunn.ch \
--cc=chris.snook@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox