patch 'test/crypto: fix check for OOP header data' has been queued to stable release 23.11.4
Xueming Li
xuemingl at nvidia.com
Tue Apr 8 10:01:53 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=923c56406f200d77e6fb969b4b23b4010096b766
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 923c56406f200d77e6fb969b4b23b4010096b766 Mon Sep 17 00:00:00 2001
From: Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com>
Date: Wed, 26 Feb 2025 08:16:45 +0000
Subject: [PATCH] test/crypto: fix check for OOP header data
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 27eb74ea6e25966d3857539cb15ddd4f20f05ebe ]
The data of the out-of-place header is never checked. Therefore,
the faulty PMD, which overwrites this data, will not be able to
verify that with tests. New checks to support that were added to
the GCM OOP functions.
Fixes: 51e202f0596f ("test/crypto: rename GCM test code")
Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com>
---
app/test/test_cryptodev.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 7d9fe29c02..48306266ba 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -12473,6 +12473,8 @@ test_authenticated_encryption_sessionless(
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ uint32_t i;
+ uint8_t *buffer_oop;
int retval;
uint8_t *ciphertext, *auth_tag;
uint16_t plaintext_pad_len;
@@ -12542,6 +12544,18 @@ test_authenticated_encryption_sessionless(
ut_params->op->sym->cipher.data.offset);
auth_tag = ciphertext + plaintext_pad_len;
+ /* Check if the data within the offset range is not overwritten in the OOP */
+ buffer_oop = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
+ for (i = 0; i < ut_params->op->sym->cipher.data.offset; i++) {
+ if (buffer_oop[i]) {
+ RTE_LOG(ERR, USER1,
+ "Incorrect value of the output buffer header\n");
+ debug_hexdump(stdout, "Incorrect value:", buffer_oop,
+ ut_params->op->sym->cipher.data.offset);
+ return TEST_FAILED;
+ }
+ }
+
debug_hexdump(stdout, "ciphertext:", ciphertext, tdata->ciphertext.len);
debug_hexdump(stdout, "auth tag:", auth_tag, tdata->auth_tag.len);
@@ -12576,6 +12590,8 @@ test_authenticated_decryption_sessionless(
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ uint32_t i;
+ uint8_t *buffer_oop;
int retval;
uint8_t *plaintext;
uint8_t key[tdata->key.len + 1];
@@ -12656,6 +12672,17 @@ test_authenticated_decryption_sessionless(
debug_hexdump(stdout, "plaintext:", plaintext, tdata->ciphertext.len);
+ /* Check if the data within the offset range is not overwritten in the OOP */
+ buffer_oop = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *);
+ for (i = 0; i < ut_params->op->sym->cipher.data.offset; i++) {
+ if (buffer_oop[i]) {
+ RTE_LOG(ERR, USER1,
+ "Incorrect value of the output buffer header\n");
+ debug_hexdump(stdout, "Incorrect value:", buffer_oop,
+ ut_params->op->sym->cipher.data.offset);
+ return TEST_FAILED;
+ }
+ }
/* Validate obuf */
TEST_ASSERT_BUFFERS_ARE_EQUAL(
plaintext,
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-04-08 15:39:06.811698895 +0800
+++ 0029-test-crypto-fix-check-for-OOP-header-data.patch 2025-04-08 15:39:05.956436571 +0800
@@ -1 +1 @@
-From 27eb74ea6e25966d3857539cb15ddd4f20f05ebe Mon Sep 17 00:00:00 2001
+From 923c56406f200d77e6fb969b4b23b4010096b766 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 27eb74ea6e25966d3857539cb15ddd4f20f05ebe ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -16,2 +18,2 @@
- app/test/test_cryptodev.c | 29 +++++++++++++++++++++++++++--
- 1 file changed, 27 insertions(+), 2 deletions(-)
+ app/test/test_cryptodev.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
@@ -20 +22 @@
-index 2e58819fca..bbab034c5f 100644
+index 7d9fe29c02..48306266ba 100644
@@ -23 +25 @@
-@@ -13798,8 +13798,9 @@ test_authenticated_encryption_oop(const struct aead_test_data *tdata)
+@@ -12473,6 +12473,8 @@ test_authenticated_encryption_sessionless(
@@ -27,0 +30 @@
++ uint8_t *buffer_oop;
@@ -29,2 +32 @@
-- uint8_t *ciphertext, *auth_tag;
-+ uint8_t *ciphertext, *auth_tag, *buffer_oop;
+ uint8_t *ciphertext, *auth_tag;
@@ -32,3 +34 @@
- struct rte_cryptodev_info dev_info;
-
-@@ -13875,6 +13876,18 @@ test_authenticated_encryption_oop(const struct aead_test_data *tdata)
+@@ -12542,6 +12544,18 @@ test_authenticated_encryption_sessionless(
@@ -53 +53 @@
-@@ -13907,8 +13920,9 @@ test_authenticated_decryption_oop(const struct aead_test_data *tdata)
+@@ -12576,6 +12590,8 @@ test_authenticated_decryption_sessionless(
@@ -57,0 +58 @@
++ uint8_t *buffer_oop;
@@ -59,6 +60,3 @@
-- uint8_t *plaintext;
-+ uint8_t *plaintext, *buffer_oop;
- struct rte_cryptodev_info dev_info;
-
- rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
-@@ -13986,6 +14000,17 @@ test_authenticated_decryption_oop(const struct aead_test_data *tdata)
+ uint8_t *plaintext;
+ uint8_t key[tdata->key.len + 1];
+@@ -12656,6 +12672,17 @@ test_authenticated_decryption_sessionless(
More information about the stable
mailing list