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 D6956A051C; Fri, 26 Jun 2020 15:48:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D99AA1BF81; Fri, 26 Jun 2020 15:48:22 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 0F8A81B13C for ; Fri, 26 Jun 2020 15:48:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593179301; 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=vRaO8RDrs7+mOcOB1VA/Y0XpJHRQkB3WhHmJ0de2UEQ=; b=flspp0+KBwxj++79cwdgivEZf6uMmPrLgXmlPTUso+ugpYNEmql0Uq4isB9R66B77NSRev nRZ0NraJe8v2aa34FOuoNf8CFvbIRtH26Euqrx9VXcYEBvRAuQcSOKBhoyTDuFv01tR4+g eIfGu1izGiuSMcEIusrkfVRFAOYlo4U= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-109-l-B1vL94Ns-aCi8z8cPaXg-1; Fri, 26 Jun 2020 09:48:19 -0400 X-MC-Unique: l-B1vL94Ns-aCi8z8cPaXg-1 Received: by mail-wm1-f70.google.com with SMTP id o138so10003052wme.4 for ; Fri, 26 Jun 2020 06:48:19 -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=vRaO8RDrs7+mOcOB1VA/Y0XpJHRQkB3WhHmJ0de2UEQ=; b=Mp9+mUlBdcDrYw1dLKZ8O8+RzbpfpZNjSz4oxb/sCUnUkr3kVqlsiMaEHcpGXyYyVT 6yVuOIE5y7Oc1r+U0cuth6Ptw7SbYdCAz0MXXEP60vv3KMTxKH7UPvyEOaBM3qJmPGRO zEAx6B8smySaDlDUPylGcY6CYqw5Pei7dlsXGipZ0zUWS5hn62ctzMurJA0pR85xgVCS oJGa1tMEDEY+I79FPCvmsgp45a/LLzZ13hiYWz2i9jlGDTyQLg2Dimr8gwFUnt1Ex4jM XQpgNy5NbC2p/1C5cRP6SSmo9CB6FleA/gAnW3+Q/Z0I7oSm5eStulOEZ8xJzz33zqmd yBPQ== X-Gm-Message-State: AOAM530pPV6atPB5QxcXZkJQZVVs8NfryiTS/3g7/JvErRBdGGA029xQ CPxpGP4KtA+CkfHvcWao4HMoUBokoquoBTYM2ADAD2irccsOit9ZTLGGcUqpadqHPHFR+DQUAZz IITU= X-Received: by 2002:a7b:c156:: with SMTP id z22mr3446725wmi.43.1593179298892; Fri, 26 Jun 2020 06:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM9kZEIvm3Y5Q3OzXPt3Xiv+cuFBYbn0Ze/5PxiosQGoZwMouHqNyDkgVlAFQcdJu1CQ7HsA== X-Received: by 2002:a7b:c156:: with SMTP id z22mr3446699wmi.43.1593179298670; Fri, 26 Jun 2020 06:48:18 -0700 (PDT) Received: from amorenoz.users.ipa.redhat.com ([92.176.159.3]) by smtp.gmail.com with ESMTPSA id k11sm34925007wrd.23.2020.06.26.06.48.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Jun 2020 06:48:18 -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: <20200626132712.1437673-1-maxime.coquelin@redhat.com> <20200626132712.1437673-3-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: <45e4aec5-9248-ba2f-3562-8a1a45e1799e@redhat.com> Date: Fri, 26 Jun 2020 15:48:16 +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: <20200626132712.1437673-3-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 v3 02/14] bus/fslmc: 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/26/20 3:27 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: e67a61614d0b ("bus/fslmc: support device iteration") > Cc: stable@dpdk.org > Cc: shreyansh.jain@nxp.com > > Signed-off-by: Maxime Coquelin > --- > drivers/bus/fslmc/fslmc_bus.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c > index afbd82e8db..ac46eb4fe8 100644 > --- a/drivers/bus/fslmc/fslmc_bus.c > +++ b/drivers/bus/fslmc/fslmc_bus.c > @@ -603,6 +603,11 @@ fslmc_bus_dev_iterate(const void *start, const char *str, > struct rte_dpaa2_device *dev; > char *dup, *dev_name = NULL; > > + if (str == NULL) { > + DPAA2_BUS_DEBUG("No device string"); > + return NULL; > + } > + > /* Expectation is that device would be name=device_name */ > if (strncmp(str, "name=", 5) != 0) { > DPAA2_BUS_DEBUG("Invalid device string (%s)\n", str); > Acked-by: Adrián Moreno -- Adrián Moreno