From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8F11282F27 for ; Mon, 16 Mar 2026 02:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773627028; cv=none; b=Po6I6dioeZBF7KuI3A970U01+ChAysEgIeFhVXL3SPFkjTvsRA6A0ejGyE5WYKHnSyAjG1xFQmrC8hc8HQ33P47DE4egm9MXz8MkF65+WyDDEjSonOff6+uBGYC9ACgANSQYYgSad/EocaYQ/fIldwmp0A+540VM7Qpuw2MVnro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773627028; c=relaxed/simple; bh=VDfs2ZzZ7PrOeFBVnLQw/hMFYfMhAJiuPwKNIE4+KfQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Q2kqzYhu68sP3zuGy/IrKtcQ5TeSnhIXfLHfDhFGMNEq5NFvoMIq+Bh7DnP5gow158T4yRsdCCw4oO+Fxx8CBQQNp6qh6FxLW1fCD1U9qIQQ/IN3L6311rsECzLNeVTzB+e5kBZTnGyDm8ojcXZJN0HH5SuRxRaVWrrwag58Vlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BJFxpa95; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BJFxpa95" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-35ba2ae4df3so153719a91.2 for ; Sun, 15 Mar 2026 19:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773627027; x=1774231827; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uVE8EHBWMVmiuxrDtBRiYzF9KN88X0W28eYNYUUIxFI=; b=BJFxpa95xssz2hGe+ZpabFKZe4y3Y5Np0FTUuF/d9y5ZNIre/OCu6LtsUM7buBKPxH S/DdppvgoIjOO9zExi+NNowL0Oj4oQ7gqBUErbFpaQRBIOULhO5CAFI538RSBx78uyeN 72V066IpAs6IS503umEHVgdipTYhkL/YVIoljc5oX0723a3Fxxa5BgWr0S3pepAMZ7ze T44tcYEFtL5mYOc8rB7cC6hcrRAziJB88KH6EhXK74It3mU1b4HpRg8cgmF7avrTtis5 UXJudOzxW97FkrtuO3BUdnn1nIkH3i5nvPVJMotSnccRY+a9n7NfcHB7zjLHyzAP6PqX tSxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773627027; x=1774231827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uVE8EHBWMVmiuxrDtBRiYzF9KN88X0W28eYNYUUIxFI=; b=GgNdeot0qtn4euBzAcgEDYC+Y9mb6svQT2FSf3uTFqs4u9Gd6CAZ493cIWFMOuMziN Gcs8N/dy6F1eflcbOSQnVmjj9wcyXQiFzMylxkTwEEpYw61xeM9eia4TtvV84DC4JO73 W11U7unqx9s2aAL3/B+uM7Dxx67/9yf+M95i9OddcfuqUZOlETana/dN7tfWHANCs7HU /uuKVRBHYqS4o81+vLno6pEb8O5iJ/ujtCG9T/dMmYm4ji2v6rRNEXHVp7m2aj6+09TU pQ8RYNxeltNXQokEeMLPrGrHctaO7dh+qsWU8C8uVZheR37DzaDW6X4RFhKVv6fo1kX5 Bmxw== X-Forwarded-Encrypted: i=1; AJvYcCW6EEaUmJCCEiTO+/5Z67nYSD8hVKw8DZjqJX3gqfCdarczUmSWiJuD7Bn+gg0tuBAyCIVUafWDyiPgw+Q=@vger.kernel.org X-Gm-Message-State: AOJu0YzoHVaNIwPY/1Qx3zf+uWN3FXiLGDVJBYoCuMl4No5O6FrF/bPf B5d1R6z8dKj2XhaqaMicA3qb4zBCY+iPa8vl43BswZ7Tg9agggk9o/Re X-Gm-Gg: ATEYQzyvr70bXx8z4O5DKiLcKDI04EpWQDdtD7qrqiETwwha8o72QsV7AsL0MFwHX3x 5evW91ZDS0qtnzLw0cFroT+YkD/YoYTo7iED3JLus9RLEQfMI/LVwrwfzckuQgGw+Xh38KLys6a TrmYD8uj/8VXmlUUZnqlj7/OE2TfFjOkTdRPeDQgWunuquk2XdOKX1sdqYZOX4QZOtW0iAb8uyB S3ydtO1tKOOIRUp69JUP0fpKC9NDbxoxA91LUTlGf4kXDaH/LOm1QuenNkTC9T8qT7bAkmusRmJ jJsWftE3MuHq1cRY9WLLJ7vr3RqU/6nUlHYssV14MwUtgy7uFq21a8VIayxLxWMkMOUe6mBa4sU yuuesWzJOosyYJFFY7/oV94n2/QpBV58SIDErgcujKHYV50LEYjgFnq7R/PB3/qDTD0XpILNTCF 7vYJ14MCA9afxtQcBSluAWST1wvtNPV0vsIT9Gp5bG4D+ibC+wBBCdqiO1PiW4dsaR X-Received: by 2002:a17:90b:4e8b:b0:35b:a53a:7d0b with SMTP id 98e67ed59e1d1-35ba53a7e94mr399741a91.20.1773627026902; Sun, 15 Mar 2026 19:10:26 -0700 (PDT) Received: from luna.turtle.lan (static-23-234-93-211.cust.tzulo.com. [23.234.93.211]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35a02ffdfb7sm17705805a91.14.2026.03.15.19.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2026 19:10:26 -0700 (PDT) From: Sam Edwards X-Google-Original-From: Sam Edwards To: Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Russell King , Maxime Chevallier , Ovidiu Panait , Vladimir Oltean , Baruch Siach , Serge Semin , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sam Edwards Subject: [PATCH 0/3] stmmac crash/stall fixes when under memory pressure Date: Sun, 15 Mar 2026 19:10:06 -0700 Message-ID: <20260316021009.262358-1-CFSworks@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi netdev maintainers, This is a pair of bugfixes for the stmmac driver's receive pipeline. These issues occur when stmmac_rx_refill() does not (fully) succeed, which happens more frequently when free memory is low. The first patch closes Bugzilla bug #221010, where stmmac_rx() can circle around to a still-dirty descriptor (with a NULL buffer pointer), mistake it for a filled descriptor (due to OWN=0), and attempt to dereference the buffer. In testing that patch, I discovered a second issue: starvation of available RX buffers causes the NIC to stop sending interrupts; if the driver stops polling, it will wait indefinitely for an interrupt that will never come. (Note: the first patch makes this issue more prominent -- mostly because it lets the system survive long enough to exhibit it -- but doesn't *cause* it.) The second patch addresses that problem as well. The first two patches are minimal and intended for stable. The third is a general cleanup that removes the `limit` clamp and *solves* the issue of the loop mistaking dirty entries for filled ones, rather than *avoiding* it. Because this final patch changes the range of stmmac_rx_dirty()'s possible return values, it's intended for -next, not stable. I look forward to your feedback, Sam Sam Edwards (3): net: stmmac: Fix NULL deref when RX encounters a dirty descriptor net: stmmac: Prevent indefinite RX stall on buffer exhaustion net: stmmac: Remove stmmac_rx()'s `limit`, check desc validity instead .../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.52.0