From d7ea53769f4bfffdb836f53a0e0709d0607c2c4c Mon Sep 17 00:00:00 2001 From: Howard Zhang Date: Tue, 20 Oct 2020 13:32:36 +0800 Subject: ARM64 KVM: bad regs.Sp return SIGSEGV Consistent with the linux kernel, bad regs.Sp return SIGSEGV Signed-off-by: Howard Zhang --- pkg/sentry/platform/kvm/machine_arm64_unsafe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/sentry/platform') diff --git a/pkg/sentry/platform/kvm/machine_arm64_unsafe.go b/pkg/sentry/platform/kvm/machine_arm64_unsafe.go index a163f956d..f59d37bd2 100644 --- a/pkg/sentry/platform/kvm/machine_arm64_unsafe.go +++ b/pkg/sentry/platform/kvm/machine_arm64_unsafe.go @@ -197,7 +197,7 @@ func (c *vCPU) SwitchToUser(switchOpts ring0.SwitchOpts, info *arch.SignalInfo) if regs := switchOpts.Registers; !ring0.IsCanonical(regs.Pc) { return nonCanonical(regs.Pc, int32(syscall.SIGSEGV), info) } else if !ring0.IsCanonical(regs.Sp) { - return nonCanonical(regs.Sp, int32(syscall.SIGBUS), info) + return nonCanonical(regs.Sp, int32(syscall.SIGSEGV), info) } // Assign PCIDs. -- cgit v1.2.3