[dpdk-stable] patch 'app/testpmd: fix RSS key length' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:31:38 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.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/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/cce7ff86137d29f54991b8627a69890f59f5a1e0

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From cce7ff86137d29f54991b8627a69890f59f5a1e0 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Wed, 27 Oct 2021 16:22:10 +0200
Subject: [PATCH] app/testpmd: fix RSS key length
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 <maxime.coquelin at redhat.com>
Acked-by: Xiaoyun Li <xiaoyun.li at intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 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 11369ca2c2..d4ec4cec80 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2988,7 +2988,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))
@@ -2997,6 +2997,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.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:11.357297365 +0800
+++ 0214-app-testpmd-fix-RSS-key-length.patch	2021-11-10 14:17:02.027411476 +0800
@@ -1 +1 @@
-From 8e1d0547d6ed6a28c5c80c832f7b259518b89735 Mon Sep 17 00:00:00 2001
+From cce7ff86137d29f54991b8627a69890f59f5a1e0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8e1d0547d6ed6a28c5c80c832f7b259518b89735 ]
@@ -22 +24,0 @@
-Cc: stable at dpdk.org
@@ -32 +34 @@
-index 3b97164302..dde6cdcff1 100644
+index 11369ca2c2..d4ec4cec80 100644
@@ -35 +37 @@
-@@ -3042,7 +3042,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
+@@ -2988,7 +2988,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
@@ -44 +46 @@
-@@ -3051,6 +3051,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,
+@@ -2997,6 +2997,7 @@ port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *hash_key,


More information about the stable mailing list