x86: fix information leak on AMD CPUs
authorJan Beulich <jbeulich@suse.com>
Tue, 29 Mar 2016 12:24:26 +0000 (14:24 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 29 Mar 2016 12:24:26 +0000 (14:24 +0200)
commit7bd9dc3adfbb014c55f0928ebb3b20950ca9c019
tree279837118382a183d69468af614eab96eaa54231
parent04119085f5a2a135e5161535b8821e1aa0d7db8a
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 CVE-2016-3158 / CVE-2016-3159 / XSA-172.
[xen/arch/x86/xstate.c:xrstor: CVE-2016-3158]
[xen/arch/x86/i387.c:fpu_fxrstor: CVE-2016-3159]

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/i387.c
xen/arch/x86/xstate.c