From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC0393016E1; Thu, 28 May 2026 20:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000887; cv=none; b=AEZqi6HpJUUg6kKeaBo8tGWdfnryvhE/qNVD0kR7yIkCGAkW65iMMHRU7A7fLE/ht2WjRCvOw98JSEyM6F3TjlDN2cwgy3W1HQRRML9JNoOihdaSJZy8eNUOeOGPFInQByYKgzjgGqHu8+81PCXtXg4pePDh82ZTnYr1UVE4UhE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000887; c=relaxed/simple; bh=j8ENg+WqXxSKMyshAukrxMspNbhOxqhMd5KtBMbayLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CkM722nF4BnYI2kBZ1dT7YzAajj1B7944mchsOvUgCkEEkMs7bF+SPZY5NEeJXZE30iaZ/D2QjYQS2AWfXfEWZjB/X8yLp/diZv0uVKanTE/3mYxwPQMn8EXnkJfl64kSYulw1LqeyYOwFXKZ7G7Z81tjD7Pji0RumkzyE6xS/8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=G9HLqvEa; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="G9HLqvEa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35AAA1F000E9; Thu, 28 May 2026 20:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780000886; bh=C43gVVROdOeQFrI/TNxu8ma4QqmiZmp32SHArXEzUfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=G9HLqvEaYKnh9KKNjw2bp5nnRMi88d389XrTrd5WRngTRHWioSRaoXCAQ/mS/V5Dt BxwpgNSa19PuL/nXpOSjgxsEVvIX+jvQk94aIZb5uT67K6k/SJEhDt43ItyIUzVphM wAvpy/WstsGiqfAjUiX/o6B/GaxklahHTIVsVxAA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andreas Haarmann-Thiemann , Linus Walleij , Alexander Lobakin , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 203/272] net: ethernet: cortina: Drop half-assembled SKB Date: Thu, 28 May 2026 21:49:37 +0200 Message-ID: <20260528194634.929063647@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194629.379955525@linuxfoundation.org> References: <20260528194629.379955525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andreas Haarmann-Thiemann [ Upstream commit b266bacba796ff5c4dcd2ae2fc08aacf7ab39153 ] In gmac_rx() (drivers/net/ethernet/cortina/gemini.c), when gmac_get_queue_page() returns NULL for the second page of a multi-page fragment, the driver logs an error and continues — but does not free the partially assembled skb that was being assembled via napi_build_skb() / napi_get_frags(). Free the in-progress partially assembled skb via napi_free_frags() and increase the number of dropped frames appropriately and assign the skb pointer NULL to make sure it is not lingering around, matching the pattern already used elsewhere in the driver. Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet") Signed-off-by: Andreas Haarmann-Thiemann Signed-off-by: Linus Walleij Reviewed-by: Alexander Lobakin Link: https://patch.msgid.link/20260505-gemini-ethernet-fix-v2-1-997c31d06079@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/cortina/gemini.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 47072fbabcaee..8fee13bd056ad 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -1493,6 +1493,11 @@ static unsigned int gmac_rx(struct net_device *netdev, unsigned int budget) gpage = gmac_get_queue_page(geth, port, mapping + PAGE_SIZE); if (!gpage) { dev_err(geth->dev, "could not find mapping\n"); + if (skb) { + napi_free_frags(&port->napi); + port->stats.rx_dropped++; + skb = NULL; + } continue; } page = gpage->page; -- 2.53.0