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 0462D42AD5; Thu, 11 May 2023 15:59:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81200406B6; Thu, 11 May 2023 15:59:53 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 8530540697; Thu, 11 May 2023 15:59:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683813591; x=1715349591; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Hlkv8AjQw9B19x1OzkzymDlNK4V7kSv+YbWpPBWxUf8=; b=G4ZPaOqsxwM1VogQe+D7tNE0GsH81MxdKFd/tBL9yjM3U06j2QjG0NhK ytLSsJwFC1hwgOFc0LgOjW9Ull6Xmd+22i6bjkfk23FcIFSHau+7t3dCi NCR8SaO7Wl6+sMItJYoc88Xfd7GtW6UpL2WPWFmj/FsOABwgT2X5hy7nh CzW+4JfG7Q5essQqKV/T4qwx4VkjaQtKDAlEVwmJeNfnZN/bsHLcowTUB KJ1J28c/OGiWs9uLizb81/RGTIZquUyKqpzp5tZI+ZMWWOHPU5GJKS22X Nvs7Nb2N5jcIZTAz/sTzU/hLt/MY7sqwaS7xut/cCRmm0Cjjv+w03Uig2 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="413855051" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="413855051" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 06:59:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="823972058" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="823972058" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by orsmga004.jf.intel.com with ESMTP; 11 May 2023 06:59:49 -0700 From: Ciara Power To: Kai Ji Cc: dev@dpdk.org, Saoirse O'Donovan , stable@dpdk.org, Ciara Power Subject: [PATCH] crypto/openssl: fix memory free issue Date: Thu, 11 May 2023 13:59:44 +0000 Message-Id: <20230511135944.142416-1-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Saoirse O'Donovan Allocated memory was being freed using 'free' when it should have been freed using 'OPENSSL_free'. This has now been modified so that the correct method is used to free allocated memory. Coverity issue: 384415 Fixes: 4c7ae22f1f83 ("crypto/openssl: update DSA routine with 3.0 EVP API") Cc: kai.ji@intel.com Cc: stable@dpdk.org Signed-off-by: Saoirse O'Donovan Signed-off-by: Ciara Power --- drivers/crypto/openssl/rte_openssl_pmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index 384d262621..f65fbca300 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -1927,7 +1927,7 @@ process_openssl_dsa_sign_op_evp(struct rte_crypto_op *cop, if (EVP_PKEY_sign(dsa_ctx, dsa_sign_data, &outlen, op->message.data, op->message.length) <= 0) { - free(dsa_sign_data); + OPENSSL_free(dsa_sign_data); goto err_dsa_sign; } @@ -1935,7 +1935,7 @@ process_openssl_dsa_sign_op_evp(struct rte_crypto_op *cop, DSA_SIG *sign = d2i_DSA_SIG(NULL, &dsa_sign_data_p, outlen); if (!sign) { OPENSSL_LOG(ERR, "%s:%d\n", __func__, __LINE__); - free(dsa_sign_data); + OPENSSL_free(dsa_sign_data); goto err_dsa_sign; } else { const BIGNUM *r = NULL, *s = NULL; @@ -1947,7 +1947,7 @@ process_openssl_dsa_sign_op_evp(struct rte_crypto_op *cop, } DSA_SIG_free(sign); - free(dsa_sign_data); + OPENSSL_free(dsa_sign_data); return 0; err_dsa_sign: -- 2.25.1