From: Shani Peretz <shperetz@nvidia.com>
To: <dev@dpdk.org>
Cc: <suanmingm@nvidia.com>, Shani Peretz <shperetz@nvidia.com>,
<stable@dpdk.org>, Kai Ji <kai.ji@intel.com>,
Michal Kobylinski <michalx.kobylinski@intel.com>,
Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>,
Marcin Kerlin <marcinx.kerlin@intel.com>,
Piotr Azarewicz <piotr.azarewicz@intel.com>,
Declan Doherty <declan.doherty@intel.com>
Subject: [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size
Date: Tue, 5 Aug 2025 09:38:00 +0300 [thread overview]
Message-ID: <20250805063800.225231-1-shperetz@nvidia.com> (raw)
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
next reply other threads:[~2025-08-05 6:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 6:38 Shani Peretz [this message]
2025-08-05 15:49 ` Stephen Hemminger
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=20250805063800.225231-1-shperetz@nvidia.com \
--to=shperetz@nvidia.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=kai.ji@intel.com \
--cc=marcinx.kerlin@intel.com \
--cc=michalx.kobylinski@intel.com \
--cc=piotr.azarewicz@intel.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).