]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 6 Jun 2018 15:38:09 +0000 (17:38 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Jun 2018 13:06:34 +0000 (15:06 +0200)
commita50c926505ee40245ac06105e45cee2ea265b774
tree938330204174cabc88a26f00f72ce8652bcb49c0
parent699163b8e2009401bbd792ebcd4510acf5e24a86
kvm: x86: use correct privilege level for sgdt/sidt/fxsave/fxrstor access

The functions that were used in the emulation of fxrstor, fxsave, sgdt and
sidt were originally meant for task switching, and as such they did not
check privilege levels.  This is very bad when the same functions are used
in the emulation of unprivileged instructions.  This is CVE-2018-10853.

The obvious fix is to add a new argument to ops->read_std and ops->write_std,
which decides whether the access is a "system" access or should use the
processor's CPL.

Fixes: e82eb6ea59d3 ("KVM: x86: Introduce segmented_write_std", 2017-01-12)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c