patch 'examples/qos_sched: fix memory leak in args parsing' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 7 02:30:50 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/09/24. 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/7d35dff74ced59654f0a2890895f88702fd926ae

Thanks.

Luca Boccassi

---
>From 7d35dff74ced59654f0a2890895f88702fd926ae Mon Sep 17 00:00:00 2001
From: Chengwen Feng <fengchengwen at huawei.com>
Date: Fri, 10 Nov 2023 10:01:16 +0000
Subject: [PATCH] examples/qos_sched: fix memory leak in args parsing

[ upstream commit db8aee153e43375538667c6f861e981a47574476 ]

Should free the memory which allocated by strdup().

Fixes: 035b6a4f4bba ("examples/qos_sched: fix out-of-bounds option parsing")

Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
---
 examples/qos_sched/args.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index b2959499ae..bccbbe8207 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -141,8 +141,10 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32
 
 	n_tokens = rte_strsplit(string, strnlen(string, 32), tokens, n_vals, separator);
 
-	if (n_tokens > MAX_OPT_VALUES)
+	if (n_tokens > MAX_OPT_VALUES) {
+		free(string);
 		return -1;
+	}
 
 	for (i = 0; i < n_tokens; i++)
 		opt_vals[i] = (uint32_t)atol(tokens[i]);
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-07 01:05:37.832470859 +0000
+++ 0033-examples-qos_sched-fix-memory-leak-in-args-parsing.patch	2024-03-07 01:05:34.738938743 +0000
@@ -1 +1 @@
-From db8aee153e43375538667c6f861e981a47574476 Mon Sep 17 00:00:00 2001
+From 7d35dff74ced59654f0a2890895f88702fd926ae Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit db8aee153e43375538667c6f861e981a47574476 ]
+
@@ -9 +10,0 @@
-Cc: stable at dpdk.org
@@ -17 +18 @@
-index e97273152a..8d61d3e454 100644
+index b2959499ae..bccbbe8207 100644
@@ -20 +21 @@
-@@ -103,8 +103,10 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32
+@@ -141,8 +141,10 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32


More information about the stable mailing list