DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size
@ 2025-08-05  6:38 Shani Peretz
  2025-08-05 15:49 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Shani Peretz @ 2025-08-05  6:38 UTC (permalink / raw)
  To: dev
  Cc: suanmingm, Shani Peretz, stable, Kai Ji, Michal Kobylinski,
	Slawomir Mrozowicz, Marcin Kerlin, Piotr Azarewicz,
	Declan Doherty

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size
  2025-08-05  6:38 [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size Shani Peretz
@ 2025-08-05 15:49 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2025-08-05 15:49 UTC (permalink / raw)
  To: Shani Peretz
  Cc: dev, suanmingm, stable, Kai Ji, Michal Kobylinski,
	Slawomir Mrozowicz, Marcin Kerlin, Piotr Azarewicz,
	Declan Doherty

On Tue, 5 Aug 2025 09:38:00 +0300
Shani Peretz <shperetz@nvidia.com> wrote:

> 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;
> +		}
> +
>  	

It might help user to print the sizes?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-05 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-05  6:38 [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size Shani Peretz
2025-08-05 15:49 ` Stephen Hemminger

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).