From patchwork Thu Sep 26 13:30:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lavanya Govindarajan X-Patchwork-Id: 59881 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A9E6D2C2F; Thu, 26 Sep 2019 15:31:06 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id E3E332BD8; Thu, 26 Sep 2019 15:31:04 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2019 06:31:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,552,1559545200"; d="scan'208";a="214473503" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 26 Sep 2019 06:31:02 -0700 Received: from wgcvswdev001.ir.intel.com (wgcvswdev001.ir.intel.com [10.102.246.100]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id x8QDV2fJ013077; Thu, 26 Sep 2019 14:31:02 +0100 Received: from wgcvswdev001.ir.intel.com (localhost [127.0.0.1]) by wgcvswdev001.ir.intel.com with ESMTP id x8QDUMim001533; Thu, 26 Sep 2019 14:30:22 +0100 Received: (from lgovin3x@localhost) by wgcvswdev001.ir.intel.com with ? id x8QDUMXG001528; Thu, 26 Sep 2019 14:30:22 +0100 From: Lavanya Govindarajan To: dev@dpdk.org Cc: reshma.pattan@intel.com, ferruh.yigit@intel.com, Lavanya Govindarajan , stable@dpdk.org Date: Thu, 26 Sep 2019 14:30:05 +0100 Message-Id: <1569504605-1344-1-git-send-email-lavanyax.govindarajan@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] app/test-compress-perf: fix out-of-bounds read X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" One issue caught by Coverity 344984 *overrun-local: Overrunning array cperf_test_type_strs of 2 8-byte elements The array cperf_test_type_strs defined in app/test-compress-perf conflicts with the same name being defined in app/test-crypto-perf. Due to which coverity reports error. The fix is to rename "cperf_test_type_strs" into "comp_perf_test_type_strs" in app/test-compress-perf to avoid name confusion. Coverity issue: 344984 Fixes: 424dd6c8c1 ("app/compress-perf: add weak functions for multicore test") Fixes: 1a9b0f3504 ("app/compress-perf: add --ptest option") Fixes: 424dd6c8c1 ("app/compress-perf: add weak functions for multicore test") Cc: stable@dpdk.org Signed-off-by: Lavanya Govindarajan Acked-by: Akhil Goyal --- app/test-compress-perf/comp_perf_options.h | 2 +- app/test-compress-perf/comp_perf_options_parse.c | 4 ++-- app/test-compress-perf/main.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/test-compress-perf/comp_perf_options.h b/app/test-compress-perf/comp_perf_options.h index 651cbea4e..e98d93c2f 100644 --- a/app/test-compress-perf/comp_perf_options.h +++ b/app/test-compress-perf/comp_perf_options.h @@ -11,7 +11,7 @@ #define MAX_MBUF_DATA_SIZE (UINT16_MAX - RTE_PKTMBUF_HEADROOM) #define MAX_SEG_SIZE ((int)(MAX_MBUF_DATA_SIZE / EXPANSE_RATIO)) -extern const char *cperf_test_type_strs[]; +extern const char *comp_perf_test_type_strs[]; /* Cleanup state machine */ enum cleanup_st { diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c index 01e19eafb..fa4fd0b41 100644 --- a/app/test-compress-perf/comp_perf_options_parse.c +++ b/app/test-compress-perf/comp_perf_options_parse.c @@ -82,11 +82,11 @@ parse_cperf_test_type(struct comp_test_data *test_data, const char *arg) { struct name_id_map cperftest_namemap[] = { { - cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK], + comp_perf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK], CPERF_TEST_TYPE_BENCHMARK }, { - cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY], + comp_perf_test_type_strs[CPERF_TEST_TYPE_VERIFY], CPERF_TEST_TYPE_VERIFY } }; diff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c index e7ac412e6..712ebdaee 100644 --- a/app/test-compress-perf/main.c +++ b/app/test-compress-perf/main.c @@ -21,7 +21,7 @@ #define NUM_MAX_INFLIGHT_OPS 512 __extension__ -const char *cperf_test_type_strs[] = { +const char *comp_perf_test_type_strs[] = { [CPERF_TEST_TYPE_BENCHMARK] = "benchmark", [CPERF_TEST_TYPE_VERIFY] = "verify" };