[dpdk-stable] patch 'app/testpmd: fix hex string parser in flow commands' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:30:37 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/c77bb52ed48e27e6846ab435d121ba32ac2364e9

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From c77bb52ed48e27e6846ab435d121ba32ac2364e9 Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
Date: Wed, 13 Oct 2021 21:45:15 +0300
Subject: [PATCH] app/testpmd: fix hex string parser in flow commands
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit a2b97fb7f5b11dcf5e810e13a0da1a0f111975e6 ]

The hexadecimal string parser does not check the target
field buffer size, buffer overflow happens and might
cause the application failure (segmentation fault
is observed usually).

Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow API")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
Acked-by: Ori Kam <orika at nvidia.com>
---
 app/test-pmd/cmdline_flow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index c67ac71505..bbf62be5ae 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -6479,10 +6479,13 @@ parse_hex(struct context *ctx, const struct token *token,
 		hexlen -= 2;
 	}
 	if (hexlen > length)
-		return -1;
+		goto error;
 	ret = parse_hex_string(str, hex_tmp, &hexlen);
 	if (ret < 0)
 		goto error;
+	/* Check the converted binary fits into data buffer. */
+	if (hexlen > size)
+		goto error;
 	/* Let parse_int() fill length information first. */
 	ret = snprintf(tmp, sizeof(tmp), "%u", hexlen);
 	if (ret < 0)
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:08.737101866 +0800
+++ 0153-app-testpmd-fix-hex-string-parser-in-flow-commands.patch	2021-11-10 14:17:01.947412130 +0800
@@ -1 +1 @@
-From a2b97fb7f5b11dcf5e810e13a0da1a0f111975e6 Mon Sep 17 00:00:00 2001
+From c77bb52ed48e27e6846ab435d121ba32ac2364e9 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit a2b97fb7f5b11dcf5e810e13a0da1a0f111975e6 ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 6d9e3d5c42..a90822b660 100644
+index c67ac71505..bbf62be5ae 100644
@@ -24 +26 @@
-@@ -7381,10 +7381,13 @@ parse_hex(struct context *ctx, const struct token *token,
+@@ -6479,10 +6479,13 @@ parse_hex(struct context *ctx, const struct token *token,


More information about the stable mailing list