Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From: Andrew Cooper <andrew.cooper3@citrix.com> |
| 2 | Subject: x86/msr: Free msr_vcpu_policy during vcpu destruction |
| 3 | |
| 4 | c/s 4187f79dc7 "x86/msr: introduce struct msr_vcpu_policy" introduced a |
| 5 | per-vcpu memory allocation, but failed to free it in the clean vcpu |
| 6 | destruction case. |
| 7 | |
| 8 | This is XSA-253 |
| 9 | |
| 10 | Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> |
| 11 | Reviewed-by: Jan Beulich <jbeulich@suse.com> |
| 12 | |
| 13 | diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c |
| 14 | index b17468c..0ae715d 100644 |
| 15 | --- a/xen/arch/x86/domain.c |
| 16 | +++ b/xen/arch/x86/domain.c |
| 17 | @@ -382,6 +382,9 @@ void vcpu_destroy(struct vcpu *v) |
| 18 | |
| 19 | vcpu_destroy_fpu(v); |
| 20 | |
| 21 | + xfree(v->arch.msr); |
| 22 | + v->arch.msr = NULL; |
| 23 | + |
| 24 | if ( !is_idle_domain(v->domain) ) |
| 25 | vpmu_destroy(v); |
| 26 | |