diff options
| author | Fuad Tabba <fuad.tabba@linux.dev> | 2026-10-01 14:57:08 +0100 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-10-02 15:22:40 +0100 |
| commit | ad4ebc3decaa19fad2c00868e237561b6ac004c6 (patch) | |
| tree | 648aec700785ed3bfdaf1a04aec1033748cfee74 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 872383bd12e116fc79cb4487b1740c84f23c4c23 (diff) | |
KVM: arm64: Reject host access to protected VM private state
A protected vCPU's register and debug state is no longer exposed to
the host, and the host ioctls that would reach it fail instead:
- KVM_GET_ONE_REG and KVM_SET_ONE_REG return -EPERM once the vCPU has
run: the host copy then holds the boot state the VMM wrote plus
what the exit handlers copy out, which the VMM can't tell apart.
Pre-run access still builds the guest's boot state.
- KVM_ARM_VCPU_INIT returns -EPERM once the vCPU has run: it would
reset the host copy alone and rewrite mp_state, which EL2 reads
only at hyp vCPU creation, so a vCPU the guest powered off would
come back RUNNABLE.
- KVM_SET_VCPU_EVENTS rejects external-abort injection with -EPERM;
SError injection is forwarded and stays permitted.
- KVM_SET_GUEST_DEBUG returns -EPERM: a protected guest's debug state
is hypervisor-owned.
The KVM_{GET,SET}_ONE_REG and KVM_ARM_VCPU_INIT checks are one filter
on the ioctl number in kvm_arch_vcpu_ioctl(), the only caller of the
three functions they were in. Its -EPERM now precedes the cases'
-EFAULT and the ONE_REG case's pending-reset handling, which the next
KVM_RUN performs. The external-abort check reads the payload, and
KVM_SET_GUEST_DEBUG has its own case in kvm_vcpu_ioctl(), so it never
reaches kvm_arch_vcpu_ioctl(): those two stay in their handlers.
KVM_CHECK_EXTENSION returns 0 for KVM_CAP_ARM_INJECT_EXT_DABT and
KVM_CAP_SET_GUEST_DEBUG on a protected VM: kvm_pkvm_ext_allowed()
returns false on every capability it doesn't list, and the patch that
advertises the capabilities protected VMs support leaves these two
out. The two ioctl checks stay for a VMM that doesn't query
KVM_CHECK_EXTENSION.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
Link: https://patch.msgid.link/20261001135711.1640520-16-fuad.tabba@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
