xen: for 4.10.0: XSA-253 / CVE-2018-5244 patch

Fix a memory leak with MSR emulation on x86.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Christopher Clark 2018-01-08 23:12:48 -08:00 committed by Bruce Ashfield
parent 4ff3c5474f
commit dc3e72a8f4
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,26 @@
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: x86/msr: Free msr_vcpu_policy during vcpu destruction
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>
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index b17468c..0ae715d 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -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);

View File

@ -1,7 +1,9 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
require xen.inc
SRC_URI = " \
https://downloads.xenproject.org/release/xen/${PV}/xen-${PV}.tar.gz \
file://xsa253.patch \
"
SRC_URI[md5sum] = "ab9d320d02cb40f6b40506aed1a38d58"