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 F330FA0524 for ; Fri, 5 Feb 2021 12:22:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF15F4067B; Fri, 5 Feb 2021 12:22:54 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id B49054067B for ; Fri, 5 Feb 2021 12:22:53 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id j11so5715769wmi.3 for ; Fri, 05 Feb 2021 03:22:53 -0800 (PST) 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=3R5t2SQrl7Z2qwbo+CQoqelKgQK8LGcu4oeyoPNnYRE=; b=Yw2QW+ZRZg+KKNGWrsV7TXJLmOWqrqMwyTP85nCYGo9ULOBhg0rzFsCzIuus4Q4bw0 9UaxEHpXR8OQiekHDXQMkzXTmJsBxWHxxs+lmue+mvnUjQZ12rC5hJc3ixaTvAvRhdJm smn1Ww3uzFYY367rLjub07nfajkNa67/xZ+vdTS7Ixu9S4Zbv7AkQTcUSatokirbG/ew NCOevej3wMX/Hs6v72aTjBcwkNwFCVVlDo2GP/dvHNJYizeurfTrUAvBmA5iu1bwtlNw USuyOrQH5ht51pxSGbdi3s6V0yjrFdK6QLGpMjqDJLZkLKmNBeOF8mWcLcMA1RyNEa8l 1/6Q== 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=3R5t2SQrl7Z2qwbo+CQoqelKgQK8LGcu4oeyoPNnYRE=; b=NBDf3dlQ0xt0Tt0L9UA/BBIR7fCaudpCdEUJ824VEAAa0uF3uKCM+dL3fINyktQVmr Kh+ylABqGxlKgb5y1W4HW424RBoyzG4YmaM3kIpheRTDPIviY4VaFL1pnZ8bdPKOUjlc WHEeKo9CAK165JNl4ZRJ7EKzJbnAu2QSGvhjGnIYe7N7HOnPhg6gk6BP1UAAJR4fPJ8C ER5FwRse9XQdo29EIX5Ghl05Ix99kGNfnHZhyjiDsRtsxRpbvm38s+pKzvIM4kT3YRQh rDBMHidbIAeLJVMkofp+xjg+d/4ILTQzH65STuGfxM5BQpTKOKNENIyI4z/OhddqCrbL 8wqw== X-Gm-Message-State: AOAM532bvD1OB7/Mk0j2MYQt3JEn7SDQIKyJBupLP+3UQ/R3JS4cASdP uCQhYoKsfLQl4TBsE4TVj2S4whO9nKym/p9p X-Google-Smtp-Source: ABdhPJxNlCma+9yaBzdFrBFIQikZ9homfJpqavofVUM7cBG5bK4Y0dMSGttz7Z3FQPG+7AbMi31VKQ== X-Received: by 2002:a1c:4c07:: with SMTP id z7mr3073150wmf.129.1612524173540; Fri, 05 Feb 2021 03:22:53 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id j125sm529908wmb.44.2021.02.05.03.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 03:22:52 -0800 (PST) From: luca.boccassi@gmail.com To: Qi Zhang Cc: =?UTF-8?q?Jacek=20Bu=C5=82atek?= , Haiyue Wang , Qiming Yang , dpdk stable Date: Fri, 5 Feb 2021 11:15:51 +0000 Message-Id: <20210205111920.1272063-65-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210205111920.1272063-1-luca.boccassi@gmail.com> References: <20210205111920.1272063-1-luca.boccassi@gmail.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 20.11.1 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 20.11.1 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/07/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/c22554616fe96ef617c6ad35ec70a521263ab5fd Thanks. Luca Boccassi --- >From c22554616fe96ef617c6ad35ec70a521263ab5fd 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 dc55d7e3ce..247c3acb67 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -3683,6 +3683,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 */ @@ -5016,6 +5019,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)))); } @@ -5090,14 +5094,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.29.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-02-05 11:18:32.190872373 +0000 +++ 0065-net-ice-base-fix-null-pointer-dereference.patch 2021-02-05 11:18:28.826691493 +0000 @@ -1 +1 @@ -From 09f918e8bc5131eb07d88e39c1e035716acf7d82 Mon Sep 17 00:00:00 2001 +From c22554616fe96ef617c6ad35ec70a521263ab5fd 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 dc55d7e3ce..247c3acb67 100644 @@ -32 +33 @@ -@@ -4090,6 +4090,9 @@ ice_add_update_vsi_list(struct ice_hw *hw, +@@ -3683,6 +3683,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) +@@ -5016,6 +5019,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, +@@ -5090,14 +5094,12 @@ ice_add_to_vsi_fltr_list(struct ice_hw *hw, u16 vsi_handle,