From patchwork Tue Aug 1 00:33:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 27304 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id EAA309B57; Tue, 1 Aug 2017 10:33:19 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id EFF2E9B51 for ; Tue, 1 Aug 2017 10:33:17 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2017 01:33:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.41,305,1498546800"; d="scan'208"; a="1157622673" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by orsmga001.jf.intel.com with ESMTP; 01 Aug 2017 01:33:15 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: Pablo de Lara Date: Tue, 1 Aug 2017 01:33:36 +0100 Message-Id: <20170801003336.15796-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 Subject: [dpdk-dev] [PATCH] app/crypto-perf: fix incorrect IV allocation 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" Memory is reserved after each crypto operation for the necessary IV(s), which could be for cipher, authentication or AEAD algorithms. However, for AEAD algorithms (such as AES-GCM), this memory was not being reserved, leading to potential memory overflow. Fixes: 8a5b494a7f99 ("app/test-crypto-perf: add AEAD parameters") Signed-off-by: Pablo de Lara --- app/test-crypto-perf/cperf_test_latency.c | 3 ++- app/test-crypto-perf/cperf_test_throughput.c | 2 +- app/test-crypto-perf/cperf_test_verify.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 20e9686..7e610d9 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -291,7 +291,8 @@ cperf_latency_test_constructor(struct rte_mempool *sess_mp, uint16_t priv_size = sizeof(struct priv_op_data) + test_vector->cipher_iv.length + - test_vector->auth_iv.length; + test_vector->auth_iv.length + + test_vector->aead_iv.length; ctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name, RTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 512, priv_size, rte_socket_id()); diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c index 85ed21a..3bb1cb0 100644 --- a/app/test-crypto-perf/cperf_test_throughput.c +++ b/app/test-crypto-perf/cperf_test_throughput.c @@ -271,7 +271,7 @@ cperf_throughput_test_constructor(struct rte_mempool *sess_mp, dev_id); uint16_t priv_size = test_vector->cipher_iv.length + - test_vector->auth_iv.length; + test_vector->auth_iv.length + test_vector->aead_iv.length; ctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name, RTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index 1827e6f..a314646 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -275,7 +275,7 @@ cperf_verify_test_constructor(struct rte_mempool *sess_mp, dev_id); uint16_t priv_size = test_vector->cipher_iv.length + - test_vector->auth_iv.length; + test_vector->auth_iv.length + test_vector->aead_iv.length; ctx->crypto_op_pool = rte_crypto_op_pool_create(pool_name, RTE_CRYPTO_OP_TYPE_SYMMETRIC, options->pool_sz, 512, priv_size, rte_socket_id());