• Paolo Bonzini's avatar
    KVM: VMX: fixes for vmentry_l1d_flush module parameter · 8729412c
    Paolo Bonzini authored
    commit 0027ff2a upstream.
    
    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: default avatarBandan Das <bsd@redhat.com>
    Cc: stable@vger.kernel.org
    Fixes: a7b9020bSigned-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    8729412c
vmx.c 333 KB