patch 'net/af_packet: check packet size after VLAN insertion' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 5 17:43:15 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/07/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/ca5652ec0018fbfbd09df09f2905effe2bfc51ba

Thanks.

Luca Boccassi

---
>From ca5652ec0018fbfbd09df09f2905effe2bfc51ba Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 28 Oct 2026 15:48:07 -0700
Subject: [PATCH] net/af_packet: check packet size after VLAN insertion

[ upstream commit 7424874516a93758a2f69974971196072a0de155 ]

This fixes a corner case where vlan is insert and the resulting
packet exceeds the TPACKET_V2 ring slot size.

Fixes: 23deeebfcfa8 ("net/af_packet: support 802.1Q VLAN")

Reported-by: Anthropic OSS scanner
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/af_packet/rte_eth_af_packet.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index a04e835a66a..024153f6046 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -241,12 +241,6 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	for (i = 0; i < nb_pkts; i++) {
 		mbuf = *bufs++;
 
-		/* drop oversized packets */
-		if (mbuf->pkt_len > pkt_q->frame_data_size) {
-			rte_pktmbuf_free(mbuf);
-			continue;
-		}
-
 		/* insert vlan info if necessary */
 		if (mbuf->ol_flags & RTE_MBUF_F_TX_VLAN) {
 			if (rte_vlan_insert(&mbuf)) {
@@ -255,6 +249,12 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 			}
 		}
 
+		/* drop oversized packets */
+		if (mbuf->pkt_len > pkt_q->frame_data_size) {
+			rte_pktmbuf_free(mbuf);
+			continue;
+		}
+
 		/* point at the next incoming frame */
 		if (!tx_ring_status_available(ppd->tp_status)) {
 			if (poll(&pfd, 1, -1) < 0)
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-05 16:42:49.055538789 +0000
+++ 0108-net-af_packet-check-packet-size-after-VLAN-insertion.patch	2026-11-05 16:42:45.061064970 +0000
@@ -1 +1 @@
-From 7424874516a93758a2f69974971196072a0de155 Mon Sep 17 00:00:00 2001
+From ca5652ec0018fbfbd09df09f2905effe2bfc51ba Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7424874516a93758a2f69974971196072a0de155 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 77c017f676..44f82c0309 100644
+index a04e835a66a..024153f6046 100644
@@ -22 +23 @@
-@@ -335,12 +335,6 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -241,12 +241,6 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
@@ -35 +36 @@
-@@ -349,6 +343,12 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
+@@ -255,6 +249,12 @@ eth_af_packet_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)


More information about the stable mailing list