From: Pablo de Lara Date: Tue, 1 Aug 2017 00:33:36 +0000 (+0100) Subject: app/crypto-perf: fix IV allocation for AEAD X-Git-Tag: spdx-start~2235 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b27074cc949870a66b107d1b98192c39affee0f6;p=dpdk.git app/crypto-perf: fix IV allocation for AEAD 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 --- diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 20e9686e4d..7e610d9318 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 85ed21a959..3bb1cb057b 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 1827e6f99d..a314646c2d 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());