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 5DF3F3242BE; Sat, 30 May 2026 18:18:41 +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=1780165122; cv=none; b=lD2PUAWG76pIdd+Eb5Pv/kHfVtUW6IPY8wvqQ7bKftNAUM3BAHsMC8kiJzDdYVVqm+rz2laoUfcCyl9D0jVP9g7aA8cly43W9CY6sbCvBNBSueuKZKXIxbZhM7/Nc1hu967BFwtG9RWYTZgUy4bHdC4Bvuev/GrDb2YodFX5u08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780165122; c=relaxed/simple; bh=knVk7/1bCpvCzdIUh3A8MgnALyUngoJlzcTmkk5YVuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=A4LKHv5WQe7JNs1kaJi09YppvsnGbhtXHTNeL9hlBSe2pFn177/9CrQGWflYdHXhGRhXu8YBGl4T8BcdQk2FV+qFHxLqE5hObccwXWF+pEDWuW33JYUisxOkTFWaL5cTiG4gbTKVFyPjSYjjUThL4IDuXVoXpIBjMjSIfNJF+j4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZHYWAdEa; 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="ZHYWAdEa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84C001F00893; Sat, 30 May 2026 18:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780165121; bh=7d5+VBm6ir2oToDFXKZh9EasAITx5NhlWmL5QwI+RpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZHYWAdEae2BLxlqZvq3laZrE91eopUItDm9+7NEauT0tGs4mixrtVWl5YLYya+dcB MOtdHY9u4xPgsEAuktmP4ErmPo6cBxoF4+a5HVFSHk/3nJO44ca70b6jN/eWxt4qUn OyIX7JdUlPSflV/PyZMzrraNnVKFxUBEBmDQyXoc= 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 5.15 749/776] net: ethernet: cortina: Drop half-assembled SKB Date: Sat, 30 May 2026 18:07:43 +0200 Message-ID: <20260530160259.125736066@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160240.228940103@linuxfoundation.org> References: <20260530160240.228940103@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-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 29f8e19661efa..be2b106b4aa27 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -1462,6 +1462,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