patch 'tailq: fix lookup macro' has been queued to stable release 24.11.4
    Kevin Traynor 
    ktraynor at redhat.com
       
    Fri Oct 31 15:32:06 CET 2025
    
    
  
Hi,
FYI, your patch has been queued to stable release 24.11.4
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/05/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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/87b15f2e91f310e188a79baa64aafb5a64363975
Thanks.
Kevin
---
>From 87b15f2e91f310e188a79baa64aafb5a64363975 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 89f7ef2134..e7caed6812 100644
--- a/lib/eal/include/rte_tailq.h
+++ b/lib/eal/include/rte_tailq.h
@@ -70,9 +70,10 @@ struct rte_tailq_elem {
  *   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); \
+})
 
 /**
-- 
2.51.0
---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-31 13:53:52.438635181 +0000
+++ 0004-tailq-fix-lookup-macro.patch	2025-10-31 13:53:52.006239977 +0000
@@ -1 +1 @@
-From 5d2d4033abe5bb17f6e328fad1a615553573abd5 Mon Sep 17 00:00:00 2001
+From 87b15f2e91f310e188a79baa64aafb5a64363975 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5d2d4033abe5bb17f6e328fad1a615553573abd5 ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
    
    
More information about the stable
mailing list