diff options
author | Zhenzhong Duan <[email protected]> | 2021-09-26 09:55:45 +0800 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2021-09-27 11:25:40 -0400 |
commit | 5c49d1850ddd3240d20dc40b01f593e35a184f38 (patch) | |
tree | 3731e09e04ed668099b922a49f8ab78529d0f949 /arch/s390/kvm/gaccess.c | |
parent | 50b078184604fea95adbb144ff653912fb0e48c6 (diff) |
KVM: VMX: Fix a TSX_CTRL_CPUID_CLEAR field mask issue
When updating the host's mask for its MSR_IA32_TSX_CTRL user return entry,
clear the mask in the found uret MSR instead of vmx->guest_uret_msrs[i].
Modifying guest_uret_msrs directly is completely broken as 'i' does not
point at the MSR_IA32_TSX_CTRL entry. In fact, it's guaranteed to be an
out-of-bounds accesses as is always set to kvm_nr_uret_msrs in a prior
loop. By sheer dumb luck, the fallout is limited to "only" failing to
preserve the host's TSX_CTRL_CPUID_CLEAR. The out-of-bounds access is
benign as it's guaranteed to clear a bit in a guest MSR value, which are
always zero at vCPU creation on both x86-64 and i386.
Cc: [email protected]
Fixes: 8ea8b8d6f869 ("KVM: VMX: Use common x86's uret MSR list as the one true list")
Signed-off-by: Zhenzhong Duan <[email protected]>
Reviewed-by: Sean Christopherson <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'arch/s390/kvm/gaccess.c')
0 files changed, 0 insertions, 0 deletions