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 942D646364 for ; Fri, 7 Mar 2025 13:25:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8CD0140E45; Fri, 7 Mar 2025 13:25:46 +0100 (CET) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mails.dpdk.org (Postfix) with ESMTP id 703F240E34 for ; Fri, 7 Mar 2025 13:25:45 +0100 (CET) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4394036c0efso10124665e9.2 for ; Fri, 07 Mar 2025 04:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741350345; x=1741955145; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fE9MNdYDRNwpr7hOfxtVZ1+EOpFlJwRLioLFZgIXB/o=; b=T1AwiAPCPU8IpAIEpMTsqOpnVKo70duxdtbsl5Fn5xwi+F17PesGiFK5I4iVa4wY9L YgfeG9pufX1oI9kOz1vagOuXSkHvGlxTIYFZfgkRZJzBgfr/0V+C+URgVfi4Mo03SCwB DfnVaIHaI1Hb0Df8Dr/TUiJ1bq7INkx+ZFpkS4YuSu6v4YK/gw5aa1lmrSnAwvBDuAqz Ocx3Nykr8ZsB1ggfmlmcWDZXckzmOzTviS4znu5BSAZmatNwtd3fDgUXmELwujVOWdFt 04cElu80pS/XRP82rEaj9VsfOAtEAbRfIU4E0byCt16uz2nfW5n9U6P5xnOepVc0HB7Z G2sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741350345; x=1741955145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fE9MNdYDRNwpr7hOfxtVZ1+EOpFlJwRLioLFZgIXB/o=; b=T/MQhDAEdc4rF3kNPUSoluFat0w6jGs2x4QtxPjBBu56aVr2+W+DEFjyto3c+YospF i0UPiefTpnc3lG2lvFoK7sWQl4rBi8fK7B6RRJ4wCW5V4Qep1Vf5HFjKEeFRZSo/2JL3 vruFcqr14IMQFeSVLqSrb+PD31ac0FSZr0QLJHTFNixiCf5hb2zB1ttFkdJM8C6gFkhI LWfZKbbgwxofNNXdTEsgv3eCXNLMZbIPFZ1JgXZSoN5Xeo2MsE8jauTLOcYjlULeyD03 Jmbrhz8afy6ebNub6M3BRLnkvQ8GvJ2PG/ymlAypExn3y8vBvXwMtwWeN1pedkJ03LCQ n67w== X-Gm-Message-State: AOJu0YwyXVi10meyJq8inAOgecjvTkN4cEj1o8t9+PWuUVjO3oE/gM/D XViA8XhwwVQjkjoEawXfzRUA+eT2lK0UqncxT9zvnAJMEzkQViA1 X-Gm-Gg: ASbGnctU5lqH1hZ5k5dlMcxo/j96d2zmCAiT551Q9y363q7bnsbB89febeFwNEErQJo QIQZZI7xSALAc0aXAhsIoUpBKn2YX/fJsUytyWzIr9BuYusqX+RC53pV4C0zOMy8XzXZnd6iWpF xtzw85mSR5vuTJS9GRQ8QUqoukN9zUcWr0UX/RK1MaOVcVnYrwnSIFPbC1mQCxBCeCsr6LXH4lV DBmA7UR9Gdhk6IbSwIFVHfRNMbQttiyEXpBWnWn4jMsuOJKbz05696nTlJcjvmpGWpxwOx0Hw9r Pwn0fXDUR9WSbfPdTWgsyk0xTDeW4s1FWyuYSbdm+ECM+TxoNZo= X-Google-Smtp-Source: AGHT+IHX6LV6sbbROvGEng2vDLycXr2czdHcweC3DDpHW5gDnQ9nYSLQL6yi8kAK+RH1wXTM2M/5TA== X-Received: by 2002:a05:600c:190f:b0:439:8346:505f with SMTP id 5b1f17b1804b1-43c5a631638mr18838735e9.20.1741350344855; Fri, 07 Mar 2025 04:25:44 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:ff31:f049:bd38:f7cf]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-43bcbd27996sm59015915e9.2.2025.03.07.04.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 04:25:44 -0800 (PST) From: luca.boccassi@gmail.com To: Arkadiusz Kusztal Cc: dpdk stable Subject: patch 'test/crypto: fix check for OOP header data' has been queued to stable release 22.11.8 Date: Fri, 7 Mar 2025 12:24:24 +0000 Message-ID: <20250307122431.1415551-25-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250307122431.1415551-1-luca.boccassi@gmail.com> References: <20250217170456.1068278-79-luca.boccassi@gmail.com> <20250307122431.1415551-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 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 --- 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@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(