[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 01/20] vvfat: Fix segfault on write to read-only dis

From: Kevin Wolf
Subject: [Qemu-devel] [PATCH 01/20] vvfat: Fix segfault on write to read-only disk
Date: Tue, 21 Sep 2010 17:21:43 +0200

From: Kevin Wolf <address@hidden>

vvfat tries to set the readonly flag in its open function, but nowadays
this is overwritted with the readonly=... command line option. Check in
bdrv_write if the vvfat was opened read-only and return an error in this

Without this check, vvfat tries to access the qcow bs, which is NULL
without enabled write support.

Signed-off-by: Kevin Wolf <address@hidden>
 block/vvfat.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/block/vvfat.c b/block/vvfat.c
index 365332a..5898d66 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2665,6 +2665,11 @@ static int vvfat_write(BlockDriverState *bs, int64_t 
+    /* Check if we're operating in read-only mode */
+    if (s->qcow == NULL) {
+        return -EACCES;
+    }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]