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 45628A056D; Tue, 3 Mar 2020 08:19:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DE4F62C16; Tue, 3 Mar 2020 08:19:01 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 797402C02; Tue, 3 Mar 2020 08:19:00 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2020 23:18:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,510,1574150400"; d="scan'208";a="412643923" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by orsmga005.jf.intel.com with ESMTP; 02 Mar 2020 23:18:56 -0800 Date: Tue, 3 Mar 2020 15:16:45 +0800 From: Ye Xiaolong To: taox.zhu@intel.com Cc: qiming.yang@intel.com, wenzhuo.lu@intel.com, dev@dpdk.org, simei.su@intel.com, yahui.cao@intel.com, stable@dpdk.org Message-ID: <20200303071645.GH25927@intel.com> References: <20200303015557.63621-1-taox.zhu@intel.com> <20200303053846.10610-1-taox.zhu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200303053846.10610-1-taox.zhu@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v3] net/ice: fix hash flow segmentation fault X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/03, taox.zhu@intel.com wrote: >From: Zhu Tao > >Macro rte_errno is not a static value, so it needs to be updated in all >error handling code. > >Patch 'dc36bd5dfdeb' mistakenly consider that rte_errno is a constant, >which causes the unrecognized flow rule to be marked as recognition >success. Later, when the code tried to parse the flow rule, a null pointer >caused a segmentation fault. > >Fixes: dc36bd5dfdeb ("net/ice: fix flow FDIR/switch memory leak") >Cc: stable@dpdk.org > >Signed-off-by: Zhu Tao >--- >v3 Changes: > > Commit message: Use 12 chars length of commit SHA in Fixes line. > Code: Delete redundant assignment codes. > >v2 Changes: > > Commit message: Use 12 chars length of commit SHA in Fixes line. > > 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 d891538bd..0e9c3c4e5 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.17.1 > Reviewed-by: Xiaolong Ye Applied to dpdk-next-net-intel, Thanks.