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 6D37641E27; Wed, 8 Mar 2023 15:48:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DAC8410EE; Wed, 8 Mar 2023 15:48:09 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id B1F0040FAE for ; Wed, 8 Mar 2023 15:48:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678286887; x=1709822887; h=from:to:cc:subject:date:message-id; bh=1bb2mvoFdNR7DEE9CPL8ov/kH1jf+OvnbeXo1+BQkqY=; b=TXx0TcVxMnVI5W3Q+/gCZ6XScRoVZsb2xP2zfoog+N6DAi3Ns5hzy+VN d3qeN09+Z7k3ZNz+FbN6xuCy556fDyTDDMqHoecCgIQjg+8OD9k+YbDKo QxZooeRx0yO3Djeb1bhUGawEJ5NQPHD1U1VOlOJ/NxP8MxO3VqbeOS8oC ERTiZaMoV/pvhmLHbaHzGrJXsmtmOLPlAFvqUkp1vKuRqO7zt0Y3NawyP JktM7r7UFC7L4H0+H6dHEGrAx1ldUyNr0O3AfpIdmomcdmfi6jXNf6d4m 4ov7+C3roaYsMmZ/Iu7hMseEKiMBq3Qxt68x10Ibhv583a3o5vQFEiLwr Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="336182308" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="336182308" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 06:47:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="820245688" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="820245688" Received: from silpixa00400465.ir.intel.com ([10.55.128.39]) by fmsmga001.fm.intel.com with ESMTP; 08 Mar 2023 06:47:50 -0800 From: Kai Ji To: dev@dpdk.org Cc: gakhil@marvell.com, Kai Ji Subject: [dpdk-dev v1] crypto/openssl: fix of ASAN heap-use-after-free Date: Wed, 8 Mar 2023 22:47:48 +0800 Message-Id: <20230308144748.28370-1-kai.ji@intel.com> X-Mailer: git-send-email 2.17.1 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 fix of ASAN report on heap-use-after-free error on tmp buffer. Fixes: d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP API") Cc: kai.ji@intel.com Signed-off-by: Kai Ji --- drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index abcb641a44..384d262621 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -2633,7 +2633,7 @@ process_openssl_rsa_op_evp(struct rte_crypto_op *cop, if (EVP_PKEY_verify_recover(rsa_ctx, tmp, &outlen, op->rsa.sign.data, op->rsa.sign.length) <= 0) { - rte_free(tmp); + OPENSSL_free(tmp); goto err_rsa; } @@ -2645,7 +2645,7 @@ process_openssl_rsa_op_evp(struct rte_crypto_op *cop, op->rsa.message.length)) { OPENSSL_LOG(ERR, "RSA sign Verification failed"); } - rte_free(tmp); + OPENSSL_free(tmp); break; default: -- 2.17.1