patch 'ethdev: fix pointer check in GENEVE and raw flow copy' has been queued to stable release 25.11.3

Kevin Traynor ktraynor at redhat.com
Thu Jul 23 19:14:56 CEST 2026


Hi,

FYI, your patch has been queued to stable release 25.11.3

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/27/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/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
>From d81f3d8b8b12f1d9633f6defaefdaf200900cdf5 Mon Sep 17 00:00:00 2001
From: Denis Lyulin <lyulin.2003 at mail.ru>
Date: Tue, 19 May 2026 10:23:35 +0300
Subject: [PATCH] ethdev: fix pointer check in GENEVE and raw flow copy

[ upstream commit fd75dc942701a9094a23047ed19e88fc657bae25 ]

When rte_flow_conv_item_spec() is called from rte_flow_conv_pattern(),
the spec, last and mask pointers are checked separately. If the API
is used incorrectly, the spec pointer may be NULL while last and mask
may be valid pointers. Also call of rte_flow_conv() with
RTE_FLOW_CONV_OP_ITEM_MASK and item->spec == NULL may lead to the
same problem.

In rte_flow_conv_item_spec() for GENVE_OPT and RAW item types the spec
pointer is used even if the function is called to copy last or mask.
It may cause a NULL pointer (spec) dereference.

This commit adds extra check of item->spec and if it is NULL, does not
copy further data relying on it

Fixes: 841a0445442d ("ethdev: fix GENEVE option item conversion")

Signed-off-by: Denis Lyulin <lyulin.2003 at mail.ru>
---
 .mailmap              |  1 +
 lib/ethdev/rte_flow.c | 18 +++++++++++-------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/.mailmap b/.mailmap
index 9c34c1f326..594abaf4dd 100644
--- a/.mailmap
+++ b/.mailmap
@@ -370,4 +370,5 @@ Deirdre O'Connor <deirdre.o.connor at intel.com>
 Dekel Peled <dekelp at nvidia.com> <dekelp at mellanox.com>
 Dengdui Huang <huangdengdui at huawei.com>
+Denis Lyulin <lyulin.2003 at mail.ru>
 Denis Pryazhennikov <denis.pryazhennikov at arknetworks.am>
 Dennis Marinus <dmarinus at amazon.com>
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index fe8f43caff..7a51b667cf 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -673,11 +673,15 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
 			   size > sizeof(*dst.raw) ? sizeof(*dst.raw) : size);
 		off = sizeof(*dst.raw);
-		if (type == RTE_FLOW_CONV_ITEM_SPEC ||
-		    (type == RTE_FLOW_CONV_ITEM_MASK &&
-		     ((spec.raw->length & mask.raw->length) >=
-		      (last.raw->length & mask.raw->length))))
+		if (type == RTE_FLOW_CONV_ITEM_SPEC && spec.raw)
 			tmp = spec.raw->length & mask.raw->length;
-		else
+		else if (type == RTE_FLOW_CONV_ITEM_MASK && spec.raw && last.raw &&
+			 ((spec.raw->length & mask.raw->length) >=
+			  (last.raw->length & mask.raw->length)))
+			tmp = spec.raw->length & mask.raw->length;
+		else if (last.raw)
 			tmp = last.raw->length & mask.raw->length;
+		else
+			tmp = 0;
+
 		if (tmp) {
 			off = RTE_ALIGN_CEIL(off, sizeof(*dst.raw->pattern));
@@ -697,6 +701,6 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
 		src.geneve_opt = data;
 		dst.geneve_opt = buf;
-		tmp = spec.geneve_opt->option_len << 2;
-		if (size > 0 && src.geneve_opt->data) {
+		tmp = spec.geneve_opt ? (spec.geneve_opt->option_len << 2) : 0;
+		if (size > 0 && tmp > 0 && src.geneve_opt->data) {
 			deep_src = (void *)((uintptr_t)(dst.geneve_opt + 1));
 			dst.geneve_opt->data = rte_memcpy(deep_src,
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-23 17:57:59.624983149 +0100
+++ 0033-ethdev-fix-pointer-check-in-GENEVE-and-raw-flow-copy.patch	2026-07-23 17:57:58.643918620 +0100
@@ -1 +1 @@
-From fd75dc942701a9094a23047ed19e88fc657bae25 Mon Sep 17 00:00:00 2001
+From d81f3d8b8b12f1d9633f6defaefdaf200900cdf5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fd75dc942701a9094a23047ed19e88fc657bae25 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index f586cfcd77..28fe6b5cc1 100644
+index 9c34c1f326..594abaf4dd 100644
@@ -33 +34 @@
-@@ -373,4 +373,5 @@ Deirdre O'Connor <deirdre.o.connor at intel.com>
+@@ -370,4 +370,5 @@ Deirdre O'Connor <deirdre.o.connor at intel.com>



More information about the stable mailing list