From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 61F221B3B5 for ; Thu, 7 Feb 2019 14:27:34 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C9FF74024D; Thu, 7 Feb 2019 13:27:33 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.33.36.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB6D819CB6; Thu, 7 Feb 2019 13:27:32 +0000 (UTC) From: Kevin Traynor To: Anatoly Burakov Cc: dpdk stable Date: Thu, 7 Feb 2019 13:25:22 +0000 Message-Id: <20190207132614.20538-16-ktraynor@redhat.com> In-Reply-To: <20190207132614.20538-1-ktraynor@redhat.com> References: <20190207132614.20538-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 07 Feb 2019 13:27:33 +0000 (UTC) Subject: [dpdk-stable] patch 'eal: check string parameter lengths' has been queued to LTS release 18.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2019 13:27:34 -0000 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 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 --- 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 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@dpdk.org - Signed-off-by: Anatoly Burakov --- 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 &&