Skip to contentSkip to conversation

crypto/openssl: fix of ASAN heap-use-after-free

PATCH Applied Kai Ji 3 participants 3 messages Mar 8, 2023 – Mar 11, 2023 Crypto API

lore
Share & tools
lore

Kai Ji

author
#0 lore raw

PATCH 1/1 crypto/openssl: fix of ASAN heap-use-after-free

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")
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/openssl/rte_openssl_pmd.c +2 -2
index abcb641a44..384d262621 100644
@@ -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:
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Hey Kai,

Quoted 9 lines

-----Original Message-----
From: Kai Ji <[email protected]>
Sent: Wednesday 8 March 2023 14:48
To: [email protected]
Cc: [email protected]; Ji, Kai <[email protected]>
Subject: [dpdk-dev v1] crypto/openssl: fix of ASAN heap-use-after-free

fix of ASAN report on heap-use-after-free error on tmp buffer.

Quoted 9 lines
Fixes d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP

API")
Cc: [email protected]

---
 drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

[CP]
Need to add cc for [email protected]

Applied
#2 lore raw
Quoted 14 lines
Quoted 4 lines

Subject: [dpdk-dev v1] crypto/openssl: fix of ASAN heap-use-after-free

fix of ASAN report on heap-use-after-free error on tmp buffer.

Quoted 9 lines
Fixes d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP

API")
Cc: [email protected]

---
 drivers/crypto/openssl/rte_openssl_pmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines

[CP]
Need to add cc for [email protected]

Applied to dpdk-next-crypto
Cc: [email protected]
Thanks.