* [Qemu-devel] [6943] check for bs->drv in bdrv_flush (Christoph Hellwig)
@ 2009-03-29 1:31 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-03-29 1:31 UTC (permalink / raw)
To: qemu-devel
Revision: 6943
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6943
Author: aliguori
Date: 2009-03-29 01:31:51 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
check for bs->drv in bdrv_flush (Christoph Hellwig)
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.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/block.c
Modified: trunk/block.c
===================================================================
--- trunk/block.c 2009-03-29 01:31:48 UTC (rev 6942)
+++ trunk/block.c 2009-03-29 01:31:51 UTC (rev 6943)
@@ -1002,6 +1002,8 @@
void bdrv_flush(BlockDriverState *bs)
{
+ if (!bs->drv)
+ return;
if (bs->drv->bdrv_flush)
bs->drv->bdrv_flush(bs);
if (bs->backing_hd)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-29 1:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-29 1:31 [Qemu-devel] [6943] check for bs->drv in bdrv_flush (Christoph Hellwig) Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).