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 F20CAA0C41 for ; Tue, 30 Nov 2021 17:41:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E79B2410F7; Tue, 30 Nov 2021 17:41:57 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 77AA7410F7 for ; Tue, 30 Nov 2021 17:41:56 +0100 (CET) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (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 smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 4D5F53F1B2 for ; Tue, 30 Nov 2021 16:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290516; bh=lrVmz4VfxJP9ce62st+qXM3+vLbAWspaeW6eHgKGg/4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=n9fgc1+6vI85sHnzqddfmUngN4ria601dl26YlUKJon3RDXtw8ymjUiMJzdu1aKvS TAGXiBxdSjTbbJBA8QcEki88dg8toy976VGBy16835RyHr5R61d8WlIGzc+KiaC9Kh R7sREgYZjyfi8QZuqIFzjZZQRn8Z6720Xaj2RfJ0E/rcxAcYbwRsqcLWJaIKLimFk0 M5vbc0QTI6jCvrUuEhj1Ts14G5urzcB9mRw7p75GUgLeCODavhd/bilqxrPT8sd19a zfTN8Ko044sFtK5R7AqXzh+Woq9p0U8waXvehtT6OUyyrDUsAbzeKaugIx3krXRQoD o9zoZi4GMuUWA== Received: by mail-ed1-f71.google.com with SMTP id eg20-20020a056402289400b003eb56fcf6easo17389208edb.20 for ; Tue, 30 Nov 2021 08:41:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lrVmz4VfxJP9ce62st+qXM3+vLbAWspaeW6eHgKGg/4=; b=IcVYPJZT3r1UQS9d/36HVB4F1u9ZyJOYX1VtP/ViEsi6zNxiswptjrLSoIEsmJSM4X ufsbe9oFBVHu2szCrAPSGP5/L10BVA0HlKzGbllkcHF9NVt6ebAH9+IVr222AC7HLhVL BQvBuuaxTQpt9PhrUMmbg0tRRi2gLK72wiFrrIn9/jeGyqcYg1DOUPRS+DjFXgdNYwWe flAHKvz9Q5vztnnzsh28kObqbgD+vdXTYkkyydwwgQFYsMGCq5e3X1xyPrrxiO+J0d8Y T7oids2FAuwc0t6EFzgc4sMT4x2sWx0gQz9VLPzOpSLdDmT0ykCeYS/avBl0HXzBbJdD qwMA== X-Gm-Message-State: AOAM532gos9ThRGhBJt/ajDje1MB1tqnOrGBCug/rNyZsCfXAik/1lsv qce/qFlrmqk7byl9GHMjnYsmnS/hfTMQchU7YlcMbZa1Ycg9OUaAVu7JWgVBVTyQuES+XZfCZmz SNlW3O7URORORfaL+m7zs+vTT X-Received: by 2002:a17:907:60d0:: with SMTP id hv16mr174137ejc.425.1638290515763; Tue, 30 Nov 2021 08:41:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/3NJUpPZbHjgpS2jz6KzhREccpZ02X9bZxp3TOiyFrqFY1Fef4NK5k8rz418EI3wgQK51Tw== X-Received: by 2002:a17:907:60d0:: with SMTP id hv16mr174120ejc.425.1638290515547; Tue, 30 Nov 2021 08:41:55 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id ds17sm9708918ejc.45.2021.11.30.08.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:41:55 -0800 (PST) From: christian.ehrhardt@canonical.com To: Maxime Coquelin Cc: Xiaoyun Li , Chenbo Xia , dpdk stable Subject: patch 'app/testpmd: fix RSS key length' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:35:15 +0100 Message-Id: <20211130163605.2460997-111-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.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 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/54e71837915480bef69fa2ab16241f40f2ce90f0 Thanks. Christian Ehrhardt --- >From 54e71837915480bef69fa2ab16241f40f2ce90f0 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Wed, 27 Oct 2021 16:22:10 +0200 Subject: [PATCH] app/testpmd: fix RSS key length [ upstream commit 8e1d0547d6ed6a28c5c80c832f7b259518b89735 ] port_rss_hash_key_update() initializes rss_conf with the RSS key configuration provided by the user, but it calls rte_eth_dev_rss_hash_conf_get() before calling rte_eth_dev_rss_hash_update(), which overrides the parsed RSS config. While the RSS key value is set again after, this is not the case of the key length. It could cause out of bounds access if the key length parsed is smaller than the one read from rte_eth_dev_rss_hash_conf_get(). This patch restores the key length before the rte_eth_dev_rss_hash_update() call to ensure the RSS key value/length pair is consistent. Fixes: 8205e241b2b0 ("app/testpmd: add missing type to RSS hash commands") Signed-off-by: Maxime Coquelin Acked-by: Xiaoyun Li Reviewed-by: Chenbo Xia --- app/test-pmd/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index bee9fa6dcf..a693960785 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2145,7 +2145,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key, unsigned int i; rss_conf.rss_key = NULL; - rss_conf.rss_key_len = hash_key_len; + rss_conf.rss_key_len = 0; rss_conf.rss_hf = 0; for (i = 0; rss_type_table[i].str; i++) { if (!strcmp(rss_type_table[i].str, rss_type)) @@ -2154,6 +2154,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key, diag = rte_eth_dev_rss_hash_conf_get(port_id, &rss_conf); if (diag == 0) { rss_conf.rss_key = hash_key; + rss_conf.rss_key_len = hash_key_len; diag = rte_eth_dev_rss_hash_update(port_id, &rss_conf); } if (diag == 0) -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:12.265332822 +0100 +++ 0111-app-testpmd-fix-RSS-key-length.patch 2021-11-30 16:50:05.918874469 +0100 @@ -1 +1 @@ -From 8e1d0547d6ed6a28c5c80c832f7b259518b89735 Mon Sep 17 00:00:00 2001 +From 54e71837915480bef69fa2ab16241f40f2ce90f0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8e1d0547d6ed6a28c5c80c832f7b259518b89735 ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -32 +33 @@ -index 3b97164302..dde6cdcff1 100644 +index bee9fa6dcf..a693960785 100644 @@ -35 +36 @@ -@@ -3042,7 +3042,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key, +@@ -2145,7 +2145,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key, @@ -44 +45 @@ -@@ -3051,6 +3051,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key, +@@ -2154,6 +2154,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,