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 DC62B46BAE for ; Fri, 18 Jul 2025 21:37:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D49B140E5A; Fri, 18 Jul 2025 21:37:21 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id AA00840611 for ; Fri, 18 Jul 2025 21:37:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1752867439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BCGVA/o4++AxGpRRYdt9uzB3bP9FYnCiMzu1Lfz1rj8=; b=Q4pYiutsh5J7VEbnjN8tmHVLrG9vUcPC23jTROPx8Xk5YJQSy0K8fP3ZsIGUWfbI3EbMzn G/sYlVBn6Mk4OG3PxHdNOwB1YSUDiG0bYqSGgnYFUeLTJ+7Ascvc3Cx27Rqn3oZUI0nWHx j/2vWkPiCznnPa0K+oN2sZ7fdq486Ok= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-391-s6YnMQMDNN2O98UrcdpSjw-1; Fri, 18 Jul 2025 15:37:17 -0400 X-MC-Unique: s6YnMQMDNN2O98UrcdpSjw-1 X-Mimecast-MFC-AGG-ID: s6YnMQMDNN2O98UrcdpSjw_1752867436 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 98C9E195608C; Fri, 18 Jul 2025 19:37:16 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.40]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5572E18003FC; Fri, 18 Jul 2025 19:37:15 +0000 (UTC) From: Kevin Traynor To: Gowrishankar Muthukrishnan Cc: dpdk stable Subject: patch 'test/crypto: fix RSA decrypt validation' has been queued to stable release 24.11.3 Date: Fri, 18 Jul 2025 20:31:00 +0100 Message-ID: <20250718193247.1008129-126-ktraynor@redhat.com> In-Reply-To: <20250718193247.1008129-1-ktraynor@redhat.com> References: <20250718193247.1008129-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: MhYYqslL3wMj4DEgsUBjXnNmcdaH3dyq1t3x7Ei24R4_1752867436 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 24.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/23/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/4c9b62031566d4e6ef2960ad7bdcef8df3ea27b9 Thanks. Kevin --- >From 4c9b62031566d4e6ef2960ad7bdcef8df3ea27b9 Mon Sep 17 00:00:00 2001 From: Gowrishankar Muthukrishnan Date: Fri, 20 Jun 2025 13:49:18 +0530 Subject: [PATCH] test/crypto: fix RSA decrypt validation [ upstream commit 9af3fa536ec23d254d15fea4ec0e58442e56409e ] Following RSA encrypt op, same plaintext buffer is used as output buffer for decrypt op, hence comparing plaintext buffer against same buffer pointer in crypto op always succeed irrespective of whether decrypt op succeeds or not. This patch fixes this issue with a local buffer for crypto op. Fixes: 5ae36995f10f ("test/crypto: move RSA enqueue/dequeue into functions") Signed-off-by: Gowrishankar Muthukrishnan --- app/test/test_cryptodev_asym.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c index 0d47b7b299..cb5e07368a 100644 --- a/app/test/test_cryptodev_asym.c +++ b/app/test/test_cryptodev_asym.c @@ -152,5 +152,8 @@ queue_ops_rsa_enc_dec(void *sess) struct rte_crypto_asym_op *asym_op; uint8_t cipher_buf[TEST_DATA_SIZE] = {0}; - int ret, status = TEST_SUCCESS; + uint8_t msg_buf[TEST_DATA_SIZE] = {0}; + int ret, status; + + memcpy(msg_buf, rsaplaintext.data, rsaplaintext.len); /* Set up crypto op data structure */ @@ -167,5 +170,5 @@ queue_ops_rsa_enc_dec(void *sess) asym_op->rsa.op_type = RTE_CRYPTO_ASYM_OP_ENCRYPT; - asym_op->rsa.message.data = rsaplaintext.data; + asym_op->rsa.message.data = msg_buf; asym_op->rsa.cipher.data = cipher_buf; asym_op->rsa.cipher.length = RTE_DIM(rsa_n); @@ -202,4 +205,5 @@ queue_ops_rsa_enc_dec(void *sess) asym_op->rsa.message.length = RTE_DIM(rsa_n); asym_op->rsa.op_type = RTE_CRYPTO_ASYM_OP_DECRYPT; + memset(asym_op->rsa.message.data, 0, asym_op->rsa.message.length); /* Process crypto operation */ @@ -218,9 +222,18 @@ queue_ops_rsa_enc_dec(void *sess) goto error_exit; } - status = TEST_SUCCESS; + + if (result_op->status != RTE_CRYPTO_OP_STATUS_SUCCESS) { + RTE_LOG(ERR, USER1, "Expected crypto op to succeed\n"); + status = TEST_FAILED; + goto error_exit; + } + ret = rsa_verify(&rsaplaintext, result_op); - if (ret) + if (ret) { status = TEST_FAILED; + goto error_exit; + } + status = TEST_SUCCESS; error_exit: -- 2.50.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-07-18 20:29:15.428471122 +0100 +++ 0126-test-crypto-fix-RSA-decrypt-validation.patch 2025-07-18 20:29:11.074907772 +0100 @@ -1 +1 @@ -From 9af3fa536ec23d254d15fea4ec0e58442e56409e Mon Sep 17 00:00:00 2001 +From 4c9b62031566d4e6ef2960ad7bdcef8df3ea27b9 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9af3fa536ec23d254d15fea4ec0e58442e56409e ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 87c26322d0..20afb5e98b 100644 +index 0d47b7b299..cb5e07368a 100644 @@ -24 +25 @@ -@@ -176,5 +176,8 @@ queue_ops_rsa_enc_dec(void *sess) +@@ -152,5 +152,8 @@ queue_ops_rsa_enc_dec(void *sess) @@ -34 +35 @@ -@@ -191,5 +194,5 @@ queue_ops_rsa_enc_dec(void *sess) +@@ -167,5 +170,5 @@ queue_ops_rsa_enc_dec(void *sess) @@ -41 +42 @@ -@@ -226,4 +229,5 @@ queue_ops_rsa_enc_dec(void *sess) +@@ -202,4 +205,5 @@ queue_ops_rsa_enc_dec(void *sess) @@ -47 +48 @@ -@@ -242,9 +246,18 @@ queue_ops_rsa_enc_dec(void *sess) +@@ -218,9 +222,18 @@ queue_ops_rsa_enc_dec(void *sess)