[dpdk-stable] patch 'app/testpmd: fix access to DSCP table entries' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:30:46 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.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/12/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/453cbd4bf4ca21246e25e12c3b9d3d9518bb7e9a

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 453cbd4bf4ca21246e25e12c3b9d3d9518bb7e9a Mon Sep 17 00:00:00 2001
From: Sunil Kumar Kori <skori at marvell.com>
Date: Tue, 12 Oct 2021 14:03:17 +0530
Subject: [PATCH] app/testpmd: fix access to DSCP table entries
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit b314a4a664266f691167c29de6bc5ce728346c02 ]

During parsing of DSCP entries, memory is allocated and assigned
to *dscp_table. Later on, same memory is accessed using
*dscp_table[i++].

Due to higher precedence for array subscript, dscp_table[i++] will
be executed first which actually does not point to the same memory
which was allocated previously for DSCP table entries.

Fixes: 459463ae6c26 ("app/testpmd: fix memory allocation for DSCP table")

Signed-off-by: Sunil Kumar Kori <skori at marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 app/test-pmd/cmdline_mtr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c
index 3982787d20..875a97788c 100644
--- a/app/test-pmd/cmdline_mtr.c
+++ b/app/test-pmd/cmdline_mtr.c
@@ -92,13 +92,13 @@ parse_dscp_table_entries(char *str, enum rte_color **dscp_table)
 	while (1) {
 		if (strcmp(token, "G") == 0 ||
 			strcmp(token, "g") == 0)
-			*dscp_table[i++] = RTE_COLOR_GREEN;
+			(*dscp_table)[i++] = RTE_COLOR_GREEN;
 		else if (strcmp(token, "Y") == 0 ||
 			strcmp(token, "y") == 0)
-			*dscp_table[i++] = RTE_COLOR_YELLOW;
+			(*dscp_table)[i++] = RTE_COLOR_YELLOW;
 		else if (strcmp(token, "R") == 0 ||
 			strcmp(token, "r") == 0)
-			*dscp_table[i++] = RTE_COLOR_RED;
+			(*dscp_table)[i++] = RTE_COLOR_RED;
 		else {
 			free(*dscp_table);
 			return -1;
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:09.133465378 +0800
+++ 0162-app-testpmd-fix-access-to-DSCP-table-entries.patch	2021-11-10 14:17:01.970745273 +0800
@@ -1 +1 @@
-From b314a4a664266f691167c29de6bc5ce728346c02 Mon Sep 17 00:00:00 2001
+From 453cbd4bf4ca21246e25e12c3b9d3d9518bb7e9a Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b314a4a664266f691167c29de6bc5ce728346c02 ]
@@ -15 +17,0 @@
-Cc: stable at dpdk.org
@@ -24 +26 @@
-index b5dcfdadcf..ad7ef6ad98 100644
+index 3982787d20..875a97788c 100644
@@ -27 +29 @@
-@@ -101,13 +101,13 @@ parse_dscp_table_entries(char *str, enum rte_color **dscp_table)
+@@ -92,13 +92,13 @@ parse_dscp_table_entries(char *str, enum rte_color **dscp_table)


More information about the stable mailing list