From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fiona Trahe Subject: [PATCH 1/2] crypto/qat: fix null auth algo issue Date: Thu, 25 Jan 2018 17:19:14 +0000 Message-ID: <1516900755-28233-1-git-send-email-fiona.trahe@intel.com> Cc: radu.nicolau@intel.com, pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com To: dev@dpdk.org Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id DD15B1B1B6 for ; Thu, 25 Jan 2018 18:19:24 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If auth algorithm is RTE_CRYPTO_AUTH_NULL and digest_length is 0 in the xform and digest pointer is set in the op, then the PMD may overwrite memory at the digest pointer. With this patch the memory is not overwritten. Fixes: db0e952a5c01 ("crypto/qat: add NULL capability") Signed-off-by: Fiona Trahe --- drivers/crypto/qat/qat_crypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c index cff709a..fdc6d3b 100644 --- a/drivers/crypto/qat/qat_crypto.c +++ b/drivers/crypto/qat/qat_crypto.c @@ -1338,7 +1338,9 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg, } min_ofs = auth_ofs; - auth_param->auth_res_addr = op->sym->auth.digest.phys_addr; + if (likely(ctx->qat_hash_alg != ICP_QAT_HW_AUTH_ALGO_NULL)) + auth_param->auth_res_addr = + op->sym->auth.digest.phys_addr; } -- 2.7.4