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=1796381248; b=zTN2hietI++AZRBfPSPsHoW/7RsBj7/E3AYlqeM7tclCk+5oVgLSMaXDpXAguOvs9u9s fWcr0vVcF0gHrUHy7unLehsOGfm3LXXjb5auj7ca1/R3MwFewhlTCyhlO7i0UQ+YprWEx 1jNa1WpoxALNUaYccL26HUieTveYImIG+Uxuwg3pTJwyMlgZN6uod4qpLv/S+up/plopj mjLF/gX1Xx29jdTe/iJV3h1Nn8tLTEH1vMV1F3smBoZH/qEsKk8sQvJR317suxiBWUF0y LVMNaEgOOPjQRMScvrIyXDv/tRZ1Qqba62Dt8+ArjJvpLf4LBOnzelhSTfcul6Zgfww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381248; 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=KZ+T+cgiJcnMBbmYHDc0Vfn8PfVuuZY7cma433XAAdk=; b=YqQ+gLYVlnqUXGlAc/0cLEifoz/EnD1aCJlwJesIoR5dDIsLJ/7KZOLObiIBliyvVnGv LQqVrEOPCzprWw05dtYZ6wed+ZDK+fcqiKqT1YgtEQpFkuTX27NF331iSbLK4F7TEpkFz dU9qeqCuxJp5eMFy1BwWW4Ob7m9D12DK1aORiT6RmnkSmccx00srXrWC2hjyJxwgYadUP A7DhH8lzzo4pq4JgJy0uB+b4Xi/QMcpHkQMtUKuqb+/hOYM+mvw3yv1Yx5dToQpsEEedm z3fTaIQAq7jtdvCc/Szhq0sjgPeEWZIgR4tYUkMkWr1IEGUTKBAy1ggC7oBxgKYg5Rg== 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=Lkn5klev; 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 DEDF8606A33C; Fri, 4 Dec 2026 10:47:28 +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=Lkn5klev Received: by smtp.kernel.org (Postfix) with ESMTPSA id 599B31F00934; Fri, 4 Dec 2026 10:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381248; bh=KZ+T+cgiJcnMBbmYHDc0Vfn8PfVuuZY7cma433XAAdk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Lkn5klevT0xuVYAewIs7mKsA5PWWge345rKW/IEhf9420hDEjU3F/nXShnTwU8tWI jUTllm38v3oGDRkQvGFqVTUkwuchjLzxqQKG5G6WZcksejDfGYvITP9P7cS5XiPSJe Ifg1kurAObKnMFN6yJGjLf4zjzdaEv+lm9cmLv/Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Anthony Pighin , Daniel Machon , Jakub Kicinski Subject: [PATCH 7.3 624/742] net: gianfar: clear the pending Rx skb when freeing the Rx ring Date: Fri, 4 Dec 2026 19:08:08 +0900 Message-ID: <20261204100651.679530508@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: patches@lists.linux.dev 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: Anthony Pighin commit c35761f43c582460b45429f51be5c2a0f07ed9af upstream. gfar_clean_rx_ring() keeps a frame that spans several Rx buffers in rx_queue->skb between NAPI polls. When the interface is stopped (close, MTU change, reset), free_skb_rx_queue() frees that skb but leaves the pointer set, and nothing clears it when the rings are set up again. After the restart, gfar_clean_rx_ring() picks up the stale pointer. The first buffer it sees has RXBD_FIRST set, so the overrun handling frees the skb a second time. By then the skb has usually been reallocated, so the second free releases another owner's skb and data while they are still in use. Clear rx_queue->skb after freeing it. Hit during development, as intermittent kernel panics in our automated regression on an NXP LS1021A board (eTSEC), in an L2 Ethernet traffic test that shuts and re-enables ports. It was seen on 6.6, 6.12 and 6.18 based kernels, crashing in unrelated places such as kmem_cache_alloc() called from build_skb() in gfar_poll_rx_sq(). With the fix, the same test ran 90 bounces with no warnings or crashes. Fixes: 75354148ce69 ("gianfar: Add paged allocation and Rx S/G") Cc: stable@vger.kernel.org Signed-off-by: Anthony Pighin Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261112143140.1395197-1-anthony.pighin@nokia.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/gianfar.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -1092,6 +1092,7 @@ static void free_skb_rx_queue(struct gfa struct rxbd8 *rxbdp = rx_queue->rx_bd_base; dev_kfree_skb(rx_queue->skb); + rx_queue->skb = NULL; for (i = 0; i < rx_queue->rx_ring_size; i++) { struct gfar_rx_buff *rxb = &rx_queue->rx_buff[i];