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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 11 15:19:42 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 06/13/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/f5c9e09f16b06eeaf3d99e6ebc590fc79a4e268a

Thanks.

Luca Boccassi

---
>From f5c9e09f16b06eeaf3d99e6ebc590fc79a4e268a 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 3652025f7a..82b5f09da3 100644
--- a/.mailmap
+++ b/.mailmap
@@ -357,6 +357,7 @@ Deepak Kumar Jain <deepak.k.jain at intel.com>
 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>
 Derek Chickles <derek.chickles at caviumnetworks.com>
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 9a14242965..1b9d477af4 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -660,13 +660,17 @@ 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));
 			if (size >= off + tmp) {
@@ -684,8 +688,8 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
 		spec.geneve_opt = item->spec;
 		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,
 							  src.geneve_opt->data,
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-06-11 14:20:02.659367185 +0100
+++ 0033-ethdev-fix-pointer-check-in-GENEVE-and-raw-flow-copy.patch	2026-06-11 14:20:01.202745690 +0100
@@ -1 +1 @@
-From fd75dc942701a9094a23047ed19e88fc657bae25 Mon Sep 17 00:00:00 2001
+From f5c9e09f16b06eeaf3d99e6ebc590fc79a4e268a 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 3652025f7a..82b5f09da3 100644
@@ -33 +34 @@
-@@ -372,6 +372,7 @@ Deepak Kumar Jain <deepak.k.jain at intel.com>
+@@ -357,6 +357,7 @@ Deepak Kumar Jain <deepak.k.jain at intel.com>
@@ -42 +43 @@
-index fe8f43caff..7a51b667cf 100644
+index 9a14242965..1b9d477af4 100644
@@ -45 +46 @@
-@@ -672,13 +672,17 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
+@@ -660,13 +660,17 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
@@ -68 +69 @@
-@@ -696,8 +700,8 @@ rte_flow_conv_item_spec(void *buf, const size_t size,
+@@ -684,8 +688,8 @@ rte_flow_conv_item_spec(void *buf, const size_t size,


More information about the stable mailing list