]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: VMX: Bug the VM if either MSR auto-load list is full
authorSean Christopherson <seanjc@google.com>
Sat, 6 Dec 2025 00:17:15 +0000 (16:17 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 8 Jan 2026 19:52:20 +0000 (11:52 -0800)
commit2ed57bb8997610b33cb92c26ccb9a91b2966fff8
tree1ed247e2d5eefe8f2f50c5ad343a04ec55e12ddf
parent84ac00042a28642cc974a0a250fab7df050a5dd5
KVM: VMX: Bug the VM if either MSR auto-load list is full

WARN and bug the VM if either MSR auto-load list is full when adding an
MSR to the lists, as the set of MSRs that KVM loads via the lists is
finite and entirely KVM controlled, i.e. overflowing the lists shouldn't
be possible in a fully released version of KVM.  Terminate the VM as the
core KVM infrastructure has no insight as to _why_ an MSR is being added
to the list, and failure to load an MSR on VM-Enter and/or VM-Exit could
be fatal to the host.  E.g. running the host with a guest-controlled PEBS
MSR could generate unexpected writes to the DS buffer and crash the host.

Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Tested-by: Manali Shukla <manali.shukla@amd.com>
Link: https://patch.msgid.link/20251206001720.468579-40-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c