patch 'app/testpmd: fix hex string parser in flow commands' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:34:50 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/84d8ca035813338a44fbd5e0ec3f16a6894a9d8d

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 84d8ca035813338a44fbd5e0ec3f16a6894a9d8d 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

[ 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 0b76f7ef21..4d99ae518d 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -5361,10 +5361,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.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:10.959422286 +0100
+++ 0086-app-testpmd-fix-hex-string-parser-in-flow-commands.patch	2021-11-30 16:50:05.878874175 +0100
@@ -1 +1 @@
-From a2b97fb7f5b11dcf5e810e13a0da1a0f111975e6 Mon Sep 17 00:00:00 2001
+From 84d8ca035813338a44fbd5e0ec3f16a6894a9d8d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a2b97fb7f5b11dcf5e810e13a0da1a0f111975e6 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 6d9e3d5c42..a90822b660 100644
+index 0b76f7ef21..4d99ae518d 100644
@@ -24 +25 @@
-@@ -7381,10 +7381,13 @@ parse_hex(struct context *ctx, const struct token *token,
+@@ -5361,10 +5361,13 @@ parse_hex(struct context *ctx, const struct token *token,


More information about the stable mailing list