]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix job usage in virDomainGetBlockIoTune
authorJiri Denemark <jdenemar@redhat.com>
Fri, 20 Dec 2013 14:41:04 +0000 (15:41 +0100)
committerEric Blake <eblake@redhat.com>
Wed, 15 Jan 2014 17:36:44 +0000 (10:36 -0700)
CVE-2013-6458

Every API that is going to begin a job should do that before fetching
data from vm->def.

(cherry picked from commit 3b56425938e2f97208d5918263efa0d6439e4ecd)

src/qemu/qemu_driver.c

index c3461186184e054153ff93bb471a8527f1f87fa6..4de4e953d0045d68ab0bdea9316ecc391da1a8e5 100644 (file)
@@ -13795,12 +13795,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
         goto cleanup;
     }
 
-    device = qemuDiskPathToAlias(vm, disk, NULL);
-
-    if (!device) {
-        goto cleanup;
-    }
-
     if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
         goto cleanup;
 
@@ -13808,6 +13802,11 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
                                         &persistentDef) < 0)
         goto endjob;
 
+    device = qemuDiskPathToAlias(vm, disk, NULL);
+    if (!device) {
+        goto endjob;
+    }
+
     if (flags & VIR_DOMAIN_AFFECT_LIVE) {
         priv = vm->privateData;
         qemuDomainObjEnterMonitor(driver, vm);