]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: fixes for vmentry_l1d_flush module parameter
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Aug 2018 14:43:39 +0000 (16:43 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Aug 2018 14:48:39 +0000 (16:48 +0200)
commit81a6a3595be08df7cc1c2cf5096d0e51d3e63792
tree027609ac352b5318b3cdbbfc0f5374aab96f923c
parent095a0da9d2eeecd7d01e068da850cba13e6d57da
KVM: VMX: fixes for vmentry_l1d_flush module parameter

Two bug fixes:

1) missing entries in the l1d_param array; this can cause a host crash
if an access attempts to reach the missing entry. Future-proof the get
function against any overflows as well.  However, the two entries
VMENTER_L1D_FLUSH_EPT_DISABLED and VMENTER_L1D_FLUSH_NOT_REQUIRED must
not be accepted by the parse function, so disable them there.

2) invalid values must be rejected even if the CPU does not have the
bug, so test for them before checking boot_cpu_has(X86_BUG_L1TF)

... and a small refactoring, since the .cmd field is redundant with
the index in the array.

Reported-by: Bandan Das <bsd@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 446f5012d3f28b8c1ee690d85186966eeb5c1e59
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c