]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Detect and handle hypervisor stack overflows
authorKalesh Singh <kaleshsingh@google.com>
Wed, 20 Apr 2022 21:42:56 +0000 (14:42 -0700)
committerMarc Zyngier <maz@kernel.org>
Thu, 28 Apr 2022 19:53:13 +0000 (20:53 +0100)
commitf2d793993f827411a7aee0ccb9e3c79071dbf977
treee48f84b936a6cd584013bd9a2c14f077d93cc08f
parent38e0eca692efeae76b696e6785d8127a58a01b0c
KVM: arm64: Detect and handle hypervisor stack overflows

The hypervisor stacks (for both nVHE Hyp mode and nVHE protected mode)
are aligned such  that any valid stack address has PAGE_SHIFT bit as 1.
This allows us to conveniently check for overflow in the exception entry
without corrupting any GPRs. We won't recover from a stack overflow so
panic the hypervisor.

Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220420214317.3303360-6-kaleshsingh@google.com
arch/arm64/kvm/hyp/nvhe/host.S
arch/arm64/kvm/hyp/nvhe/switch.c