From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381260; b=Te+LiYFNVIgh1ROneftQIdKlzK8+Ea0pw9q7iiQmUrcivhHsZrTg66pyNDNEdxDdWP1O Aaco5aDxIq0K6hvaxFmQvsGtcgOsYQkAkFQzH6mLiu/QHL4e8NfHxZv/StRsryECodbU7 VLw0TmD1jEuXnvriXTKYbUtBxq5bORCLAigV6u7J01ZB1+dcY/90IhWV7lSPPJL5QrHgI jCMQFJKf79+4hqNtOi6S90XpDTJvfoxfJ+CodJhuSphYu/Pp8vL/cixExYXR7IyC5YupD +El8jWLbDGtFCvDCZ21/yLrxIACoPU4nLthet5KDp0DzmRKuZE3p3JYMywauKnElanA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381260; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=6PlBqlgvaHm6bonqte6sHR7w4zkS4njnpSR6nskxE+0=; b=Sj8efVnj9soQ3KJNRrnoNzWvzIY31vb9v8Mer8Q7DPAHTVX+nqzBYU0cQClgMM8XOwaq 2cJCPNNjPP0DNaewOx+h6p9OH3ha/d5uB0WY9y4l+kXkUEB9lixGjHTRzs/Cj7kGcaSwq An8xZ+OfUHrOXWHpDbGOZybSVoreGGVxWBW3Vytj3CxgEv7MM1aLIStrcPEcThuUuA3H8 NS6G0ShSA+vLVg8WZFXp5PYICn+vUYtMDypARL4OOucfFlp72M958JM1h+N4ivTzL6FfX 2bLTNjdP2+4UYUGp1TRscSUb93NNMFmQbVsnH/IK6O4AUjS3PmZQeYUoSYYo8C+MVwg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jHZ5DkZj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53DC2606A332; Fri, 4 Dec 2026 10:47:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jHZ5DkZj Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA3D71F00897; Fri, 4 Dec 2026 10:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381260; bh=6PlBqlgvaHm6bonqte6sHR7w4zkS4njnpSR6nskxE+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jHZ5DkZjye6Is7P6x47r2TYNR4bCXOm0t+r2ckaXJJ8ZWnrc0VAQ3XIEaGO3nwDA1 pICddsWEd2gRjnFsLHe9rOpKycEo4rRUXtXNNAz8v2vshPmrWkjWz/1vjiAK78+lJk C7JVJCpd0nXt2ztKTfOKAeA2bqCug5mGPPq0ELyg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arun Iyengar , Maxime Chevallier , Jakub Kicinski Subject: [PATCH 7.3 629/742] net: stmmac: drop the rest of the frame when napi_build_skb() fails Date: Fri, 4 Dec 2026 19:08:13 +0900 Message-ID: <20261204100651.809122756@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arun Iyengar commit ece404eac250fc4be7aa4cec82e8c248cca83c28 upstream. If napi_build_skb() fails on the first buffer of a frame that spans several descriptors, stmmac_rx() drops that buffer but goes on with the next descriptor of the same frame as if a new frame started there. The rest of the frame is then passed up the stack as a frame of its own. A frame spans several descriptors when it does not fit in the RX buffers of one descriptor. Mark the frame as errored instead, so that its remaining descriptors are discarded like those of a frame with a receive error. The frame is counted once in rx_dropped and once against the NAPI budget. Found while working on the sun8i EMAC jumbo frame series, where frames over 2032 bytes span several descriptors. Tested on an Orange Pi Zero2 (dwmac-sun8i, MTU 4070), w/ jumbo series and error injection. Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support") Cc: stable@vger.kernel.org Signed-off-by: Arun Iyengar Reviewed-by: Maxime Chevallier Link: https://patch.msgid.link/20261113-stmmac-rx-skb-fail-v1-1-fcaae89f2d2c@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5972,7 +5972,7 @@ read_again: buf->page); buf->page = NULL; rx_dropped++; - count++; + error = 1; goto drain_data; } @@ -6008,7 +6008,7 @@ drain_data: if (likely(status & rx_not_ls)) goto read_again; if (!skb) - continue; + goto next; /* Got entire packet into SKB. Finish it. */