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 25C2CA0679 for ; Wed, 3 Apr 2019 19:32:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D38871B556; Wed, 3 Apr 2019 19:32:29 +0200 (CEST) Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by dpdk.org (Postfix) with ESMTP id 101061B54E for ; Wed, 3 Apr 2019 19:32:28 +0200 (CEST) Received: by mail-vs1-f68.google.com with SMTP id g187so10471823vsc.8 for ; Wed, 03 Apr 2019 10:32:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4AkMWFsKr1VFb12HPwDfRm5eu5xQ+SCRsWtMvuG4WVs=; b=XkZqO6KHrsaNZw5XZkINYW8li4O/PwjJTGCbymJr7D4W2mKz3nBTZaWRo5SOwZa9Bv xzLJjTccRQjgtw0eNG2GTuQsFgSSBZ6r46xAAiWFi5TO7tcTmAQp0ejk0RCupUQQfeW7 dQlamy/q9oxpei9PS7UtoOY0pYONQgehWlsVxceqZmIriFYrRx9KO+DD/Yw7rUOqetw5 Nn9WrxRXeICGMt2nyYWLf/RDmtSrftSCPj+1B9C2ZIvwEGcCLqxf67ewMvEAxKrnVVn+ ylQFlXdLsDcHTCLp+d22rxX4leGDGClNQ2Fd/FuSFJ6g9TjvXNW9WJUTOOLK5w8fMQAg iWVQ== X-Gm-Message-State: APjAAAUAmV336KGuXb/RdYgCl2lUHdmzpeeRV9KfaKMoicWbD4OtYIES 4e5G4HtsyYrSoFfvLEWoAQwnoUwOWvJ6vshepjT94g== X-Google-Smtp-Source: APXvYqxxuvSjkc7q3R7KzFOrHc8st7VL3+Xq47PTHgCyodfuUW4zIFT1a4NrIvNcoI8O5Z7DfAOR52+KjmV84GCC4Ko= X-Received: by 2002:a67:f588:: with SMTP id i8mr1089075vso.91.1554312747497; Wed, 03 Apr 2019 10:32:27 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <938cd677-9563-b29e-a4ab-3c2d84c519d8@intel.com> From: David Marchand Date: Wed, 3 Apr 2019 19:32:16 +0200 Message-ID: To: Ferruh Yigit Cc: Bruce Richardson , Thomas Monjalon , Mohammad Abdul Awal , dev , Andrew Rybchenko , dpdk stable Content-Type: text/plain; charset="UTF-8" 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: <20190403173216.Sr7O-P6dJSv56kyetZeAqw4LZggmatDsF1RAIlNdxsc@z> 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