patch 'app/testpmd: fix access to DSCP table entries' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:34:53 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/9f2a1bcfe2e2acbb12dff4aa74b660e015a0a5ba

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 9f2a1bcfe2e2acbb12dff4aa74b660e015a0a5ba 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

[ 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 c6e7529b3d..9f13de0ccd 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.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:11.127045618 +0100
+++ 0089-app-testpmd-fix-access-to-DSCP-table-entries.patch	2021-11-30 16:50:05.882874204 +0100
@@ -1 +1 @@
-From b314a4a664266f691167c29de6bc5ce728346c02 Mon Sep 17 00:00:00 2001
+From 9f2a1bcfe2e2acbb12dff4aa74b660e015a0a5ba Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b314a4a664266f691167c29de6bc5ce728346c02 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index b5dcfdadcf..ad7ef6ad98 100644
+index c6e7529b3d..9f13de0ccd 100644
@@ -27 +28 @@
-@@ -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