aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/xsa172-4.3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/xen/xsa172-4.3.patch')
-rw-r--r--main/xen/xsa172-4.3.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/main/xen/xsa172-4.3.patch b/main/xen/xsa172-4.3.patch
new file mode 100644
index 0000000000..b072b79386
--- /dev/null
+++ b/main/xen/xsa172-4.3.patch
@@ -0,0 +1,25 @@
+x86: fix information leak on AMD CPUs
+
+The fix for XSA-52 was wrong, and so was the change synchronizing that
+new behavior to the FXRSTOR logic: AMD's manuals explictly state that
+writes to the ES bit are ignored, and it instead gets calculated from
+the exception and mask bits (it gets set whenever there is an unmasked
+exception, and cleared otherwise). Hence we need to follow that model
+in our workaround.
+
+This is XSA-172 / CVE-2016-3158.
+
+Signed-off-by: Jan Beulich <jbeulich@suse.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
+
+--- a/xen/arch/x86/xstate.c
++++ b/xen/arch/x86/xstate.c
+@@ -158,7 +158,7 @@ void xrstor(struct vcpu *v, uint64_t mas
+ * data block as a safe address because it should be in L1.
+ */
+ if ( (mask & ptr->xsave_hdr.xstate_bv & XSTATE_FP) &&
+- !(ptr->fpu_sse.fsw & 0x0080) &&
++ !(ptr->fpu_sse.fsw & ~ptr->fpu_sse.fcw & 0x003f) &&
+ boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
+ asm volatile ( "fnclex\n\t" /* clear exceptions */
+ "ffree %%st(7)\n\t" /* clear stack tag */