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 52E3BA0524 for ; Thu, 4 Feb 2021 12:31:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C6AE240737; Thu, 4 Feb 2021 12:31:32 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id DA48E24072D for ; Thu, 4 Feb 2021 12:31:29 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l7crB-0005AJ-LQ; Thu, 04 Feb 2021 11:31:29 +0000 From: Christian Ehrhardt To: Qi Zhang Cc: =?UTF-8?q?Jacek=20Bu=C5=82atek?= , Haiyue Wang , Qiming Yang , dpdk stable Date: Thu, 4 Feb 2021 12:28:07 +0100 Message-Id: <20210204112954.2488123-32-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice/base: fix null pointer dereference' has been queued to stable release 19.11.7 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/06/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/a11bbc4aff5df42a3baf7d899f51afac4551507a Thanks. Christian Ehrhardt --- >From a11bbc4aff5df42a3baf7d899f51afac4551507a Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Tue, 15 Dec 2020 12:42:46 +0800 Subject: [PATCH] net/ice/base: fix null pointer dereference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 09f918e8bc5131eb07d88e39c1e035716acf7d82 ] Added handling of allocation fault for ice_vsi_list_map_info Should also check dereference of NULL pointer to filters VSI list information for FWD_TO_VSI_LISt type only, otherwise, the FWD_TO_VSI type filters by the given VSI can't be located. Also the point *pi should not be NULL pointer, it is a reference to raw data field, so remove this variable, use the reference directly. Fixes: c7dd15931183 ("net/ice/base: add virtual switch code") Signed-off-by: Jacek BuĊ‚atek Signed-off-by: Haiyue Wang Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_switch.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 940e4ce405..71c6d9821c 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -2507,6 +2507,9 @@ ice_add_update_vsi_list(struct ice_hw *hw, ice_create_vsi_list_map(hw, &vsi_handle_arr[0], 2, vsi_list_id); + if (!m_entry->vsi_list_info) + return ICE_ERR_NO_MEMORY; + /* If this entry was large action then the large action needs * to be updated to point to FWD to VSI list */ @@ -3721,6 +3724,7 @@ ice_vsi_uses_fltr(struct ice_fltr_mgmt_list_entry *fm_entry, u16 vsi_handle) return ((fm_entry->fltr_info.fltr_act == ICE_FWD_TO_VSI && fm_entry->fltr_info.vsi_handle == vsi_handle) || (fm_entry->fltr_info.fltr_act == ICE_FWD_TO_VSI_LIST && + fm_entry->vsi_list_info && (ice_is_bit_set(fm_entry->vsi_list_info->vsi_map, vsi_handle)))); } @@ -3795,14 +3799,12 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle, LIST_FOR_EACH_ENTRY(fm_entry, lkup_list_head, ice_fltr_mgmt_list_entry, list_entry) { - struct ice_fltr_info *fi; - - fi = &fm_entry->fltr_info; - if (!fi || !ice_vsi_uses_fltr(fm_entry, vsi_handle)) + if (!ice_vsi_uses_fltr(fm_entry, vsi_handle)) continue; status = ice_add_entry_to_vsi_fltr_list(hw, vsi_handle, - vsi_list_head, fi); + vsi_list_head, + &fm_entry->fltr_info); if (status) return status; } -- 2.30.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-04 12:04:29.470664906 +0100 +++ 0032-net-ice-base-fix-null-pointer-dereference.patch 2021-02-04 12:04:27.926789628 +0100 @@ -1 +1 @@ -From 09f918e8bc5131eb07d88e39c1e035716acf7d82 Mon Sep 17 00:00:00 2001 +From a11bbc4aff5df42a3baf7d899f51afac4551507a Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 09f918e8bc5131eb07d88e39c1e035716acf7d82 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index 45c44ca256..fd2c1ccceb 100644 +index 940e4ce405..71c6d9821c 100644 @@ -32 +33 @@ -@@ -4090,6 +4090,9 @@ ice_add_update_vsi_list(struct ice_hw *hw, +@@ -2507,6 +2507,9 @@ ice_add_update_vsi_list(struct ice_hw *hw, @@ -42 +43 @@ -@@ -5423,6 +5426,7 @@ ice_vsi_uses_fltr(struct ice_fltr_mgmt_list_entry *fm_entry, u16 vsi_handle) +@@ -3721,6 +3724,7 @@ ice_vsi_uses_fltr(struct ice_fltr_mgmt_list_entry *fm_entry, u16 vsi_handle) @@ -50 +51 @@ -@@ -5497,14 +5501,12 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle, +@@ -3795,14 +3799,12 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle,