c401cc
From ef6f042b3d11f1873657d6df1ea59c3d7437578f Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <ef6f042b3d11f1873657d6df1ea59c3d7437578f.1389183250.git.jdenemar@redhat.com>
c401cc
From: Jiri Denemark <jdenemar@redhat.com>
c401cc
Date: Fri, 20 Dec 2013 15:41:04 +0100
c401cc
Subject: [PATCH] qemu: Fix job usage in virDomainGetBlockIoTune
c401cc
c401cc
CVE-2013-6458
c401cc
c401cc
Every API that is going to begin a job should do that before fetching
c401cc
data from vm->def.
c401cc
c401cc
(cherry picked from commit 3b56425938e2f97208d5918263efa0d6439e4ecd)
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/qemu/qemu_driver.c | 11 +++++------
c401cc
 1 file changed, 5 insertions(+), 6 deletions(-)
c401cc
c401cc
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
c401cc
index 0cf2d4a..a9368b1 100644
c401cc
--- a/src/qemu/qemu_driver.c
c401cc
+++ b/src/qemu/qemu_driver.c
c401cc
@@ -15272,12 +15272,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
c401cc
         goto cleanup;
c401cc
     }
c401cc
 
c401cc
-    device = qemuDiskPathToAlias(vm, disk, NULL);
c401cc
-
c401cc
-    if (!device) {
c401cc
-        goto cleanup;
c401cc
-    }
c401cc
-
c401cc
     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
c401cc
         goto cleanup;
c401cc
 
c401cc
@@ -15285,6 +15279,11 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
c401cc
                                         &persistentDef) < 0)
c401cc
         goto endjob;
c401cc
 
c401cc
+    device = qemuDiskPathToAlias(vm, disk, NULL);
c401cc
+    if (!device) {
c401cc
+        goto endjob;
c401cc
+    }
c401cc
+
c401cc
     if (flags & VIR_DOMAIN_AFFECT_LIVE) {
c401cc
         priv = vm->privateData;
c401cc
         qemuDomainObjEnterMonitor(driver, vm);
c401cc
-- 
c401cc
1.8.5.2
c401cc