This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [qemu-xen-3.4-testing] check for bs->drv in bdrv_flush (

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [qemu-xen-3.4-testing] check for bs->drv in bdrv_flush (Christoph Hellwig)
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Tue, 20 Oct 2009 05:06:49 -0700
Delivery-date: Tue, 20 Oct 2009 05:06:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
commit b5e7982ade668d18e07f51401d9af04d612c3be3
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Wed Oct 7 15:51:55 2009 +0100

    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@xxxxxx>
    Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6943 
    [ Backported from 6bbff9a0b495918309074ac60375be5f9dc868b3
      by Stefano Stabellini. ]
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    (cherry picked from commit dddf85563a18db9ae83d59ad567f4d77d39da821)
 block.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block.c b/block.c
index c3c44a9..3261225 100644
--- a/block.c
+++ b/block.c
@@ -1071,6 +1071,8 @@ const char *bdrv_get_device_name(BlockDriverState *bs)
 int bdrv_flush(BlockDriverState *bs)
     int ret = 0;
+    if (!bs->drv)
+        return -EINVAL;
     if (bs->drv->bdrv_flush)
         ret = bs->drv->bdrv_flush(bs);
     if (!ret && bs->backing_hd)
generated by git-patchbot for /home/xen/git/qemu-xen-3.4-testing.git

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [qemu-xen-3.4-testing] check for bs->drv in bdrv_flush (Christoph Hellwig), Ian Jackson <=