patch 'tailq: fix lookup macro' has been queued to stable release 22.11.11

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Oct 27 17:18:43 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/25. 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/315102b82aae7bb6dc5bbf31f129d073994e30d3

Thanks.

Luca Boccassi

---
>From 315102b82aae7bb6dc5bbf31f129d073994e30d3 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Mon, 3 Feb 2025 17:09:54 +0100
Subject: [PATCH] tailq: fix lookup macro

[ upstream commit 5d2d4033abe5bb17f6e328fad1a615553573abd5 ]

Doing arithmetic with the NULL pointer is undefined.

Caught by UBSan:

../app/test/test_tailq.c:111:9: runtime error:
	member access within null pointer of type 'struct rte_tailq_head'

Fixes: f6b4f6c9c123 ("tailq: use a single cast macro")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
---
 lib/eal/include/rte_tailq.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/eal/include/rte_tailq.h b/lib/eal/include/rte_tailq.h
index 0f67f9e4db..e1d8d15c8d 100644
--- a/lib/eal/include/rte_tailq.h
+++ b/lib/eal/include/rte_tailq.h
@@ -70,11 +70,12 @@ struct rte_tailq_elem {
  * @return
  *   The return value from rte_eal_tailq_lookup, typecast to the appropriate
  *   structure pointer type.
- *   NULL on error, since the tailq_head is the first
- *   element in the rte_tailq_head structure.
+ *   NULL on error.
  */
-#define RTE_TAILQ_LOOKUP(name, struct_name) \
-	RTE_TAILQ_CAST(rte_eal_tailq_lookup(name), struct_name)
+#define RTE_TAILQ_LOOKUP(name, struct_name) __extension__ ({ \
+	struct rte_tailq_head *head = rte_eal_tailq_lookup(name); \
+	head == NULL ? NULL : RTE_TAILQ_CAST(head, struct_name); \
+})
 
 /**
  * Dump tail queues to a file.
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-27 15:54:35.042830494 +0000
+++ 0005-tailq-fix-lookup-macro.patch	2025-10-27 15:54:34.719947643 +0000
@@ -1 +1 @@
-From 5d2d4033abe5bb17f6e328fad1a615553573abd5 Mon Sep 17 00:00:00 2001
+From 315102b82aae7bb6dc5bbf31f129d073994e30d3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5d2d4033abe5bb17f6e328fad1a615553573abd5 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index 89f7ef2134..e7caed6812 100644
+index 0f67f9e4db..e1d8d15c8d 100644
@@ -26 +27 @@
-@@ -69,11 +69,12 @@ struct rte_tailq_elem {
+@@ -70,11 +70,12 @@ struct rte_tailq_elem {


More information about the stable mailing list