From 5d4e3ff19c33770ce01bec949c50326b11088fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Don=C8=9Bu?= Date: Tue, 6 Jan 2015 12:52:21 +0000 Subject: [PATCH] x86/HVM: prevent use-after-free when destroying a domain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Răzvan Cojocaru Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich This is CVE-2015-0361 / XSA-116. --- xen/arch/x86/hvm/hvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index edf649153e..c731cc4609 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -602,13 +602,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);