diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-01-11 18:20:48 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-01-11 18:20:48 +0100 |
commit | 2aad9b3e0711f8c67c472920cd5b70199fba8520 (patch) | |
tree | a59584c6c12cc0a37361d727a6a2b1f57cd6deba /arch/x86 | |
parent | bd89525a823ce6edddcedbe9aed79faa1b9cf544 (diff) | |
parent | 75f139aaf896d6fdeec2e468ddfa4b2fe469bf40 (diff) | |
download | linux-2aad9b3e0711f8c67c472920cd5b70199fba8520.tar.bz2 |
Merge branch 'kvm-insert-lfence' into kvm-master
Topic branch for CVE-2017-5753, avoiding conflicts in the next merge window.
Diffstat (limited to 'arch/x86')
-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 427fd3200dd8..3f89f6783aa5 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -899,8 +899,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]; |