patch 'crypto/cnxk: refactor RSA verification' has been queued to stable release 22.11.11
    luca.boccassi at gmail.com 
    luca.boccassi at gmail.com
       
    Mon Oct 27 17:19:52 CET 2025
    
    
  
Hi,
FYI, your patch has been queued to stable release 22.11.11
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/29/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://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/3b34eb20115e16dc18577a4d5d087bb519eb73b5
Thanks.
Luca Boccassi
---
>From 3b34eb20115e16dc18577a4d5d087bb519eb73b5 Mon Sep 17 00:00:00 2001
From: Sucharitha Sarananaga <ssarananaga at marvell.com>
Date: Mon, 29 Sep 2025 15:13:49 +0530
Subject: [PATCH] crypto/cnxk: refactor RSA verification
[ upstream commit dfd038b97ec3d173ded0f985df39301b7c7662f2 ]
This patch avoid copying the decrypted message into
the signature buffer, which is actually an input to the
verify operation. This prevents overwriting the input
buffer unnecessarily.
Fixes: 6661bedf1605 ("crypto/cnxk: add asymmetric datapath")
Signed-off-by: Sucharitha Sarananaga <ssarananaga at marvell.com>
---
 drivers/crypto/cnxk/cnxk_ae.h | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/crypto/cnxk/cnxk_ae.h b/drivers/crypto/cnxk/cnxk_ae.h
index 156bd2e94f..231060b387 100644
--- a/drivers/crypto/cnxk/cnxk_ae.h
+++ b/drivers/crypto/cnxk/cnxk_ae.h
@@ -841,20 +841,17 @@ cnxk_ae_dequeue_rsa_op(struct rte_crypto_op *cop, uint8_t *rptr,
 	case RTE_CRYPTO_ASYM_OP_VERIFY:
 		if (rsa->padding.type == RTE_CRYPTO_RSA_PADDING_NONE) {
 			rsa->sign.length = rsa_ctx->n.length;
-			memcpy(rsa->sign.data, rptr, rsa->sign.length);
+			if (memcmp(rptr, rsa->message.data, rsa->message.length))
+				cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
 		} else {
 			/* Get length of signed output */
-			rsa->sign.length =
-				rte_cpu_to_be_16(*((uint16_t *)rptr));
+			rsa->sign.length = rte_cpu_to_be_16(*((uint16_t *)rptr));
 			/*
 			 * Offset output data pointer by length field
-			 * (2 bytes) and copy signed data.
+			 * (2 bytes) and compare signed data.
 			 */
-			memcpy(rsa->sign.data, rptr + 2, rsa->sign.length);
-		}
-		if (memcmp(rsa->sign.data, rsa->message.data,
-			   rsa->message.length)) {
-			cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
+			if (memcmp(rptr + 2, rsa->message.data, rsa->message.length))
+				cop->status = RTE_CRYPTO_OP_STATUS_ERROR;
 		}
 		break;
 	default:
-- 
2.47.3
---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-27 15:54:37.474262967 +0000
+++ 0074-crypto-cnxk-refactor-RSA-verification.patch	2025-10-27 15:54:34.851950954 +0000
@@ -1 +1 @@
-From dfd038b97ec3d173ded0f985df39301b7c7662f2 Mon Sep 17 00:00:00 2001
+From 3b34eb20115e16dc18577a4d5d087bb519eb73b5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit dfd038b97ec3d173ded0f985df39301b7c7662f2 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 8508ab8736..912a2a9496 100644
+index 156bd2e94f..231060b387 100644
@@ -23 +24 @@
-@@ -1592,20 +1592,17 @@ cnxk_ae_dequeue_rsa_op(struct rte_crypto_op *cop, uint8_t *rptr,
+@@ -841,20 +841,17 @@ cnxk_ae_dequeue_rsa_op(struct rte_crypto_op *cop, uint8_t *rptr,
@@ -25 +26 @@
- 		if (rsa_ctx->padding.type == RTE_CRYPTO_RSA_PADDING_NONE) {
+ 		if (rsa->padding.type == RTE_CRYPTO_RSA_PADDING_NONE) {
    
    
More information about the stable
mailing list