]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: x86/xen: Restrict hypercall MSR to unofficial synthetic range
authorSean Christopherson <seanjc@google.com>
Sat, 15 Feb 2025 01:14:33 +0000 (17:14 -0800)
committerSean Christopherson <seanjc@google.com>
Mon, 24 Feb 2025 16:59:55 +0000 (08:59 -0800)
commit5c17848134ab1ffb97c4a17a6e25b41390478152
tree8113060a00d9134f1f0361a244f6d4eca5e2cc42
parent3617c0ee7decb3db3f230b1c844126575fab4d49
KVM: x86/xen: Restrict hypercall MSR to unofficial synthetic range

Reject userspace attempts to set the Xen hypercall page MSR to an index
outside of the "standard" virtualization range [0x40000000, 0x4fffffff],
as KVM is not equipped to handle collisions with real MSRs, e.g. KVM
doesn't update MSR interception, conflicts with VMCS/VMCB fields, special
case writes in KVM, etc.

While the MSR index isn't strictly ABI, i.e. can theoretically float to
any value, in practice no known VMM sets the MSR index to anything other
than 0x40000000 or 0x40000200.

Cc: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Link: https://lore.kernel.org/r/20250215011437.1203084-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Documentation/virt/kvm/api.rst
arch/x86/include/uapi/asm/kvm.h
arch/x86/kvm/xen.c