patch 'test/security: fix MTU calculation underflow' has been queued to stable release 24.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 6 12:20:05 CEST 2026


Hi,

FYI, your patch has been queued to stable release 24.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/05/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/6b127e64126ab1d26e7edda019014a1817b9fd8f

Thanks.

Luca Boccassi

---
>From 6b127e64126ab1d26e7edda019014a1817b9fd8f Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Mon, 22 Jun 2026 12:18:33 +0100
Subject: [PATCH] test/security: fix MTU calculation underflow

[ upstream commit 8635cb5c5c6f6432a2212c93ece006352acd418a ]

When testing with some NICs it was observed that the max MTU calculation
could underflow. Despite the RTE_MIN, due to integer promotion, this
lead to the configuring of the port with an excessively large, invalid
value. For example, if lim_nb_seg_max == 0, that meant that
max_data_room - 256 is -256 for comparison purposes using standard
integers (promoted from uint16_t). That is lower than the max mtu so the
-256 value is chosen, which becomes >65000 when converted back to
uint16_t.

Fix this by a) checking for seg_max == 0 b) doing calculations using
uint32_t and c) checking explicitly for underflow before subtracting.

Fixes: 3edd1197a605 ("test/security: add multi-segment inline IPsec cases")

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 app/test/test_security_inline_proto.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 6d75cc5496..b3c3561874 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -2014,8 +2014,19 @@ inline_ipsec_testsuite_setup(void)
 	memcpy(&local_port_conf, &port_conf, sizeof(port_conf));
 	/* Add Multi seg flags */
 	if (sg_mode) {
-		uint16_t max_data_room = RTE_MBUF_DEFAULT_DATAROOM *
-			dev_info.rx_desc_lim.nb_seg_max;
+		uint32_t max_data_room;
+
+		if (dev_info.rx_desc_lim.nb_seg_max == 0) {
+			printf("SG mode unsupported: invalid max Rx segments (0)\n");
+			return TEST_SKIPPED;
+		}
+
+		max_data_room = RTE_MBUF_DEFAULT_DATAROOM * dev_info.rx_desc_lim.nb_seg_max;
+		if (max_data_room <= 256) {
+			printf("SG mode unsupported: max data room (%u) too small\n",
+				max_data_room);
+			return TEST_SKIPPED;
+		}
 
 		local_port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_SCATTER;
 		local_port_conf.txmode.offloads |= RTE_ETH_TX_OFFLOAD_MULTI_SEGS;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-03 12:55:47.206453435 +0100
+++ 0013-test-security-fix-MTU-calculation-underflow.patch	2026-07-03 12:55:46.590571884 +0100
@@ -1 +1 @@
-From 8635cb5c5c6f6432a2212c93ece006352acd418a Mon Sep 17 00:00:00 2001
+From 6b127e64126ab1d26e7edda019014a1817b9fd8f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8635cb5c5c6f6432a2212c93ece006352acd418a ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 4e074712f5..36658f4778 100644
+index 6d75cc5496..b3c3561874 100644
@@ -31 +32 @@
-@@ -2065,8 +2065,19 @@ inline_ipsec_testsuite_setup(void)
+@@ -2014,8 +2014,19 @@ inline_ipsec_testsuite_setup(void)


More information about the stable mailing list