From: "Ji, Kai" <kai.ji@intel.com>
To: Shani Peretz <shperetz@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "suanmingm@nvidia.com" <suanmingm@nvidia.com>,
"stable@dpdk.org" <stable@dpdk.org>,
"Kobylinski, Michal" <michal.kobylinski@intel.com>,
Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>,
Marcin Kerlin <marcinx.kerlin@intel.com>,
Piotr Azarewicz <piotr.azarewicz@intel.com>,
"Doherty, Declan" <declan.doherty@intel.com>
Subject: Re: [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size
Date: Wed, 3 Sep 2025 15:45:58 +0000 [thread overview]
Message-ID: <DS0PR11MB7458E16D4DBBC73149AEEFBD8101A@DS0PR11MB7458.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20250805063800.225231-1-shperetz@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 2067 bytes --]
Acked-by: Kai Ji <kai.ji@intel.com>
________________________________
From: Shani Peretz <shperetz@nvidia.com>
Sent: 05 August 2025 07:38
To: dev@dpdk.org <dev@dpdk.org>
Cc: suanmingm@nvidia.com <suanmingm@nvidia.com>; Shani Peretz <shperetz@nvidia.com>; stable@dpdk.org <stable@dpdk.org>; Ji, Kai <kai.ji@intel.com>; Kobylinski, Michal <michal.kobylinski@intel.com>; Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>; Marcin Kerlin <marcinx.kerlin@intel.com>; Piotr Azarewicz <piotr.azarewicz@intel.com>; Doherty, Declan <declan.doherty@intel.com>
Subject: [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size
When test vector plaintext exceeds buffer size, only the first
max_buffer_size bytes are processed, causing incorrect digest
verification (computed vs expected mismatch).
This patch fixes this issue by checking that the plaintext size is
larger than the buffer size and returns an error with a log.
Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Shani Peretz <shperetz@nvidia.com>
---
app/test-crypto-perf/cperf_test_vector_parsing.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c
index 737d61d4af..04ca9cf019 100644
--- a/app/test-crypto-perf/cperf_test_vector_parsing.c
+++ b/app/test-crypto-perf/cperf_test_vector_parsing.c
@@ -308,6 +308,12 @@ parse_entry(char *entry, struct cperf_test_vector *vector,
if (strstr(key_token, "plaintext")) {
rte_free(vector->plaintext.data);
vector->plaintext.data = data;
+
+ if (opts->test == CPERF_TEST_TYPE_VERIFY && data_length > opts->max_buffer_size) {
+ printf("Global plaintext larger than buffer_sz\n");
+ return -1;
+ }
+
if (tc_found)
vector->plaintext.length = data_length;
else {
--
2.34.1
[-- Attachment #2: Type: text/html, Size: 4038 bytes --]
prev parent reply other threads:[~2025-09-03 15:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 6:38 Shani Peretz
2025-08-05 15:49 ` Stephen Hemminger
2025-08-25 7:14 ` [PATCH v2] " Shani Peretz
2025-09-03 15:45 ` Ji, Kai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DS0PR11MB7458E16D4DBBC73149AEEFBD8101A@DS0PR11MB7458.namprd11.prod.outlook.com \
--to=kai.ji@intel.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=marcinx.kerlin@intel.com \
--cc=michal.kobylinski@intel.com \
--cc=piotr.azarewicz@intel.com \
--cc=shperetz@nvidia.com \
--cc=slawomirx.mrozowicz@intel.com \
--cc=stable@dpdk.org \
--cc=suanmingm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).