[dpdk-stable] patch 'net/ice: fix hash flow crash' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 14:53:32 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. 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.

Thanks.

Luca Boccassi

---
>From aec781c6b1cb149b54ba4ca62420d0dbe1d9c68c Mon Sep 17 00:00:00 2001
From: Tao Zhu <taox.zhu at intel.com>
Date: Tue, 3 Mar 2020 13:38:46 +0800
Subject: [PATCH] net/ice: fix hash flow crash

[ upstream commit f761def5125cf7dc23a15eb2bf57206f5930801e ]

Commit 'dc36bd5dfdeb' mistakenly initializes ret as -rte_errno, then
return ret if ice_search_pattern_match_item fails, if rte_errno happens
to be 0 in this case, it would cause an unrecognized flow rule to be
marked as recognition success. Later, when the code tries to parse the
flow rule, a segmentation fault will occur due to null pointer
reference.

Fixes: dc36bd5dfdeb ("net/ice: fix flow FDIR/switch memory leak")

Signed-off-by: Tao Zhu <taox.zhu at intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye at intel.com>
---
 drivers/net/ice/ice_hash.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c
index d891538bd4..0e9c3c4e50 100644
--- a/drivers/net/ice/ice_hash.c
+++ b/drivers/net/ice/ice_hash.c
@@ -409,7 +409,7 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,
 			void **meta,
 			struct rte_flow_error *error)
 {
-	int ret = -rte_errno;
+	int ret = 0;
 	struct ice_pattern_match_item *pattern_match_item;
 	struct rss_meta *rss_meta_ptr;
 
@@ -424,8 +424,10 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,
 	/* Check rss supported pattern and find matched pattern. */
 	pattern_match_item = ice_search_pattern_match_item(pattern,
 					array, array_len, error);
-	if (!pattern_match_item)
+	if (!pattern_match_item) {
+		ret = -rte_errno;
 		goto error;
+	}
 
 	ret = ice_hash_check_inset(pattern, error);
 	if (ret)
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 13:56:19.717537222 +0100
+++ 0022-net-ice-fix-hash-flow-crash.patch	2020-05-19 13:56:18.203501531 +0100
@@ -1,8 +1,10 @@
-From f761def5125cf7dc23a15eb2bf57206f5930801e Mon Sep 17 00:00:00 2001
+From aec781c6b1cb149b54ba4ca62420d0dbe1d9c68c Mon Sep 17 00:00:00 2001
 From: Tao Zhu <taox.zhu at intel.com>
 Date: Tue, 3 Mar 2020 13:38:46 +0800
 Subject: [PATCH] net/ice: fix hash flow crash
 
+[ upstream commit f761def5125cf7dc23a15eb2bf57206f5930801e ]
+
 Commit 'dc36bd5dfdeb' mistakenly initializes ret as -rte_errno, then
 return ret if ice_search_pattern_match_item fails, if rte_errno happens
 to be 0 in this case, it would cause an unrecognized flow rule to be
@@ -11,7 +13,6 @@
 reference.
 
 Fixes: dc36bd5dfdeb ("net/ice: fix flow FDIR/switch memory leak")
-Cc: stable at dpdk.org
 
 Signed-off-by: Tao Zhu <taox.zhu at intel.com>
 Reviewed-by: Xiaolong Ye <xiaolong.ye at intel.com>


More information about the stable mailing list