]> git.hungrycats.org Git - linux/commit
KVM: x86: SYSENTER emulation is broken
authorNadav Amit <namit@cs.technion.ac.il>
Thu, 1 Jan 2015 21:11:11 +0000 (23:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Jan 2015 01:40:45 +0000 (17:40 -0800)
commitcb2567bf3eed3c7fe5fd914d827e3088d21e565f
treeb3684403eef555bffcdfa19ce7424b6a654a1606
parentc546e47591d7c8b4fa3dc2d9dae14c127f0c3b22
KVM: x86: SYSENTER emulation is broken

commit f3747379accba8e95d70cec0eae0582c8c182050 upstream.

SYSENTER emulation is broken in several ways:
1. It misses the case of 16-bit code segments completely (CVE-2015-0239).
2. MSR_IA32_SYSENTER_CS is checked in 64-bit mode incorrectly (bits 0 and 1 can
   still be set without causing #GP).
3. MSR_IA32_SYSENTER_EIP and MSR_IA32_SYSENTER_ESP are not masked in
   legacy-mode.
4. There is some unneeded code.

Fix it.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/emulate.c