summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2015-10-12 15:04:50 +0100
committerChristoffer Dall <christoffer.dall@linaro.org>2015-10-22 23:01:48 +0200
commitdb85c55f1b01b155332058753854d897e965d67f (patch)
treee616efde6be718d48c2c1cb0ee9c7a4bf44f503f /virt/kvm/arm
parente21f09108754dfdfbb30e547f4edbd3b6884eedb (diff)
downloadop-kernel-dev-db85c55f1b01b155332058753854d897e965d67f.zip
op-kernel-dev-db85c55f1b01b155332058753854d897e965d67f.tar.gz
arm64: kvm: restore EL1N SP for panic
If we panic in hyp mode, we inject a call to panic() into the EL1N host kernel. If a guest context is active, we first attempt to restore the minimal amount of state necessary to execute the host kernel with restore_sysregs. However, the SP is restored as part of restore_common_regs, and so we may return to the host's panic() function with the SP of the guest. Any calculations based on the SP will be bogus, and any attempt to access the stack will result in recursive data aborts. When running Linux as a guest, the guest's EL1N SP is like to be some valid kernel address. In this case, the host kernel may use that region as a stack for panic(), corrupting it in the process. Avoid the problem by restoring the host SP prior to returning to the host. To prevent misleading backtraces in the host, the FP is zeroed at the same time. We don't need any of the other "common" registers in order to panic successfully. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Cc: Christoffer Dall <christoffer.dall@linaro.org> Cc: <kvmarm@lists.cs.columbia.edu> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt/kvm/arm')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud