]> xenbits.xensource.com Git - 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)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 7 Jan 2014 15:12:11 +0000 (16:12 +0100)
CVE-2013-6458

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

src/qemu/qemu_driver.c

index 6f0de704026e3bc37a3f558da922cffd29f69966..1949abee94ecbd5eedfbd38cf13d783cb3485ae7 100644 (file)
@@ -15064,12 +15064,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;
 
@@ -15077,6 +15071,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);