[dpdk-stable] patch 'telemetry: fix race on callbacks list' has been queued to stable release 20.11.2

Xueming Li xuemingl at nvidia.com
Sat Jun 12 01:02:44 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.2

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/14/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/b6659faacc13e952be50a2d15ef7c8ef4a435845

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From b6659faacc13e952be50a2d15ef7c8ef4a435845 Mon Sep 17 00:00:00 2001
From: Ciara Power <ciara.power at intel.com>
Date: Wed, 5 May 2021 15:22:48 +0000
Subject: [PATCH] telemetry: fix race on callbacks list
Cc: Luca Boccassi <bluca at debian.org>

[ upstream commit 048960272e809ea728110748d317ddce1d731a27 ]

The list_commands() function accessed the callbacks list,
but did not take the lock. This may have caused inconsistencies if
callbacks were being registered at the same time.
This is now fixed to lock before iterating the list,
and unlock afterwards.

Fixes: f38748736eb2 ("telemetry: add default callback commands")

Reported-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Ciara Power <ciara.power at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/librte_telemetry/telemetry.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c
index b142729da4..9d970d167e 100644
--- a/lib/librte_telemetry/telemetry.c
+++ b/lib/librte_telemetry/telemetry.c
@@ -95,8 +95,10 @@ list_commands(const char *cmd __rte_unused, const char *params __rte_unused,
 	int i;
 
 	rte_tel_data_start_array(d, RTE_TEL_STRING_VAL);
+	rte_spinlock_lock(&callback_sl);
 	for (i = 0; i < num_callbacks; i++)
 		rte_tel_data_add_array_string(d, callbacks[i].cmd);
+	rte_spinlock_unlock(&callback_sl);
 	return 0;
 }
 
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-06-12 06:53:58.425667100 +0800
+++ 0070-telemetry-fix-race-on-callbacks-list.patch	2021-06-12 06:53:56.330000000 +0800
@@ -1 +1 @@
-From 048960272e809ea728110748d317ddce1d731a27 Mon Sep 17 00:00:00 2001
+From b6659faacc13e952be50a2d15ef7c8ef4a435845 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Luca Boccassi <bluca at debian.org>
+
+[ upstream commit 048960272e809ea728110748d317ddce1d731a27 ]
@@ -13 +15,0 @@
-Cc: stable at dpdk.org
@@ -19 +21 @@
- lib/telemetry/telemetry.c | 2 ++
+ lib/librte_telemetry/telemetry.c | 2 ++
@@ -22,5 +24,5 @@
-diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c
-index c06de45531..f8b0d1157b 100644
---- a/lib/telemetry/telemetry.c
-+++ b/lib/telemetry/telemetry.c
-@@ -107,8 +107,10 @@ list_commands(const char *cmd __rte_unused, const char *params __rte_unused,
+diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c
+index b142729da4..9d970d167e 100644
+--- a/lib/librte_telemetry/telemetry.c
++++ b/lib/librte_telemetry/telemetry.c
+@@ -95,8 +95,10 @@ list_commands(const char *cmd __rte_unused, const char *params __rte_unused,


More information about the stable mailing list