[dpdk-stable] patch 'net/ice/base: fix uninitialized stack variables' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:02:30 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 d1cd22be97f279095c80e26ad059c806d79b7b1e Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang at intel.com>
Date: Mon, 23 Mar 2020 15:17:24 +0800
Subject: [PATCH] net/ice/base: fix uninitialized stack variables

[ upstream commit cdfa0dc1702bcfe6c403d3cfe4046b29c8e6c5b9 ]

Via code inspection, I found that some partially initialized
stack variables were being passed along to called functions,
which could eventually result in those uninitialized members
being used.  To fix this, make sure the local variables are
zeroed out before partially initializing them.  This should
prevent any unintended consequences from using stack memory that
might have junk in it.

In addition to the memsets, this patch also initializes one
member in one function, that needed to be initialized to non-zero.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")

Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr at intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
Acked-by: Qiming Yang <qiming.yang at intel.com>
---
 drivers/net/ice/base/ice_switch.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 621fcfb370..7fe71b20b9 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -5995,9 +5995,12 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
 		if (status)
 			return status;
 
+		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
 		tmp_fltr.fltr_rule_id = cur_fltr->fltr_rule_id;
 		tmp_fltr.fltr_act = ICE_FWD_TO_VSI_LIST;
 		tmp_fltr.fwd_id.vsi_list_id = vsi_list_id;
+		tmp_fltr.lkup_type = ICE_SW_LKUP_LAST;
+
 		/* Update the previous switch rule of "forward to VSI" to
 		 * "fwd to VSI list"
 		 */
@@ -6241,6 +6244,7 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 	if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI) {
 		struct ice_fltr_info tmp_fltr;
 
+		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
 		tmp_fltr.fltr_rule_id =
 			LE16_TO_CPU(s_rule->pdata.lkup_tx_rx.index);
 		tmp_fltr.fltr_act = ICE_FWD_TO_VSI;
@@ -6325,6 +6329,8 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
 						  lkup_type);
 		if (status)
 			return status;
+
+		ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
 		tmp_fltr.fltr_rule_id = fm_list->rule_info.fltr_rule_id;
 		fm_list->rule_info.sw_act.fltr_act = ICE_FWD_TO_VSI;
 		tmp_fltr.fltr_act = ICE_FWD_TO_VSI;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:45.189513794 +0100
+++ 0015-net-ice-base-fix-uninitialized-stack-variables.patch	2020-05-19 14:04:44.084645980 +0100
@@ -1,8 +1,10 @@
-From cdfa0dc1702bcfe6c403d3cfe4046b29c8e6c5b9 Mon Sep 17 00:00:00 2001
+From d1cd22be97f279095c80e26ad059c806d79b7b1e Mon Sep 17 00:00:00 2001
 From: Qi Zhang <qi.z.zhang at intel.com>
 Date: Mon, 23 Mar 2020 15:17:24 +0800
 Subject: [PATCH] net/ice/base: fix uninitialized stack variables
 
+[ upstream commit cdfa0dc1702bcfe6c403d3cfe4046b29c8e6c5b9 ]
+
 Via code inspection, I found that some partially initialized
 stack variables were being passed along to called functions,
 which could eventually result in those uninitialized members
@@ -15,7 +17,6 @@
 member in one function, that needed to be initialized to non-zero.
 
 Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
-Cc: stable at dpdk.org
 
 Signed-off-by: Jesse Brandeburg <jesse.brandeburg at intel.com>
 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr at intel.com>
@@ -26,10 +27,10 @@
  1 file changed, 6 insertions(+)
 
 diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
-index 085f344064..e88d0f7fe7 100644
+index 621fcfb370..7fe71b20b9 100644
 --- a/drivers/net/ice/base/ice_switch.c
 +++ b/drivers/net/ice/base/ice_switch.c
-@@ -6227,9 +6227,12 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
+@@ -5995,9 +5995,12 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
  		if (status)
  			return status;
  
@@ -42,7 +43,7 @@
  		/* Update the previous switch rule of "forward to VSI" to
  		 * "fwd to VSI list"
  		 */
-@@ -6473,6 +6476,7 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
+@@ -6241,6 +6244,7 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
  	if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI) {
  		struct ice_fltr_info tmp_fltr;
  
@@ -50,7 +51,7 @@
  		tmp_fltr.fltr_rule_id =
  			LE16_TO_CPU(s_rule->pdata.lkup_tx_rx.index);
  		tmp_fltr.fltr_act = ICE_FWD_TO_VSI;
-@@ -6557,6 +6561,8 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
+@@ -6325,6 +6329,8 @@ ice_adv_rem_update_vsi_list(struct ice_hw *hw, u16 vsi_handle,
  						  lkup_type);
  		if (status)
  			return status;


More information about the stable mailing list