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 0299146AF21; Tue, 16 Jun 2026 16:26: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=1781627201; cv=none; b=NKfYu4PkQB1OzTNeePlwPABvCPwOzagzSNNK7t9y8WKaiOqDnCREMXOrlD0Kh1XWFI/Doga8eE0sbTuCBo3eBzhR6mjgsy81S4mVai4/cUQ1XCHESFwPLYggPNOdDH9mYXp7iZebTwJjShvW0OTZQixk9qvLd2FnVUHNS8584V8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781627201; c=relaxed/simple; bh=KC+2qrBlWXIxN8dn3sLbXfAq8TdB+2wSbUkMrk0kLIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t/7JwraT1FMbaBhE2I84MuAE6PR8aU64x0zwW9z+2o4wXKi/7XHbnNlOyRockobAuTYOYHT0J5NeJqFXpSDy/z0Mj0Aljdr/7NfYRqrIZhKtn2HF9uZ4LZJcFC2LYeNsPibOFSx7dIPIAiQ1O3PRb1ohLT/u8V9YaVXdujQ1Oio= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CZxL8Ua+; 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="CZxL8Ua+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFCB41F000E9; Tue, 16 Jun 2026 16:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781627200; bh=5RdqX8TzV4fBndN7Ls5GfH35tCPVggvKc9/S2ztwkA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CZxL8Ua+3cxM+QJ4CXWUQzm0vIRBPCuc6FjXkm3Wzx0Qhu/nenANA/fk3N3LpSZe4 CS7NgRqH0MltxPAmBnAQKdRpzz6DMg2kr85SwTCeDujP9Slga6uLSrWz76Mw0jQG7M sdOKPJxJ06QAmI85YQvYgYPXdWG7DGnQtNeSHgBQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Til Kaiser , Paolo Abeni , Sasha Levin Subject: [PATCH 6.12 103/261] net: mvpp2: limit XDP frame size to the RX buffer Date: Tue, 16 Jun 2026 20:29:01 +0530 Message-ID: <20260616145049.819716600@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145044.869532709@linuxfoundation.org> References: <20260616145044.869532709@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-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Til Kaiser [ Upstream commit f3c6aa078927e6fe8121c9c591ddee8716c5305a ] mvpp2 has short and long BM pools, and short pool buffers can be smaller than PAGE_SIZE. The XDP path nevertheless initializes every xdp_buff with PAGE_SIZE as frame size. XDP helpers use frame_sz to validate tail growth and to derive the hard end of the data area. Advertising PAGE_SIZE for short buffers can let bpf_xdp_adjust_tail() grow a packet past the real allocation, corrupting memory or later tripping skb tailroom checks. Initialize the XDP buffer with bm_pool->frag_size so XDP tailroom matches the actual buffer backing the packet. Fixes: 07dd0a7aae7f ("mvpp2: add basic XDP support") Signed-off-by: Til Kaiser Link: https://patch.msgid.link/20260607134943.21996-3-mail@tk154.de Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 4aaa661f78f288..d5d2cbe127b0e7 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -3994,7 +3994,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi, else xdp_rxq = &rxq->xdp_rxq_long; - xdp_init_buff(&xdp, PAGE_SIZE, xdp_rxq); + xdp_init_buff(&xdp, bm_pool->frag_size, xdp_rxq); xdp_prepare_buff(&xdp, data, MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM, rx_bytes, false); -- 2.53.0