summaryrefslogtreecommitdiffhomepage
path: root/pkg/safecopy/safecopy.go
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-03-30 12:36:30 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-30 12:37:57 -0700
commit3fac85da951f9f56d0232718ea7584250cf11f31 (patch)
treeaef282ad8f9dda532fb7d629d6d4aa58ab5e7487 /pkg/safecopy/safecopy.go
parent4aee3706406d6b102540ad5bea272b7c893da827 (diff)
kvm: handle exit reasons even under EINTR.
In the case of other signals (preemption), inject a normal bounce and defer the signal until the vCPU has been returned from guest mode. PiperOrigin-RevId: 303799678
Diffstat (limited to 'pkg/safecopy/safecopy.go')
-rw-r--r--pkg/safecopy/safecopy.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/safecopy/safecopy.go b/pkg/safecopy/safecopy.go
index 2fb7e5809..521f1a82d 100644
--- a/pkg/safecopy/safecopy.go
+++ b/pkg/safecopy/safecopy.go
@@ -127,10 +127,10 @@ func initializeAddresses() {
func init() {
initializeAddresses()
- if err := ReplaceSignalHandler(syscall.SIGSEGV, reflect.ValueOf(signalHandler).Pointer(), &savedSigSegVHandler); err != nil {
+ if err := ReplaceSignalHandler(syscall.SIGSEGV, reflect.ValueOf(signalHandler).Pointer(), &savedSigSegVHandler, 0); err != nil {
panic(fmt.Sprintf("Unable to set handler for SIGSEGV: %v", err))
}
- if err := ReplaceSignalHandler(syscall.SIGBUS, reflect.ValueOf(signalHandler).Pointer(), &savedSigBusHandler); err != nil {
+ if err := ReplaceSignalHandler(syscall.SIGBUS, reflect.ValueOf(signalHandler).Pointer(), &savedSigBusHandler, 0); err != nil {
panic(fmt.Sprintf("Unable to set handler for SIGBUS: %v", err))
}
syserror.AddErrorUnwrapper(func(e error) (syscall.Errno, bool) {