Commit 05992edc authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Radim Krčmář

Merge branch 'kvm-insert-lfence'

Topic branch for CVE-2017-5753, avoiding conflicts in the next merge window.
parents 505c9e94 75f139aa
...@@ -893,8 +893,16 @@ static inline short vmcs_field_to_offset(unsigned long field) ...@@ -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); BUILD_BUG_ON(ARRAY_SIZE(vmcs_field_to_offset_table) > SHRT_MAX);
if (field >= ARRAY_SIZE(vmcs_field_to_offset_table) || if (field >= ARRAY_SIZE(vmcs_field_to_offset_table))
vmcs_field_to_offset_table[field] == 0) 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 -ENOENT;
return vmcs_field_to_offset_table[field]; return vmcs_field_to_offset_table[field];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment