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=1796382671; b=LEuGw36lKXO60eFhIZrflPFRPFJIjhIhai4BnSjJzqnXrZTjmEuuannxOBPyg1MGd22r bh8+b0Yjc4c+FVoBO8PlrWpoIfmG1BGAlYFAG1t9OFoWng8+KzTqTS3inQW93x1c4xvT8 Qt6LL5D9Dks3A7IyMaO6P+QsNfgPa3cdnWztM9b9dy9h2kWgzfbsaU04Pq50axIWjuOOl KRZaJj6QwsL8ssRmk5fbonZmAFnCENpWxuQm9lxm9kCzju6Jrp/a4Geo+9Rycv2y7Dcrr QQZZaOEyFFQC2MwwOjA3AAIahM96knnqdE2SVjwckdlo9vnPbpVujsoantBHSnNAnYg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382671; 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=8Jhmbbl+oEGwy1cny7LiVAPSLFcuThfscAI+h911Zqs=; b=rszo60bU3tnBw3l6MuYdj7c5tQJvYnEPXjT8ySHFrHVSaMAplG9TFjkN6iCmVkaPlwXS FQgrN1jkOS/528hMdlR5BaceZE7LaOg3gqkzwJGCHAiwnE+/ba1cr0phhr2cl5MLiUTo9 L7VRiKmfeIdZXk7w5tqHLrzO/z4wWBnwgjtmNdBzI+EVqcHlFSAXLsypbgH/f/zQVsVi+ 9mnnaQxj0B5YTbaykjqkJCMp7ibImthACrAAk7UL2HeE4eQN/8N+RRUbOy5xvACFrQRQe lOaxixZHn3W8a5xFrr0CxJD8Qv0wyeW61mCDk9hOWudz3TlhPUFl356T4pucJJN+IOA== 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=qjcwwzqm; 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 9F91C606A32D; Fri, 4 Dec 2026 11:11:11 +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=qjcwwzqm Received: by smtp.kernel.org (Postfix) with ESMTPSA id C812D1F00931; Fri, 4 Dec 2026 11:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382671; bh=8Jhmbbl+oEGwy1cny7LiVAPSLFcuThfscAI+h911Zqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qjcwwzqmTcIPDRLYmqSvUXsPZ0JleJPRqcERRsGkiSMbiI19bnaRVO7+fm2q2HoxH dUIBGcpnw2PqGOoqrf26pvWw3OcugmZQ7ETEgSRF8Ocbw31bqrQ9M7hOupWLnZL2t+ 1C9DSYA+EUB1RGCnUCS4Y1DRlqADpyGewx2/kyJw= 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 6.18 555/703] net: stmmac: drop the rest of the frame when napi_build_skb() fails Date: Fri, 4 Dec 2026 19:07:34 +0900 Message-ID: <20261204100642.545889029@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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 6.18-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 @@ -5737,7 +5737,7 @@ read_again: buf->page); buf->page = NULL; rx_dropped++; - count++; + error = 1; goto drain_data; } @@ -5773,7 +5773,7 @@ drain_data: if (likely(status & rx_not_ls)) goto read_again; if (!skb) - continue; + goto next; /* Got entire packet into SKB. Finish it. */