On Tue, Jun 16, 2020 at 03:15:02PM +0100, Marc Zyngier wrote:
commit ef3e40a7ea8dbe2abd0a345032cd7d5023b9684f upstream
When using the PtrAuth feature in a guest, we need to save the host's keys before allowing the guest to program them. For that, we dump them in a per-CPU data structure (the so called host context).
But both call sites that do this are in preemptible context, which may end up in disaster should the vcpu thread get preempted before reentering the guest.
Instead, save the keys eagerly on each vcpu_load(). This has an increased overhead, but is at least safe.
Cc: stable@vger.kernel.org Reviewed-by: Mark Rutland mark.rutland@arm.com Signed-off-by: Marc Zyngier maz@kernel.org
arch/arm/include/asm/kvm_emulate.h | 3 ++- arch/arm64/include/asm/kvm_emulate.h | 6 ------ arch/arm64/kvm/handle_exit.c | 19 ++----------------- virt/kvm/arm/arm.c | 22 +++++++++++++++++++++- 4 files changed, 25 insertions(+), 25 deletions(-)
Both now queued up, thanks.
greg k-h