DPDK patches and discussions
 help / color / mirror / Atom feed
From: Lavanya Govindarajan <lavanyax.govindarajan@intel.com>
To: dev@dpdk.org
Cc: reshma.pattan@intel.com, ferruh.yigit@intel.com,
	Lavanya Govindarajan <lavanyax.govindarajan@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: fix out-of-bounds read
Date: Thu, 26 Sep 2019 14:30:05 +0100	[thread overview]
Message-ID: <1569504605-1344-1-git-send-email-lavanyax.govindarajan@intel.com> (raw)

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 <lavanyax.govindarajan@intel.com>
---
 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"
 };
-- 
2.17.2


             reply	other threads:[~2019-09-26 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26 13:30 Lavanya Govindarajan [this message]
2019-09-27 14:15 ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1569504605-1344-1-git-send-email-lavanyax.govindarajan@intel.com \
    --to=lavanyax.govindarajan@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).