]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
KVM: VMX: fixes for vmentry_l1d_flush module parameter
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Apr 2019 10:10:00 +0000 (12:10 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 24 Apr 2019 07:52:36 +0000 (09:52 +0200)
commit1dd6f98d2571c1d87ae4c051ec827cdfd3bf12e7
treec0450960754e4f7fd2c3d1c58a7936609c88ecc4
parent09c0663d3e9b18a3efb5165c2ed7f03008c04529
KVM: VMX: fixes for vmentry_l1d_flush module parameter

BugLink: https://bugs.launchpad.net/bugs/1822760
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: a7b9020b06ec6d7c3f3b0d4ef1a9eba12654f4f7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 0027ff2a75f9dcf0537ac0a65c5840b0e21a4950)
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kvm/vmx.c