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 04085A0350; Fri, 26 Jun 2020 12:13:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8C25E1BEB2; Fri, 26 Jun 2020 12:13:11 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 5558C1BEB0 for ; Fri, 26 Jun 2020 12:13:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593166389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Oxt8JtSoFUN/k92/gIwR8XT402ALgRuTzQXfDqOp4lA=; b=IBr0jn49zST9keS3Xz5fz85cbneLnkan//p2Dtg0aFhxE0zGPoV9sV9kJ3OpAz2rXQLrBO qC/EtBP8ePwHd636P2flQ8wbZky8Zlv/7qhwbPGa+YRiFtLQyqVtfd2jr4nVTWPrQI6xda XxLA81jNs8NAmBIrIvcs5F0eTExb9Fk= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-Qs9R7UngNnq7ZSJOuDVAew-1; Fri, 26 Jun 2020 06:13:06 -0400 X-MC-Unique: Qs9R7UngNnq7ZSJOuDVAew-1 Received: by mail-wr1-f71.google.com with SMTP id z3so10182593wrr.7 for ; Fri, 26 Jun 2020 03:13:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Oxt8JtSoFUN/k92/gIwR8XT402ALgRuTzQXfDqOp4lA=; b=o7Kj2EWnu23uUGxUfvUXLX29MgSdawzJPaUl0w8vOwRpGVle7JE5R20luu8co0bTeG avY3kpOFYdHrAjJGcfnEUBx0+7LVSocvhOJ2CPz0K/E/zq3BgeZr5BxtE0VfvoOQP1pO kiGRutI/KWOJbeZjlm6TGbB0B/FSeX8WD/AB/iEM9/xBCDe6mXfr+zKmjSjlLs5Y/bHT 73uNOYJjNTPKoHVbR8ya3fmcSctyDTw9cpA0Jzhx0XBcYC5HfslbyHBUK3iYjzPBg6Th 8pz0GysECQMFAfFNLfjyAxXUtkOoxW3oyyHmhL+y1iaZma2EiLX2R3mn21QaJWLdtSst AW2w== X-Gm-Message-State: AOAM531w983Stmdwa487uVBghApjwOLz/xCSQQfePw/QzyketF5R1n6o LWc0PfjMG3vB3HiV4isG4rbxRk581TQp3CuAFNH+FRlQ2rjaKGBx6tOROcx8NK+la+PTZ/OgajM SqRk= X-Received: by 2002:a5d:6045:: with SMTP id j5mr2837191wrt.209.1593166384818; Fri, 26 Jun 2020 03:13:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTv3uEf1gBY3N6tNLYyQRfGT2RCkIm6OUloNGc4B+P2HEy4ax1ta/jIACLUzAfntaGjxvl0A== X-Received: by 2002:a5d:6045:: with SMTP id j5mr2837162wrt.209.1593166384604; Fri, 26 Jun 2020 03:13:04 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([92.176.159.3]) by smtp.gmail.com with ESMTPSA id v4sm21920766wro.26.2020.06.26.03.13.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jun 2020 03:13:03 -0700 (PDT) To: Maxime Coquelin , matan@mellanox.com, xiao.w.wang@intel.com, zhihong.wang@intel.com, chenbo.xia@intel.com, david.marchand@redhat.com, viacheslavo@mellanox.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, grive@u256.net, dev@dpdk.org Cc: stable@dpdk.org, shreyansh.jain@nxp.com References: <20200624122701.1369327-1-maxime.coquelin@redhat.com> <20200624122701.1369327-2-maxime.coquelin@redhat.com> From: Adrian Moreno Autocrypt: addr=amorenoz@redhat.com; prefer-encrypt=mutual; keydata= mQENBF1syNUBCADQ9dk3fDMxOZ/+OQpmbanpodYxEv8IRtDz8PXw8YX7UyGfozOpLjQ8Fftj ZxuubYNbt2QVbSgviFilFdNWu2eTnN/JaGtfhmTOLPVoakkPHZF8lbgImMoch7L0fH8wN2IM KPxQyPNlX+K9FD5brHsV1lfe1TwAxmhcvLW8yNrVq+9eDIDykxc7tH4exIqXgZroahGxMHKy c8Ti2kJka/t6pDfRaY0J+6J7I1nrn6GXXSMNA45EH8+0N/QlcXhP3rfftnoPeVmpjswzvJqY FNjf/Q5VPLx7RX0Qx+y8mMB2JcChV5Bl7D7x5EUbItj6+Sy7QfOgCtPegk9HSrBCNYaLABEB AAG0I0FkcmlhbiBNb3Jlbm8gPGFtb3Jlbm96QHJlZGhhdC5jb20+iQFUBBMBCAA+FiEEogUD gihhmbOPHy26d5C5fbYeFsUFAl1syNUCGwMFCQHhM4AFCwkIBwIGFQoJCAsCBBYCAwECHgEC F4AACgkQd5C5fbYeFsX7qwgArGHSkX+ILNcujkVzjTG4OtkpJMPFlkn/1PxSEKD0jLuzx14B COzpg/Mqj3Re/QBuOas+ci9bsUA0/2nORtmmEBvzDOJpR5FH1jaGCx8USlY4WM6QqEDNZgTw hsy9KhjFzFjMk+oo3HyItXA+Uq9yrRBTjNBGTXxezMRcMuUZ4MIAfY0IRBglL2BufiuL43jD BvTENNFLoQ/wFV7qkFWSkv+8IjTsxr7M6XUo1QLd29Hn0dvwssN579HL1+BP46i2REpzeBEG L75iVChi+YnIQQNMJ9NYarVabZx4Y1Gn8+7B/1SNArDV+IDgnYgt7E58otoV2Ap310dmtuvE VbxGpbkBDQRdbMjVAQgAqyp9oA7WDu7/Y9T4Ommt69iZx8os7shUIfdgPEy5xrcPn6qGwN1/ HQ4j8nWfBG9uuX1X0RXUZIUEtYTxtED4yaCQMTqDUf9cBAwAA2mYxBfoiNYx8YqxM+sT0/J4 2qmDd+y+20UR4yzHE8AmIbspTzDFIJDAi+jKSR8F355z0sfW7CIMDC4ZWrPsskjEy1YN/U10 r6tRRH1kNyrCSbTG0d9MtcQO58h7DLXuzUhErB+BtG52A04t5cweIJTJC+koV5XPeilzlHnm RFoj0ncruGa9Odns21BNt3cy9wLfK+aUnWuAB1uc6bJGQPiAwjkilz7g7MBRUuIQ2Zt7HGLc SwARAQABiQE8BBgBCAAmFiEEogUDgihhmbOPHy26d5C5fbYeFsUFAl1syNUCGwwFCQHhM4AA CgkQd5C5fbYeFsUlSwf8CH+u/IXaE7WeWxwFkMaORfW8cM4q0xrL3M6yRGuQNW+kMjnrvK9U J9G+L1/5uTRbDQ/4LdoKqize8LjehA+iF6ba4t9Npikh8fLKWgaJfQ/hPhH4C3O5gWPOLTW6 ylGxiuER4CdFwQIoAMMslhFA7G+teeOKBq36E+1+zrybI6Xy1UBSlpDK9j4CtTnMQejjuSQb Qhle+l8VroaUHq869wjAhRHHhqmtJKggI+OvzgQpDIwfHIDypb1BuKydi2W6cVYEALUYyCLS dTBDhzj8zR5tPCsga8J7+TclQzkWOiI2C6ZtiWrMsL/Uym3uXk5nsoc7lSj7yLd/MrBRhYfP JQ== Message-ID: <0aecdd8f-74a8-9472-92e4-92affddb6ca5@redhat.com> Date: Fri, 26 Jun 2020 12:13:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200624122701.1369327-2-maxime.coquelin@redhat.com> Content-Language: en-US Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=amorenoz@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 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 6/24/20 2:26 PM, 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) { > ... > } > > 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; > + } > + nitpicky: technically the trailing "\n" is not needed. Feel free to ignore > /* Expectation is that device would be name=device_name */ > if (strncmp(str, "name=", 5) != 0) { > DPAA_BUS_DEBUG("Invalid device string (%s)\n", str); > Acked-by: Adrián Moreno -- Adrián Moreno