patch 'crypto/openssl: validate incorrect RSA signature' has been queued to stable release 23.11.4

Xueming Li xuemingl at nvidia.com
Tue Apr 8 10:01:52 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/10/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=1beaef965d323ec092dd7ac589c10d44491c4bfa

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 1beaef965d323ec092dd7ac589c10d44491c4bfa Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Sun, 23 Feb 2025 11:34:04 +0530
Subject: [PATCH] crypto/openssl: validate incorrect RSA signature
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6c209dd8785f34bfdc99b869c14e063d084508c2 ]

Return correct error status when incorrect signature is
used in RSA verify op.

Fixes: d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP API")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 drivers/crypto/openssl/rte_openssl_pmd.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index 11734c4c21..1e6f0467e3 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -2803,9 +2803,15 @@ process_openssl_rsa_op_evp(struct rte_crypto_op *cop,
 			goto err_rsa;
 		}
 
-		if (EVP_PKEY_verify_recover(rsa_ctx, tmp, &outlen,
+		ret = EVP_PKEY_verify_recover(rsa_ctx, tmp, &outlen,
 				op->rsa.sign.data,
-				op->rsa.sign.length) <= 0) {
+				op->rsa.sign.length);
+		if (ret <= 0) {
+			/* OpenSSL RSA verification returns one on
+			 * successful verification, otherwise 0. Hence,
+			 * this enqueue operation should succeed even if
+			 * invalid signature has been requested in verify.
+			 */
 			OPENSSL_free(tmp);
 			goto err_rsa;
 		}
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-04-08 15:39:06.788577203 +0800
+++ 0028-crypto-openssl-validate-incorrect-RSA-signature.patch	2025-04-08 15:39:05.946436575 +0800
@@ -1 +1 @@
-From 6c209dd8785f34bfdc99b869c14e063d084508c2 Mon Sep 17 00:00:00 2001
+From 1beaef965d323ec092dd7ac589c10d44491c4bfa Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6c209dd8785f34bfdc99b869c14e063d084508c2 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -19 +21 @@
-index b090611bd0..5bfad92b7c 100644
+index 11734c4c21..1e6f0467e3 100644


More information about the stable mailing list