diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-01-16 18:38:52 +0300 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-01-16 18:39:30 +0300 |
commit | 05992edc279237d5803d64578e0c72b604970a49 (patch) | |
tree | ff4673fa7203626b9c99e914cee8fad35be8ca70 /arch | |
parent | 505c9e94d8329dc215617cf99505629e924f001e (diff) | |
parent | 75f139aaf896d6fdeec2e468ddfa4b2fe469bf40 (diff) | |
download | linux-05992edc279237d5803d64578e0c72b604970a49.tar.xz |
Merge branch 'kvm-insert-lfence'
Topic branch for CVE-2017-5753, avoiding conflicts in the next merge window.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/vmx.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index c1791759f1e6..7b1d71665bc2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -893,8 +893,16 @@ static inline short vmcs_field_to_offset(unsigned long field) { BUILD_BUG_ON(ARRAY_SIZE(vmcs_field_to_offset_table) > SHRT_MAX); - if (field >= ARRAY_SIZE(vmcs_field_to_offset_table) || - vmcs_field_to_offset_table[field] == 0) + if (field >= ARRAY_SIZE(vmcs_field_to_offset_table)) + return -ENOENT; + + /* + * FIXME: Mitigation for CVE-2017-5753. To be replaced with a + * generic mechanism. + */ + asm("lfence"); + + if (vmcs_field_to_offset_table[field] == 0) return -ENOENT; return vmcs_field_to_offset_table[field]; |