]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/msr: Free msr_vcpu_policy during vcpu destruction
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Jan 2018 13:32:01 +0000 (14:32 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Jan 2018 13:32:01 +0000 (14:32 +0100)
c/s 4187f79dc7 "x86/msr: introduce struct msr_vcpu_policy" introduced a
per-vcpu memory allocation, but failed to free it in the clean vcpu
destruction case.

This is XSA-253.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: e204e60f77702bf5c884dd37c3f1b01f14e396ae
master date: 2018-01-04 14:27:38 +0100

xen/arch/x86/domain.c

index 735f45c13320588fab18d53cb4239f68f09a5df1..b44c95b49301c906c2edc1a882a970fa4b979d87 100644 (file)
@@ -382,6 +382,9 @@ void vcpu_destroy(struct vcpu *v)
 
     vcpu_destroy_fpu(v);
 
+    xfree(v->arch.msr);
+    v->arch.msr = NULL;
+
     if ( !is_idle_domain(v->domain) )
         vpmu_destroy(v);