From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LnpUp-0004DZ-U6 for qemu-devel@nongnu.org; Sun, 29 Mar 2009 03:31:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LnpUk-0004Bk-9V for qemu-devel@nongnu.org; Sun, 29 Mar 2009 03:31:54 -0400 Received: from [199.232.76.173] (port=49515 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnpUk-0004Bh-2D for qemu-devel@nongnu.org; Sun, 29 Mar 2009 03:31:50 -0400 Received: from mx20.gnu.org ([199.232.41.8]:22761) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LnpUj-0005Ky-J6 for qemu-devel@nongnu.org; Sun, 29 Mar 2009 03:31:49 -0400 Received: from verein.lst.de ([213.95.11.210]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LnpUi-0007Tj-Ab for qemu-devel@nongnu.org; Sun, 29 Mar 2009 03:31:48 -0400 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id n2T7VeIF011487 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sun, 29 Mar 2009 09:31:40 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id n2T7Ve6b011485 for qemu-devel@nongnu.org; Sun, 29 Mar 2009 09:31:40 +0200 Date: Sun, 29 Mar 2009 09:31:40 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH] check for bs->drv in bdrv_flush Message-ID: <20090329073140.GA11041@lst.de> References: <20090328183916.GA25875@lst.de> <49CECFB3.8010407@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49CECFB3.8010407@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Sat, Mar 28, 2009 at 08:32:35PM -0500, Anthony Liguori wrote: > Christoph Hellwig wrote: > >All the bdrv_ helpers should check for bs->drv being zero as that means > >there is no backend image open. bdrv_flush fails to perform that check > >and can thus cause NULL pointer dereferences. > > > >Found using qemu-io. > > > > Applied. Thanks. > > FWIW, I plan to include qemu-io once you rebase the series to use > IOVectors instead of struct iovec. It looks like a useful tool! The repost already uses QEMUIOVectors, I'll resend it with a formal description.