From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B50B0A0C5D for ; Fri, 5 Nov 2021 14:16:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A401D4117E; Fri, 5 Nov 2021 14:16:33 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 3C7CC40E5A; Fri, 5 Nov 2021 14:16:31 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A104A5C010E; Fri, 5 Nov 2021 09:16:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 05 Nov 2021 09:16:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= GtiaPjW0YLiVNP+sbBfa/gqTK3RXtSBPB9mzSsD0nro=; b=tt984yYfXbb+t6C7 OTzZTR9aNGLaUTOeey5IEMSoQXX/jomMUlEbiNJJ3xujQdaCU0IP0k5RkrqoCjc6 JrzCZcYyjwJtdQGZ7X2moJOwjsIX/7DKEsNPo5aqKJELhCNXP08y6A2NaU0B4WIg 7Tk005qu0JMI7AMewsgbZaov0xx/HPoqrl4j0Ufj2y0WN1aHG6kkuwcrESj6tWSe DwgeO57+9vesf+aYX12xu60QadPVqz2q8PUMP17xxcrUzVjvkrElbQGTFGIFL0Oy p/lbZ78v4dVkG/1bwdegC7kkPqJz9OMDKBDgqaEtyCWyQyW1KEL69rKx1Mpfq78A Pd7bgw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=GtiaPjW0YLiVNP+sbBfa/gqTK3RXtSBPB9mzSsD0n ro=; b=LYPP6MiqDSlJi/UiH8jsoyCFWW3/OuGng4NEbmB6iPJTND7MylGeqpxSS O2t4K8NQSZYVKY4IxmyQPs27NDM+CKNecdHB23B15UaBmBxR2qLFuN6JuMJYRJOl rx+IXpDr2UWX51nlm1x4us4dhp+algcmIccu7Vgm/kECKwctdvRR3o+03X0Qx/A8 UWiCKMGUai/E5lsupBnwZHIKE5/V9jGRa6spGX9K8OeZYjH+t4NWJSr/2Y+lrafd Qp/bNJtgWaB6KO1tIV4/I2wAGFoOvtsCPy2mgNzou2Dd/okYZN4vVahb17YsAG0+ 1vXiqqB0ALVJb+B04Mv6xBq5KKjZw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdeigdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Nov 2021 09:16:29 -0400 (EDT) From: Thomas Monjalon To: "Yigit, Ferruh" Cc: Andrew Rybchenko , Stephen Hemminger , dev@dpdk.org, "stable@dpdk.org" , Matan Azrad , "Xia, Chenbo" Date: Fri, 05 Nov 2021 14:16:27 +0100 Message-ID: <2458714.jUUgoNLaax@thomas> In-Reply-To: References: <20211102234434.2639807-1-ferruh.yigit@intel.com> <20211104110422.2920154-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] ethdev: fix crash on owner delete X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" 05/11/2021 04:03, Xia, Chenbo: > From: stable On Behalf Of Ferruh Yigit > > > 'eth_dev->data' can be null before ethdev allocated. The API walks > > through all eth devices, at least for some data can be null. > > > > Adding 'eth_dev->data' null check before accessing it. > > > > Fixes: 33c73aae32e4 ("ethdev: allow ownership operations on unused port") > > Cc: stable@dpdk.org > > > > Signed-off-by: Ferruh Yigit [...] > > @@ -757,10 +757,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id) > > rte_spinlock_lock(ð_dev_shared_data->ownership_lock); > > > > if (eth_is_valid_owner_id(owner_id)) { > > - for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) > > - if (rte_eth_devices[port_id].data->owner.id == owner_id) > > - memset(&rte_eth_devices[port_id].data->owner, 0, > > + for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) { > > + struct rte_eth_dev_data *data = > > + rte_eth_devices[port_id].data; > > + if (data != NULL && data->owner.id == owner_id) Indeed the NULL check was missing. > Acked-by: Chenbo Xia Acked-by: Thomas Monjalon