From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BE16848A44 for ; Fri, 31 Oct 2025 15:40:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B73E3406B6; Fri, 31 Oct 2025 15:40:02 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B5E88406B6 for ; Fri, 31 Oct 2025 15:40:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761921600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3vLzMzFXoOpp7s+BVfrRaF5gF7Wmtwa+lLcAYZPuubA=; b=gzocfJ5UW6Xngci8wIwsNZavdgBKDFsSxG6B0RPor6ZoDtVAlbZyb1qRUgcDIS1AF4Pvmk WfTicrVo0SN6sf5jSAM3MXyURTF/LcDJvIXK5ZoC4IYnx6J191Xns5TijcBg7TDgwZm8c8 eucgEqp4Y/ADqRwrZ2Loan0q5cjiVf0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-124-ohZlcmlpMvSgA3nyvD8-Vg-1; Fri, 31 Oct 2025 10:39:57 -0400 X-MC-Unique: ohZlcmlpMvSgA3nyvD8-Vg-1 X-Mimecast-MFC-AGG-ID: ohZlcmlpMvSgA3nyvD8-Vg_1761921596 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BB8191956060; Fri, 31 Oct 2025 14:39:56 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BEB65180044F; Fri, 31 Oct 2025 14:39:54 +0000 (UTC) From: Kevin Traynor To: Shani Peretz Cc: Kai Ji , Akhil Goyal , dpdk stable Subject: patch 'app/crypto-perf: fix plaintext size exceeds buffer size' has been queued to stable release 24.11.4 Date: Fri, 31 Oct 2025 14:34:05 +0000 Message-ID: <20251031143421.324432-123-ktraynor@redhat.com> In-Reply-To: <20251031143421.324432-1-ktraynor@redhat.com> References: <20251031143421.324432-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: pDc4QgVTWhQDLNxOaZpzqjEAwba4PUv9w0GVCcFx87g_1761921596 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 24.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 11/05/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/76f76023a939629285d357bbe3b786138b6ae4b5 Thanks. Kevin --- >From 76f76023a939629285d357bbe3b786138b6ae4b5 Mon Sep 17 00:00:00 2001 From: Shani Peretz Date: Mon, 25 Aug 2025 10:14:50 +0300 Subject: [PATCH] app/crypto-perf: fix plaintext size exceeds buffer size [ upstream commit b2988038656b03d1c019114fbe7609018cc16e87 ] 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") Signed-off-by: Shani Peretz Acked-by: Kai Ji Acked-by: Akhil Goyal --- .../cperf_test_vector_parsing.c | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_vector_parsing.c b/app/test-crypto-perf/cperf_test_vector_parsing.c index 737d61d4af..5665fb425b 100644 --- a/app/test-crypto-perf/cperf_test_vector_parsing.c +++ b/app/test-crypto-perf/cperf_test_vector_parsing.c @@ -309,10 +309,17 @@ parse_entry(char *entry, struct cperf_test_vector *vector, 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 (%u) larger than buffer_sz (%u)\n", + data_length, opts->max_buffer_size); + return -1; + } + if (tc_found) vector->plaintext.length = data_length; else { if (opts->max_buffer_size > data_length) { - printf("Global plaintext shorter than " - "buffer_sz\n"); + printf("Global plaintext (%u) shorter than " + "buffer_sz (%u)\n", data_length, opts->max_buffer_size); return -1; } @@ -327,6 +334,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->cipher_key_sz > data_length) { - printf("Global cipher_key shorter than " - "cipher_key_sz\n"); + printf("Global cipher_key (%u) shorter than " + "cipher_key_sz (%u)\n", data_length, opts->cipher_key_sz); return -1; } @@ -341,6 +348,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->auth_key_sz > data_length) { - printf("Global auth_key shorter than " - "auth_key_sz\n"); + printf("Global auth_key (%u) shorter than " + "auth_key_sz (%u)\n", data_length, opts->auth_key_sz); return -1; } @@ -355,6 +362,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->aead_key_sz > data_length) { - printf("Global aead_key shorter than " - "aead_key_sz\n"); + printf("Global aead_key (%u) shorter than " + "aead_key_sz (%u)\n", data_length, opts->aead_key_sz); return -1; } @@ -369,6 +376,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->cipher_iv_sz > data_length) { - printf("Global cipher iv shorter than " - "cipher_iv_sz\n"); + printf("Global cipher iv (%u) shorter than " + "cipher_iv_sz (%u)\n", data_length, opts->cipher_iv_sz); return -1; } @@ -383,6 +390,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->auth_iv_sz > data_length) { - printf("Global auth iv shorter than " - "auth_iv_sz\n"); + printf("Global auth iv (%u) shorter than " + "auth_iv_sz (%u)\n", data_length, opts->auth_iv_sz); return -1; } @@ -397,6 +404,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->aead_iv_sz > data_length) { - printf("Global aead iv shorter than " - "aead_iv_sz\n"); + printf("Global aead iv (%u) shorter than " + "aead_iv_sz (%u)\n", data_length, opts->aead_iv_sz); return -1; } @@ -411,6 +418,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->max_buffer_size > data_length) { - printf("Global ciphertext shorter than " - "buffer_sz\n"); + printf("Global ciphertext (%u) shorter than " + "buffer_sz (%u)\n", data_length, opts->max_buffer_size); return -1; } @@ -426,6 +433,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->aead_aad_sz > data_length) { - printf("Global aad shorter than " - "aead_aad_sz\n"); + printf("Global aad (%u) shorter than " + "aead_aad_sz (%u)\n", data_length, opts->aead_aad_sz); return -1; } @@ -442,6 +449,6 @@ parse_entry(char *entry, struct cperf_test_vector *vector, else { if (opts->digest_sz > data_length) { - printf("Global digest shorter than " - "digest_sz\n"); + printf("Global digest (%u) shorter than " + "digest_sz (%u)\n", data_length, opts->digest_sz); return -1; } -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-31 13:53:55.925111728 +0000 +++ 0123-app-crypto-perf-fix-plaintext-size-exceeds-buffer-si.patch 2025-10-31 13:53:52.313524233 +0000 @@ -1 +1 @@ -From b2988038656b03d1c019114fbe7609018cc16e87 Mon Sep 17 00:00:00 2001 +From 76f76023a939629285d357bbe3b786138b6ae4b5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b2988038656b03d1c019114fbe7609018cc16e87 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org