Commit a5d5638
committed
KVM: x86: Reject userspace attempts to access ARCH_CAPABILITIES w/o support
Reject userspace accesses to ARCH_CAPABILITIES if the MSR isn't supposed
to exist, according to guest CPUID. However, "reject" accesses with
KVM_MSR_RET_UNSUPPORTED, so that reads get '0' and writes of '0' are
ignored if KVM advertised support ARCH_CAPABILITIES.
KVM's ABI is that userspace must set guest CPUID prior to setting MSRs,
and that setting MSRs that aren't supposed exist is disallowed (modulo the
'0' exemption).
Link: https://lore.kernel.org/r/20240802185511.305849-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent a103911 commit a5d5638
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3795 | 3795 | | |
3796 | 3796 | | |
3797 | 3797 | | |
3798 | | - | |
3799 | | - | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
3800 | 3801 | | |
3801 | 3802 | | |
3802 | 3803 | | |
| |||
4256 | 4257 | | |
4257 | 4258 | | |
4258 | 4259 | | |
4259 | | - | |
4260 | | - | |
4261 | | - | |
| 4260 | + | |
| 4261 | + | |
4262 | 4262 | | |
4263 | 4263 | | |
4264 | 4264 | | |
| |||
0 commit comments