patch 'graph: fix stats query with no node xstats' has been queued to stable release 24.11.4

Kevin Traynor ktraynor at redhat.com
Fri Oct 31 15:32:08 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/7fd0620e8dc7bf36ab3c8750a9b4a594fc59e621

Thanks.

Kevin

---
>From 7fd0620e8dc7bf36ab3c8750a9b4a594fc59e621 Mon Sep 17 00:00:00 2001
From: Marat Khalili <marat.khalili at huawei.com>
Date: Wed, 25 Jun 2025 10:27:21 +0100
Subject: [PATCH] graph: fix stats query with no node xstats

[ upstream commit 7c6410ed8b1d800562dcf11ebd1784f6022c617d ]

This was flagged by undefined behaviour sanitizer: memset should not be
called with NULL first argument. (memset requires first argument to be
pointer to a memory object, so passing NULL may result in an undefined
behaviour including among other things optimizer potentially removing
code paths depending on stat->xstat_count being NULL.)

Sanitizer message:

    lib/graph/graph_stats.c:473:2: runtime error: null pointer passed as
    argument 1, which is declared to never be null

Add a check that stat->xstat_cntrs is not zero before the call, since
stat->xstat_count can only be NULL when stat->xstat_cntrs is zero.

Fixes: 070db97e017b ("graph: support node xstats")

Signed-off-by: Marat Khalili <marat.khalili at huawei.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
---
 lib/graph/graph_stats.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c
index 0bbbd9fb7c..e955ee5e06 100644
--- a/lib/graph/graph_stats.c
+++ b/lib/graph/graph_stats.c
@@ -468,5 +468,6 @@ cluster_node_arregate_stats(struct cluster_node *cluster, bool dispatch)
 	uint8_t i;
 
-	memset(stat->xstat_count, 0, sizeof(uint64_t) * stat->xstat_cntrs);
+	if (stat->xstat_cntrs != 0)
+		memset(stat->xstat_count, 0, sizeof(uint64_t) * stat->xstat_cntrs);
 	for (count = 0; count < cluster->nb_nodes; count++) {
 		node = cluster->nodes[count];
-- 
2.51.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-31 13:53:52.492901098 +0000
+++ 0006-graph-fix-stats-query-with-no-node-xstats.patch	2025-10-31 13:53:52.007523278 +0000
@@ -1 +1 @@
-From 7c6410ed8b1d800562dcf11ebd1784f6022c617d Mon Sep 17 00:00:00 2001
+From 7fd0620e8dc7bf36ab3c8750a9b4a594fc59e621 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 7c6410ed8b1d800562dcf11ebd1784f6022c617d ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -30 +31 @@
-index eac73cbf71..583ad8dbd5 100644
+index 0bbbd9fb7c..e955ee5e06 100644
@@ -33 +34 @@
-@@ -471,5 +471,6 @@ cluster_node_arregate_stats(struct cluster_node *cluster, bool dispatch)
+@@ -468,5 +468,6 @@ cluster_node_arregate_stats(struct cluster_node *cluster, bool dispatch)



More information about the stable mailing list