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

Kevin Traynor ktraynor at redhat.com
Tue Mar 5 16:33:55 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.11.7

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/11/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/f6975c91bc2922390c2aaf62263f910918b189e7

Thanks.

Kevin

---
>From f6975c91bc2922390c2aaf62263f910918b189e7 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 ff51d0215a..7c92f14a02 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -143,6 +143,8 @@ 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++)
-- 
2.43.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-05 14:08:55.228732399 +0000
+++ 0022-examples-qos_sched-fix-memory-leak-in-args-parsing.patch	2024-03-05 14:08:54.629520709 +0000
@@ -1 +1 @@
-From db8aee153e43375538667c6f861e981a47574476 Mon Sep 17 00:00:00 2001
+From f6975c91bc2922390c2aaf62263f910918b189e7 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 ff51d0215a..7c92f14a02 100644
@@ -20 +21 @@
-@@ -104,6 +104,8 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32
+@@ -143,6 +143,8 @@ app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32



More information about the stable mailing list