From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5F4F43BDF for ; Fri, 8 Mar 2024 09:25:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C08FD42EF3; Fri, 8 Mar 2024 09:25:19 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by mails.dpdk.org (Postfix) with ESMTP id 66D7340298; Fri, 8 Mar 2024 09:25:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709886318; x=1741422318; h=from:to:cc:subject:date:message-id; bh=mjkQdd3C1RDEo4QQqjc4FHZCnJ3QdTmtI1THJj2i1dw=; b=Le4uumMEpyMqcgzf/GUJNayWd7tHFacgY2nOVX6n5HTCxiCBULZOxAMd dsVuJIt65aAgmtJ/Eidltwcz/FPrvAzMg26Z9W4BYq1/tSKI+Oop5H7O6 01xwPQsFIcRC44q5OezTlPgk7g+rPe5gsv4hfLRyKbC1Irw1AZ2UiWPh5 SR0J5JyLx00AOUqNCehvhhaNLJ52cnVBQd3sSrvkbFiO9VzxRGuwDFEYJ 2PCwjr/wlFvwZNrblzsPh1PXMjSGJIh0tks5vexqkGjVCBvF7NOwCdD1d DzS9mxD+2d9L1Xnhdh30wyZ7d1KiAn1IJsZIX3uPfb96AGXjIaBdDANSa w==; X-IronPort-AV: E=McAfee;i="6600,9927,11006"; a="8351888" X-IronPort-AV: E=Sophos;i="6.07,108,1708416000"; d="scan'208";a="8351888" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2024 00:25:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,108,1708416000"; d="scan'208";a="10836425" Received: from silpixa00400308.ir.intel.com ([10.237.214.154]) by orviesa007.jf.intel.com with ESMTP; 08 Mar 2024 00:25:16 -0800 From: Arkadiusz Kusztal To: dev@dpdk.org Cc: gakhil@marvell.com, ciara.power@intel.com, Arkadiusz Kusztal , stable@dpdk.org Subject: [PATCH] crypto/qat: fix ccm null aad pointer segfault Date: Fri, 8 Mar 2024 08:25:12 +0000 Message-Id: <20240308082512.5226-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org This commit fixes a segfault, that occurs when NULL pointer is being set to the aad pointer field. Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request") Cc: stable@dpdk.org Signed-off-by: Arkadiusz Kusztal --- drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h index eebf2e6eb8..83a6c30218 100644 --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h @@ -881,10 +881,12 @@ enqueue_one_aead_job_gen1(struct qat_sym_session *ctx, *(uint8_t *)&cipher_param->u.cipher_IV_array[0] = q - ICP_QAT_HW_CCM_NONCE_OFFSET; - rte_memcpy((uint8_t *)aad->va + - ICP_QAT_HW_CCM_NONCE_OFFSET, - (uint8_t *)iv->va + ICP_QAT_HW_CCM_NONCE_OFFSET, - ctx->cipher_iv.length); + if (ctx->aad_len > 0) { + rte_memcpy((uint8_t *)aad->va + + ICP_QAT_HW_CCM_NONCE_OFFSET, + (uint8_t *)iv->va + ICP_QAT_HW_CCM_NONCE_OFFSET, + ctx->cipher_iv.length); + } break; default: break; -- 2.13.6