From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 0547F330D for ; Tue, 2 May 2017 00:59:44 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 71150209A1; Mon, 1 May 2017 18:59:44 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 01 May 2017 18:59:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=ckAjH7Qe5Q7KHG1 t8t9afh3Mclb5f9JFZcF6jAGIG6Q=; b=WTWOqRGZBXRlMA7WVQxMuXbbsqnKqkm eOeuHWzJG5JPgWbtPTMVR3iwidy4gm4DPPifSwzp+HmbP4felurE09dI1aGLLsX3 hzKd40sH7tHxIZ4B1xw7OT/5BlXmVo4UXUi+ReqUkG0PO/K2BhEHfpM1X3k+sqTH ptgYZkAi2d1U= 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-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=ckAjH7Qe5Q7KHG1t8t9afh3Mclb5f9JFZcF6jAGIG6Q=; b=mmaLyoa3 Vq4z2KiJ0CGVJHQrIUeTObtr6VJ89xzI0oKkwjL6ivU3f7G3Pq49LPy71D0Pzd3g YRmh1vRn6cX3gzabzIjn95iQyv5o0u4ed7UEgYwzZL/mlJ8rmVuMR32EkO/h2hBh aNQPJwYAgHKMATwXF4nFjEg2zYlAnvDOy4jRuqL48/6mrP/FpgurJbKRaYg7mHP6 FS45kj+Dm0RAPctPa4lrnwigYO/SSj+m9mlm8CNwtOtgTUf9idP/NsvnYw5umbIY B3Le1UxrzAk3WyBoDnXjGsZcCRk1mARKIQ/CL3jKiGkCaEsOfbXOrKbDRaYeBaAQ V1OVIkeBx/SUtw== X-ME-Sender: X-Sasl-enc: xF3GWczET5k2DLnakZCJ3X7+AapiBNKB62pAD2nc9n7U 1493679584 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2777C2473A; Mon, 1 May 2017 18:59:44 -0400 (EDT) From: Thomas Monjalon To: Yuanhan Liu , hanxueluo@126.com, Huanle Han Cc: dev@dpdk.org Date: Tue, 02 May 2017 00:59:43 +0200 Message-ID: <1531100.1qSifb3cKg@xps> In-Reply-To: <20170222023623.GO18844@yliu-dev.sh.intel.com> References: <1487599487-12574-1-git-send-email-hanxueluo@126.com> <1487599487-12574-3-git-send-email-hanxueluo@126.com> <20170222023623.GO18844@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 3/3] pci: fix crash caused by invaild memory write 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: , X-List-Received-Date: Mon, 01 May 2017 22:59:45 -0000 22/02/2017 03:36, Yuanhan Liu: > On Mon, Feb 20, 2017 at 10:04:47PM +0800, hanxueluo@126.com wrote: > > From: Huanle Han > > > > rte_eal_dev_detach() didn't remove dev from dev_device_list > > after free the dev. So the following attached dev wrote to > > the freed memory (tailq entry of previous dev) in below stack: > > > > == Invalid write of size 8 > > == at 0x43A9CE: rte_eal_device_insert (eal_common_dev.c:71) > > == by 0x42ED9E: pci_scan_one (eal_pci.c:365) > > == by 0x42EF4D: pci_update_device (eal_pci.c:391) > > == by 0x437F59: rte_eal_pci_probe_one (eal_common_pci.c:357) > > == by 0x43AB16: rte_eal_dev_attach (eal_common_dev.c:117) > > == by 0x45B3AA: rte_eth_dev_attach (rte_ethdev.c:489) > > == ... > > > > Signed-off-by: Huanle Han > > The two minor nits also apply here, besides that, > > Reviewed-by: Yuanhan Liu Nack The right fix is to remove the functions insert and remove. The list dev_device_list is not used anymore. I will make a patch.