From f7855b28f0aa976b7b80778eac6b2b07510e8126 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 8 Sep 2022 14:35:37 -0700 Subject: [PATCH] kvm: don't call panic from signal handlers throw has to be used in such cases. PiperOrigin-RevId: 473087177 --- pkg/sentry/platform/kvm/machine.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sentry/platform/kvm/machine.go b/pkg/sentry/platform/kvm/machine.go index 8b4e2e985..4aad65cbf 100644 --- a/pkg/sentry/platform/kvm/machine.go +++ b/pkg/sentry/platform/kvm/machine.go @@ -380,13 +380,13 @@ func (m *machine) mapPhysical(physical, length uintptr, phyRegions []physicalReg _, physicalStart, length, pr := calculateBluepillFault(physical, phyRegions) if pr == nil { // Should never happen. - panic("mapPhysical on unknown physical address") + throw("mapPhysical on unknown physical address") } // Is this already mapped? Check the usedSlots. if !m.hasSlot(physicalStart) { if _, ok := handleBluepillFault(m, physical, phyRegions); !ok { - panic("handleBluepillFault failed") + throw("handleBluepillFault failed") } }