[dpdk-stable] patch 'eal: check string parameter lengths' has been queued to LTS release 18.11.1

Kevin Traynor ktraynor at redhat.com
Thu Feb 7 14:25:22 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/14/19. 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.

Thanks.

Kevin Traynor

---
>From ad40dacc038197c60f42883cee86b83033a1b113 Mon Sep 17 00:00:00 2001
From: Anatoly Burakov <anatoly.burakov at intel.com>
Date: Wed, 16 Jan 2019 12:12:53 +0000
Subject: [PATCH] eal: check string parameter lengths

[ upstream commit 2383d8e909275b072145c7addf826e9c8edb6232 ]

When specifying parameters such as hugefile prefix from the
command-line, it is possibly to supply an empty string. This may
lead to various problems: for example, if hugefile prefix is
empty, the runtime config path construction may end up
looking like "/var/run/dpdk//_config", which will technically
work, but is wrong and places files in the wrong place.

To fix it, check lengths of such user-specified parameters for
hugefile prefix, as well as hugepage dir and user-specified
mbuf pool ops string.

Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/librte_eal/common/eal_common_options.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 02eb18410..f6dfbc73a 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1415,4 +1415,19 @@ eal_check_common_options(struct internal_config *internal_cfg)
 		return -1;
 	}
+	if (internal_cfg->hugefile_prefix != NULL &&
+			strlen(internal_cfg->hugefile_prefix) < 1) {
+		RTE_LOG(ERR, EAL, "Invalid length of --" OPT_FILE_PREFIX " option\n");
+		return -1;
+	}
+	if (internal_cfg->hugepage_dir != NULL &&
+			strlen(internal_cfg->hugepage_dir) < 1) {
+		RTE_LOG(ERR, EAL, "Invalid length of --" OPT_HUGE_DIR" option\n");
+		return -1;
+	}
+	if (internal_cfg->user_mbuf_pool_ops_name != NULL &&
+			strlen(internal_cfg->user_mbuf_pool_ops_name) < 1) {
+		RTE_LOG(ERR, EAL, "Invalid length of --" OPT_MBUF_POOL_OPS_NAME" option\n");
+		return -1;
+	}
 	if (index(eal_get_hugefile_prefix(), '%') != NULL) {
 		RTE_LOG(ERR, EAL, "Invalid char, '%%', in --"OPT_FILE_PREFIX" "
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-02-07 13:19:55.896879010 +0000
+++ 0016-eal-check-string-parameter-lengths.patch	2019-02-07 13:19:55.000000000 +0000
@@ -1,8 +1,10 @@
-From 2383d8e909275b072145c7addf826e9c8edb6232 Mon Sep 17 00:00:00 2001
+From ad40dacc038197c60f42883cee86b83033a1b113 Mon Sep 17 00:00:00 2001
 From: Anatoly Burakov <anatoly.burakov at intel.com>
 Date: Wed, 16 Jan 2019 12:12:53 +0000
 Subject: [PATCH] eal: check string parameter lengths
 
+[ upstream commit 2383d8e909275b072145c7addf826e9c8edb6232 ]
+
 When specifying parameters such as hugefile prefix from the
 command-line, it is possibly to supply an empty string. This may
 lead to various problems: for example, if hugefile prefix is
@@ -14,18 +16,16 @@
 hugefile prefix, as well as hugepage dir and user-specified
 mbuf pool ops string.
 
-Cc: stable at dpdk.org
-
 Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
 ---
  lib/librte_eal/common/eal_common_options.c | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
 
 diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
-index 80d790292..6c96f459c 100644
+index 02eb18410..f6dfbc73a 100644
 --- a/lib/librte_eal/common/eal_common_options.c
 +++ b/lib/librte_eal/common/eal_common_options.c
-@@ -1416,4 +1416,19 @@ eal_check_common_options(struct internal_config *internal_cfg)
+@@ -1415,4 +1415,19 @@ eal_check_common_options(struct internal_config *internal_cfg)
  		return -1;
  	}
 +	if (internal_cfg->hugefile_prefix != NULL &&


More information about the stable mailing list