From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mohammad Abdul Awal Subject: Re: [PATCH 1/3] ethdev: fix null pointer checking Date: Thu, 4 Apr 2019 09:33:05 +0100 Message-ID: <508b15c7-5ecd-4758-f985-81195620d608@intel.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Bruce Richardson , Thomas Monjalon , dev , Andrew Rybchenko , dpdk stable To: David Marchand , Ferruh Yigit Return-path: In-Reply-To: Content-Language: en-US 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/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.