Netdev List
 help / color / mirror / Atom feed
From: "Gajdos Tamás" <tamas@rimpianto.com>
To: netdev@vger.kernel.org
Cc: "Chris Snook" <chris.snook@gmail.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Gatis Peisenieks" <gatis@mikrotik.com>,
	linux-kernel@vger.kernel.org,
	"Gajdos Tamás" <tamas@rimpianto.com>
Subject: [PATCH 0/3] net: atl1c/atl1e/atl1: fix soft lockup on out-of-range tx consumer index
Date: Mon, 21 Sep 2026 11:13:31 +0200	[thread overview]
Message-ID: <20260921091334.3571525-1-tamas@rimpianto.com> (raw)

atl1c_clean_tx() reads a hardware-maintained tx consumer index and
walks a software index towards it:

    while (next_to_clean != hw_next_to_clean) {
            ...
            if (++next_to_clean == tpd_ring->count)
                    next_to_clean = 0;
    }

next_to_clean only ever takes values in [0, tpd_ring->count). If the
hardware read returns a value outside that range - seen as 0xffff
while the PCIe link/MAC is resetting, e.g. during a neighboring
device's reboot - the loop condition can never become false, and the
NAPI thread spins forever. This produced a real soft lockup on
current hardware:

    watchdog: BUG: soft lockup - CPU#12 stuck for 354s! [napi/eth%d-0]
    RIP: 0010:atl1c_clean_tx+0x142/0x2d0 [atl1c]

Patch 1 fixes this in atl1c. atl1e and atl1 (atlx) share the exact
same loop shape, reading their own hardware-maintained consumer index
with no bounds check either, and are just as reachable from the same
kind of PCIe link event. Patches 2 and 3 apply the same guard to each.

Gajdos Tamás (3):
  net: atl1c: fix soft lockup on out-of-range tpd_cons read
  net: atl1e: fix soft lockup on out-of-range hw_next_to_clean read
  net: atl1: fix soft lockup on out-of-range cmb_tpd_next_to_clean read

 drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 3 +++
 drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 3 +++
 drivers/net/ethernet/atheros/atlx/atl1.c        | 3 +++
 3 files changed, 9 insertions(+)

-- 
2.53.0


             reply	other threads:[~2026-09-21  9:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21  9:13 Gajdos Tamás [this message]
2026-09-21  9:13 ` [PATCH 1/3] net: atl1c: fix soft lockup on out-of-range tpd_cons read Gajdos Tamás
2026-09-21  9:13 ` [PATCH 2/3] net: atl1e: fix soft lockup on out-of-range hw_next_to_clean read Gajdos Tamás
2026-09-21  9:13 ` [PATCH 3/3] net: atl1: fix soft lockup on out-of-range cmb_tpd_next_to_clean read Gajdos Tamás
2026-09-24 10:50 ` [PATCH 0/3] net: atl1c/atl1e/atl1: fix soft lockup on out-of-range tx consumer index patchwork-bot+netdevbpf

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=20260921091334.3571525-1-tamas@rimpianto.com \
    --to=tamas@rimpianto.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chris.snook@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gatis@mikrotik.com \
    --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