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 13558A00BE; Fri, 12 Jun 2020 11:49:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 66E572A62; Fri, 12 Jun 2020 11:49:00 +0200 (CEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by dpdk.org (Postfix) with ESMTP id 3D36B1D9E; Fri, 12 Jun 2020 11:48:59 +0200 (CEST) X-Originating-IP: 86.246.31.132 Received: from u256.net (lfbn-idf2-1-566-132.w86-246.abo.wanadoo.fr [86.246.31.132]) (Authenticated sender: grive@u256.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id B57C440018; Fri, 12 Jun 2020 09:48:56 +0000 (UTC) Date: Fri, 12 Jun 2020 11:48:45 +0200 From: =?utf-8?Q?Ga=C3=ABtan?= Rivet To: Maxime Coquelin Cc: dev@dpdk.org, matan@mellanox.com, xiao.w.wang@intel.com, zhihong.wang@intel.com, xiaolong.ye@intel.com, chenbo.xia@intel.com, david.marchand@redhat.com, amorenoz@redhat.com, shreyansh.jain@nxp.com, viacheslavo@mellanox.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, stable@dpdk.org Message-ID: <20200612094845.ezbkao5f2emkdt34@u256.net> References: <20200611213748.1967029-1-maxime.coquelin@redhat.com> <20200611213748.1967029-2-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200611213748.1967029-2-maxime.coquelin@redhat.com> Subject: Re: [dpdk-dev] [PATCH 01/14] bus/dpaa: fix null pointer dereference 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 11/06/20 23:37 +0200, Maxime Coquelin wrote: > This patches fixes a null pointer derefencing that happens > when the device string passed to the iterator is NULL. This > situation can happen when iterating on a class type. > For example: > > RTE_DEV_FOREACH(dev, "class=eth", &dev_iter) { > ... > } > Given this fix and the next, this seems like an oversight / bug from the iterator actually. Those two fixes are still correct but the root cause should be addressed. > Fixes: e79df833d3f6 ("bus/dpaa: support hotplug ops") > Cc: stable@dpdk.org > Cc: shreyansh.jain@nxp.com > > Signed-off-by: Maxime Coquelin > --- > drivers/bus/dpaa/dpaa_bus.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c > index d53fe6083a..216f38acd4 100644 > --- a/drivers/bus/dpaa/dpaa_bus.c > +++ b/drivers/bus/dpaa/dpaa_bus.c > @@ -703,6 +703,11 @@ dpaa_bus_dev_iterate(const void *start, const char *str, > struct rte_dpaa_device *dev; > char *dup, *dev_name = NULL; > > + if (str == NULL) { > + DPAA_BUS_DEBUG("No device string\n"); > + return NULL; > + } > + > /* Expectation is that device would be name=device_name */ > if (strncmp(str, "name=", 5) != 0) { > DPAA_BUS_DEBUG("Invalid device string (%s)\n", str); > -- > 2.26.2 > -- Gaëtan