From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 64EF65B12; Thu, 4 Apr 2019 10:33:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) 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; 04 Apr 2019 01:33:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,306,1549958400"; d="scan'208,217";a="313054476" Received: from awalabdu-mobl.ger.corp.intel.com (HELO [163.33.176.61]) ([163.33.176.61]) by orsmga005.jf.intel.com with ESMTP; 04 Apr 2019 01:33:06 -0700 To: David Marchand , Ferruh Yigit Cc: Bruce Richardson , Thomas Monjalon , dev , Andrew Rybchenko , dpdk stable References: <20190403160726.1231-1-mohammad.abdul.awal@intel.com> <1807422.QXMQecOh3y@xps> <20190403164116.GA1344@bricha3-MOBL.ger.corp.intel.com> <938cd677-9563-b29e-a4ab-3c2d84c519d8@intel.com> From: Mohammad Abdul Awal Message-ID: <508b15c7-5ecd-4758-f985-81195620d608@intel.com> Date: Thu, 4 Apr 2019 09:33:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: fix null pointer checking 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: , X-List-Received-Date: Thu, 04 Apr 2019 08:33:10 -0000 On 03/04/2019 18:32, David Marchand wrote: > On Wed, Apr 3, 2019 at 6:53 PM Ferruh Yigit > wrote: > > On 4/3/2019 5:41 PM, Bruce Richardson wrote: > > On Wed, Apr 03, 2019 at 05:35:22PM +0100, Ferruh Yigit wrote: > >> On 4/3/2019 5:27 PM, Thomas Monjalon wrote: > >>> 03/04/2019 18:07, Mohammad Abdul Awal: > >>>> Null value for parameter name will cause segfault for the > strnlen and > >>>> strcmp functions. > >>> > >>> I'm not sure we want such obvious checks for all APIs.  Here I > would > >>> say yes. > >> > >> These are internal functions, not APIs.  I am for verifying > input for > >> (all) APIs but not for internal functions, drivers should call > them and > >> they are in our control, if they are passing NULL we can fix > them :) > >> > > True, but if these are control path or init time code paths > rather than > > data path APIs, I don't see the harm in putting in the checks. > > No harm from performance point of view, agree, but also looks > unnecessary to me. > > > +1 > All the more when you see the following patches that adds input checks > in the faulty/too naive drivers. > > > -- > David Marchand Self-NACK to the patch considering the discussion above. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EE96AA0679 for ; Thu, 4 Apr 2019 10:33:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6240D5B2E; Thu, 4 Apr 2019 10:33:11 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 64EF65B12; Thu, 4 Apr 2019 10:33:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) 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; 04 Apr 2019 01:33:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,306,1549958400"; d="scan'208,217";a="313054476" Received: from awalabdu-mobl.ger.corp.intel.com (HELO [163.33.176.61]) ([163.33.176.61]) by orsmga005.jf.intel.com with ESMTP; 04 Apr 2019 01:33:06 -0700 To: David Marchand , Ferruh Yigit Cc: Bruce Richardson , Thomas Monjalon , dev , Andrew Rybchenko , dpdk stable References: <20190403160726.1231-1-mohammad.abdul.awal@intel.com> <1807422.QXMQecOh3y@xps> <20190403164116.GA1344@bricha3-MOBL.ger.corp.intel.com> <938cd677-9563-b29e-a4ab-3c2d84c519d8@intel.com> From: Mohammad Abdul Awal Message-ID: <508b15c7-5ecd-4758-f985-81195620d608@intel.com> Date: Thu, 4 Apr 2019 09:33:05 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: fix null pointer checking 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" Message-ID: <20190404083305.YDBNNMPS88IH7d5Virsu1aiB2hFp49APVUj8Wko5C2M@z> On 03/04/2019 18:32, David Marchand wrote: > On Wed, Apr 3, 2019 at 6:53 PM Ferruh Yigit > wrote: > > On 4/3/2019 5:41 PM, Bruce Richardson wrote: > > On Wed, Apr 03, 2019 at 05:35:22PM +0100, Ferruh Yigit wrote: > >> On 4/3/2019 5:27 PM, Thomas Monjalon wrote: > >>> 03/04/2019 18:07, Mohammad Abdul Awal: > >>>> Null value for parameter name will cause segfault for the > strnlen and > >>>> strcmp functions. > >>> > >>> I'm not sure we want such obvious checks for all APIs.  Here I > would > >>> say yes. > >> > >> These are internal functions, not APIs.  I am for verifying > input for > >> (all) APIs but not for internal functions, drivers should call > them and > >> they are in our control, if they are passing NULL we can fix > them :) > >> > > True, but if these are control path or init time code paths > rather than > > data path APIs, I don't see the harm in putting in the checks. > > No harm from performance point of view, agree, but also looks > unnecessary to me. > > > +1 > All the more when you see the following patches that adds input checks > in the faulty/too naive drivers. > > > -- > David Marchand Self-NACK to the patch considering the discussion above.