]> git.baikalelectronics.ru Git - kernel.git/commit
arm64/kvm: hide ptrauth from guests
authorMark Rutland <mark.rutland@arm.com>
Fri, 7 Dec 2018 18:39:22 +0000 (18:39 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 13 Dec 2018 16:42:46 +0000 (16:42 +0000)
commita0b7869dd8cf6706a9d6186a2f856dea91d358e4
tree08dc11ae155959ae0a33d5980381c901e4a24981
parent5b3cb9b29c9408915672510199ab00f9e4f78494
arm64/kvm: hide ptrauth from guests

In subsequent patches we're going to expose ptrauth to the host kernel
and userspace, but things are a bit trickier for guest kernels. For the
time being, let's hide ptrauth from KVM guests.

Regardless of how well-behaved the guest kernel is, guest userspace
could attempt to use ptrauth instructions, triggering a trap to EL2,
resulting in noise from kvm_handle_unknown_ec(). So let's write up a
handler for the PAC trap, which silently injects an UNDEF into the
guest, as if the feature were really missing.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Christoffer Dall <christoffer.dall@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: kvmarm@lists.cs.columbia.edu
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kvm/handle_exit.c
arch/arm64/kvm/sys_regs.c