patch 'crypto/cnxk: refactor RSA verification' has been queued to stable release 23.11.6

Shani Peretz shperetz at nvidia.com
Thu Dec 25 10:17:25 CET 2025


Hi,

FYI, your patch has been queued to stable release 23.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/30/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/shanipr/dpdk-stable

This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/09f4829c2fa9f6cb3a30ce52184da89894e0fd2d

Thanks.

Shani

---
>From 09f4829c2fa9f6cb3a30ce52184da89894e0fd2d 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 ef9cb5eb91..527b5b9730 100644
--- a/drivers/crypto/cnxk/cnxk_ae.h
+++ b/drivers/crypto/cnxk/cnxk_ae.h
@@ -1173,20 +1173,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.43.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-12-25 11:16:36.581826409 +0200
+++ 0004-crypto-cnxk-refactor-RSA-verification.patch	2025-12-25 11:16:35.267823000 +0200
@@ -1 +1 @@
-From dfd038b97ec3d173ded0f985df39301b7c7662f2 Mon Sep 17 00:00:00 2001
+From 09f4829c2fa9f6cb3a30ce52184da89894e0fd2d 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 ef9cb5eb91..527b5b9730 100644
@@ -23 +24 @@
-@@ -1592,20 +1592,17 @@ cnxk_ae_dequeue_rsa_op(struct rte_crypto_op *cop, uint8_t *rptr,
+@@ -1173,20 +1173,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