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 E9055A0679 for ; Wed, 3 Apr 2019 20:50:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8E3171B56F; Wed, 3 Apr 2019 20:50:40 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 307631B563 for ; Wed, 3 Apr 2019 20:50:36 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id 188so24719pfd.8 for ; Wed, 03 Apr 2019 11:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aU3PsApVk31hTVf1jMdACWjudMTcKj7eONyAYkYoSk8=; b=Yp+oSb8der08KAg+RlFrzvM37FhyrfSIFA9v0U/IbzKOQW35tjEUUY+txUa9FQ91Ig DMeaVj0Gt2o8dvOCcwCOjvB0GPepjTTZmsI3e+ccduKS7alXWBSdUT3akFh3v9hW65Ul 2ghPD/JIVFDtfOGlSRamaPPqkUEwzIcDkG9ghBMFrBcB4Mm26B+SlPoi+//U3QYlP7is rSB7ISBAC8+qpX/QRomqPguV+d6527u75AfRMcXeNXEBcqv7s7wXwOy2dd7EUGwi+VPT +bfhBoXfqPS2lmF5Q02E/3a+qxO77w6PDUxddc/pqN8GLtwJbWK37nkh3TUphecEddjR s0cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aU3PsApVk31hTVf1jMdACWjudMTcKj7eONyAYkYoSk8=; b=NJvUBXlRgMv8JkG1rH0i4uBPxtgFr3tnEXkC33usqrg+fSOoll165b672d6XeBbA9J XGCgm2uhn4F3UVt82dAEFkvfsBs0DfPmzXnYg0FL0Tic7qEsSWkZJvyTPv7iMtzlECZz WZyOf+6XGuhINUdshJMd7DI+AFcTtAp5xWdAi+Quttmr0G039yM+gaQjvrO6MT0O8tvK gi4yOSkTzKKmrs24smQCBvb8Bk6wEvJp7NaYbNK4vQrn0+1adF9WgJx1IMf6F13z5lZ/ rHIRQVK0PiWJbYLt/GaqCEnt+rX6D74mg4cc6oDynGtc2OVV2xXRuylK3QIG/krX9b7P UMWQ== X-Gm-Message-State: APjAAAXbpMyEpn5fAY3bhWytXpFPG7rctIBFZVEAP+GqvFSyiQs3fVCC y/yox3n7aKFWOyVsW+9qCguXuw== X-Google-Smtp-Source: APXvYqzJC9kYokP8cn/Ouvoh39TBvtl0jXPW0iqTCbfDBn0VTYbUkesS9O43PAKWSzmIhr1EGq469g== X-Received: by 2002:a63:ef07:: with SMTP id u7mr1364007pgh.0.1554317435151; Wed, 03 Apr 2019 11:50:35 -0700 (PDT) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id e8sm40028740pfc.47.2019.04.03.11.50.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 11:50:35 -0700 (PDT) Date: Wed, 3 Apr 2019 11:50:32 -0700 From: Stephen Hemminger To: Mohammad Abdul Awal Cc: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, stable@dpdk.org Message-ID: <20190403115032.492e1c57@shemminger-XPS-13-9360> In-Reply-To: <20190403160726.1231-1-mohammad.abdul.awal@intel.com> References: <20190403160726.1231-1-mohammad.abdul.awal@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 1/3] ethdev: fix null pointer checking X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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" On Wed, 3 Apr 2019 17:07:26 +0100 Mohammad Abdul Awal wrote: > Null value for parameter name will cause segfault for the > strnlen and strcmp functions. > > Fixes: 0b33b68d12 ("ethdev: export allocate function") > Fixes: 942661004c ("ethdev: export secondary attach function") > Cc: stable@dpdk.org > > Signed-off-by: Mohammad Abdul Awal > --- > lib/librte_ethdev/rte_ethdev.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index 10bdfb37e..26898ed08 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -440,6 +440,11 @@ rte_eth_dev_allocate(const char *name) > struct rte_eth_dev *eth_dev = NULL; > size_t name_len; > > + if (name == NULL) { > + RTE_ETHDEV_LOG(ERR, "Null pointer is specified\n"); > + return NULL; > + } > + Ok, but I doubt that a driver that is so buggy that it passes NULL that it will do any proper error handling on return of NULL. Would rather just see the application crash hard immediately.