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

Yongseok Koh yskoh at mellanox.com
Fri Mar 8 18:47:27 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objection by 03/13/19. So please
shout if anyone has objection.

Also note that after the patch there's a diff of the upstream commit vs the patch applied
to the branch. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Yongseok

---
>From 11dabc416169e52ee79731bd6ab920036df0e2f3 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

[ backported from 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 | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index d91104dc0..a3d4d346b 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1242,6 +1242,16 @@ eal_check_common_options(struct internal_config *internal_cfg)
 		RTE_LOG(ERR, EAL, "Invalid process type specified\n");
 		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 (index(internal_cfg->hugefile_prefix, '%') != NULL) {
 		RTE_LOG(ERR, EAL, "Invalid char, '%%', in --"OPT_FILE_PREFIX" "
 			"option\n");
-- 
2.11.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-03-08 09:46:42.650470157 -0800
+++ 0049-eal-check-string-parameter-lengths.patch	2019-03-08 09:46:40.242402000 -0800
@@ -1,8 +1,10 @@
-From 2383d8e909275b072145c7addf826e9c8edb6232 Mon Sep 17 00:00:00 2001
+From 11dabc416169e52ee79731bd6ab920036df0e2f3 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
 
+[ backported from 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(+)
+ lib/librte_eal/common/eal_common_options.c | 10 ++++++++++
+ 1 file changed, 10 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 d91104dc0..a3d4d346b 100644
 --- a/lib/librte_eal/common/eal_common_options.c
 +++ b/lib/librte_eal/common/eal_common_options.c
-@@ -1415,6 +1415,21 @@ eal_check_common_options(struct internal_config *internal_cfg)
+@@ -1242,6 +1242,16 @@ eal_check_common_options(struct internal_config *internal_cfg)
  		RTE_LOG(ERR, EAL, "Invalid process type specified\n");
  		return -1;
  	}
@@ -39,12 +39,7 @@
 +		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) {
+ 	if (index(internal_cfg->hugefile_prefix, '%') != NULL) {
  		RTE_LOG(ERR, EAL, "Invalid char, '%%', in --"OPT_FILE_PREFIX" "
  			"option\n");
 -- 


More information about the stable mailing list