From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 3CE8756A1; Tue, 11 Apr 2017 16:43:11 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2017 07:43:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,186,1488873600"; d="scan'208";a="1154387260" Received: from silpixa00381631.ir.intel.com (HELO silpixa00381631.ger.corp.intel.com) ([10.237.222.122]) by fmsmga002.fm.intel.com with ESMTP; 11 Apr 2017 07:43:09 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: declan.doherty@intel.com, stable@dpdk.org, Pablo de Lara Date: Tue, 11 Apr 2017 15:42:59 +0100 Message-Id: <1491921779-33239-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-stable] [PATCH] app/crypto-perf: fix possible overflow 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: Tue, 11 Apr 2017 14:43:12 -0000 In the latency test, when number of enqueued operations is less than the burst size, the timestamp value of the non-enqueued operations was being stored, even though those operations were being freed. This could cause an array overflow, since it could store more values than the total number of operations. Fixes: 5d75fb09d3be ("app/crypto-perf: fix invalid latency for QAT") Signed-off-by: Pablo de Lara --- app/test-crypto-perf/cperf_test_latency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 3275b4b..e61ac97 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -396,7 +396,7 @@ cperf_latency_test_runner(void *arg) for (i = ops_enqd; i < burst_size; i++) rte_crypto_op_free(ops[i]); - for (i = 0; i < burst_size; i++) { + for (i = 0; i < ops_enqd; i++) { ctx->res[tsc_idx].tsc_start = tsc_start; ops[i]->opaque_data = (void *)&ctx->res[tsc_idx]; tsc_idx++; -- 2.7.4