patch 'telemetry: fix thread-unsafe command parsing' has been queued to stable release 25.11.3

Kevin Traynor ktraynor at redhat.com
Tue Jul 28 17:55:40 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 08/01/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/c5ace0eb405b94eb42881a2b6baaf468e7befd8f

Thanks.

Kevin

---
>From c5ace0eb405b94eb42881a2b6baaf468e7befd8f Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Fri, 5 Jun 2026 13:50:58 -0700
Subject: [PATCH] telemetry: fix thread-unsafe command parsing

[ upstream commit fdf75c91a68140c7e2ca287d4c6a708960308e51 ]

The telemetry client_handler() runs in a detached thread per connection,
and up to MAX_CONNECTIONS instances can run concurrently.
The function strtok() keeps parser state in a static variable
shared across all threads, so concurrent clients corrupt each other's
command parsing. Use strtok_r() with a local saveptr.

Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/telemetry/telemetry.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
index cf4324421d..8b114bdd6c 100644
--- a/lib/telemetry/telemetry.c
+++ b/lib/telemetry/telemetry.c
@@ -416,6 +416,7 @@ client_handler(void *sock_id)
 	while (bytes > 0) {
 		buffer[bytes] = 0;
-		const char *cmd = strtok(buffer, ",");
-		const char *param = strtok(NULL, "\0");
+		char *saveptr = NULL;
+		const char *cmd = strtok_r(buffer, ",", &saveptr);
+		const char *param = strtok_r(NULL, "\0", &saveptr);
 		struct cmd_callback cb = {.fn = unknown_command};
 		int i;
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-28 16:54:51.134192274 +0100
+++ 0010-telemetry-fix-thread-unsafe-command-parsing.patch	2026-07-28 16:54:50.755640906 +0100
@@ -1 +1 @@
-From fdf75c91a68140c7e2ca287d4c6a708960308e51 Mon Sep 17 00:00:00 2001
+From c5ace0eb405b94eb42881a2b6baaf468e7befd8f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fdf75c91a68140c7e2ca287d4c6a708960308e51 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index b109d076d4..e591c1e283 100644
+index cf4324421d..8b114bdd6c 100644



More information about the stable mailing list