]> xenbits.xensource.com Git - xen.git/commitdiff
x86/HVM: prevent use-after-free when destroying a domain
authorMihai Donțu <mdontu@bitdefender.com>
Tue, 6 Jan 2015 12:52:21 +0000 (12:52 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 6 Jan 2015 12:52:41 +0000 (12:52 +0000)
hvm_domain_relinquish_resources() can free certain domain resources
which can still be accessed, e.g. by HVMOP_set_param, while the domain
is being cleaned up.

Signed-off-by: Mihai Donțu <mdontu@bitdefender.com>
Tested-by: Răzvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This is CVE-2015-0361 / XSA-116.
(cherry picked from commit 5d4e3ff19c33770ce01bec949c50326b11088fef)

xen/arch/x86/hvm/hvm.c

index 4be249e424706078606446db4d4e4ede49ea45c7..dcac4ad96211b758e1ff4a27b4045cb4481ca8b0 100644 (file)
@@ -579,13 +579,13 @@ void hvm_domain_relinquish_resources(struct domain *d)
         hpet_deinit(d);
     }
 
-    xfree(d->arch.hvm_domain.io_handler);
-    xfree(d->arch.hvm_domain.params);
     xfree(d->arch.hvm_domain.pbuf);
 }
 
 void hvm_domain_destroy(struct domain *d)
 {
+    xfree(d->arch.hvm_domain.io_handler);
+    xfree(d->arch.hvm_domain.params);
     hvm_funcs.domain_destroy(d);
     rtc_deinit(d);
     stdvga_deinit(d);