From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 892DBA0093 for ; Tue, 19 May 2020 15:06:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 804A61D644; Tue, 19 May 2020 15:06:37 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 1FDA21D603 for ; Tue, 19 May 2020 15:06:36 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id h4so2977666wmb.4 for ; Tue, 19 May 2020 06:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=47ppXNeTmWeRVS3UmAdr/yrAMC+Wq37NfhFEbn0xYgQ=; b=npyYmgzzzZH7aPzwTwFKEE6QRXnBnE8x8rEwtcUOZelONrezanx4eFvUtG6uOgguoB NwEkXPlAutoq4+tL2g8zEGqqsrOdhpQ3R7LIoL5smv8N6jMAHL7pymlsy5b28CizxWbF 6qlkYLculfZvooPVZH5wFTcO2eEHmJKioddSPQLfLpC9myTFckDsWwXhWeUzliz1Z1SK o2yrpSNCi2q5bYpvUl+rPtaWwn47jxnhL18lEOS5FYgiUZIuSyEmibDQvkDnKb5sgl2J z47Dr29KiWv2PCTnURmWsX0t4KxIDdFotV5in1F85kkOCUET04IBDk+ZLU9M37DUhgFD 4Ftg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=47ppXNeTmWeRVS3UmAdr/yrAMC+Wq37NfhFEbn0xYgQ=; b=eciqnmu9Iry4yW/pJ1YbsZuXiVCu/hs3gJ1R0SACkG2srUkMYfLPgTrSgv5bGx6ELI yRP4eG7L/i/4ZGsSvaJt16FuDvIwj3ddXo8i+dC/b/xCPt/OPpA0QgvhrvyiVeR6gUir ilaTeI2OvNGBYcWRkQ//fCvaSxtYgNFsK7RZZhFoSmCr7qrGmcsCm7SD8Fz+CWO0tAQk nGxgDgj84A2qWUEI/bPOs9iapR4Lb2yerYD2Ya5tXEfSi5dZWcbFDR8VTnyyLjHLxzti Dx0vxS04sYITWScIqYYlvDvmyIYyMlmTBuyncqrarTUQiOGT/W6OWrj+EClM8RzxOR3B X8bw== X-Gm-Message-State: AOAM530Z0rX8CJ3x3ZFucWydOtdK7VKPpF/XEDxQla1m528EvvgE47vG 48ShRg17bZcBWLBfpReFEbw= X-Google-Smtp-Source: ABdhPJzxkxMp1KboqVKPWYWEFqe98siN9mG2s8GZnbCeknR0tCRvYuUuM2yPWde3L7OznGHJwTDSww== X-Received: by 2002:a7b:c394:: with SMTP id s20mr5718769wmj.40.1589893595862; Tue, 19 May 2020 06:06:35 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id b145sm4292270wme.41.2020.05.19.06.06.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:06:35 -0700 (PDT) From: luca.boccassi@gmail.com To: Qi Zhang Cc: Jesse Brandeburg , Paul M Stillwell Jr , Qiming Yang , dpdk stable Date: Tue, 19 May 2020 14:02:30 +0100 Message-Id: <20200519130549.112823-15-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice/base: fix uninitialized stack variables' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" 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 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 Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- 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 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@dpdk.org Signed-off-by: Jesse Brandeburg Signed-off-by: Paul M Stillwell Jr @@ -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;