patch 'test/crypto: fix check for OOP header data' has been queued to stable release 22.11.8
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Fri Mar 7 13:24:24 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.8
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/09/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/bb8feaacb4897e3ee4341dd838de538869d8225e
Thanks.
Luca Boccassi
---
>From bb8feaacb4897e3ee4341dd838de538869d8225e 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
[ 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 | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index b093fd4ae9..ac477431c4 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -11652,8 +11652,9 @@ test_authenticated_encryption_sessionless(
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ uint32_t i;
int retval;
- uint8_t *ciphertext, *auth_tag;
+ uint8_t *ciphertext, *auth_tag, *buffer_oop;
uint16_t plaintext_pad_len;
uint8_t key[tdata->key.len + 1];
struct rte_cryptodev_info dev_info;
@@ -11721,6 +11722,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);
@@ -11755,8 +11768,9 @@ test_authenticated_decryption_sessionless(
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ uint32_t i;
int retval;
- uint8_t *plaintext;
+ uint8_t *plaintext, *buffer_oop;
uint8_t key[tdata->key.len + 1];
struct rte_cryptodev_info dev_info;
@@ -11833,6 +11847,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.47.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-03-07 12:23:38.932878001 +0000
+++ 0025-test-crypto-fix-check-for-OOP-header-data.patch 2025-03-07 12:23:38.034839111 +0000
@@ -1 +1 @@
-From 27eb74ea6e25966d3857539cb15ddd4f20f05ebe Mon Sep 17 00:00:00 2001
+From bb8feaacb4897e3ee4341dd838de538869d8225e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 27eb74ea6e25966d3857539cb15ddd4f20f05ebe ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 2e58819fca..bbab034c5f 100644
+index b093fd4ae9..ac477431c4 100644
@@ -23 +24 @@
-@@ -13798,8 +13798,9 @@ test_authenticated_encryption_oop(const struct aead_test_data *tdata)
+@@ -11652,8 +11652,9 @@ test_authenticated_encryption_sessionless(
@@ -31,0 +33 @@
+ uint8_t key[tdata->key.len + 1];
@@ -33,2 +35 @@
-
-@@ -13875,6 +13876,18 @@ test_authenticated_encryption_oop(const struct aead_test_data *tdata)
+@@ -11721,6 +11722,18 @@ test_authenticated_encryption_sessionless(
@@ -53 +54 @@
-@@ -13907,8 +13920,9 @@ test_authenticated_decryption_oop(const struct aead_test_data *tdata)
+@@ -11755,8 +11768,9 @@ test_authenticated_decryption_sessionless(
@@ -60,0 +62 @@
+ uint8_t key[tdata->key.len + 1];
@@ -63,2 +65 @@
- 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)
+@@ -11833,6 +11847,17 @@ test_authenticated_decryption_sessionless(
More information about the stable
mailing list