Skip to content

Commit

Permalink
Merge branch 'kvm-insert-lfence' into kvm-master
Browse files Browse the repository at this point in the history
Topic branch for CVE-2017-5753, avoiding conflicts in the next merge window.
  • Loading branch information
Paolo Bonzini committed Jan 11, 2018
2 parents bd89525 + 75f139a commit 2aad9b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 2aad9b3

Please sign in to comment.