From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48293 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQOs8-00062y-KF for qemu-devel@nongnu.org; Wed, 08 Dec 2010 13:36:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQOs7-0007MN-EL for qemu-devel@nongnu.org; Wed, 08 Dec 2010 13:36:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQOs7-0007ME-5a for qemu-devel@nongnu.org; Wed, 08 Dec 2010 13:36:11 -0500 Date: Wed, 8 Dec 2010 16:36:06 -0200 From: Luiz Capitulino Message-ID: <20101208163606.79831504@doriath> In-Reply-To: <20101208160500.GQ22381@us.ibm.com> References: <20101208160500.GQ22381@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] blockdev: check dinfo ptr before using List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ryan Harper Cc: Kevin Wolf , qemu-devel@nongnu.org, Markus Armbruster On Wed, 8 Dec 2010 10:05:00 -0600 Ryan Harper wrote: > If a user decides to punish a guest by revoking its block device via > drive_del, and subsequently also attempts to remove the pci device > backing it, and the device is using blockdev_auto_del() then we get a > segfault when we attempt to access dinfo->auto_del.[1] > > The fix is to check if drive_get_by_blockdev() actually returns a valid > dinfo pointer or not. > > 1. (qemu) pci_add auto storage file=images/test01.raw,if=virtio,id=block1,snapshot=on > (qemu) drive_del block1 > (qemu) pci_del 5 > *segfault* > > Signed-off-by: Ryan Harper Fixes my test case: Tested-by: Luiz Capitulino