summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/task_signals.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-04-23 19:04:41 +0000
committergVisor bot <gvisor-bot@google.com>2020-04-23 19:04:41 +0000
commitb1c6986c5a31c7bc6d38d5988427707c7063dff7 (patch)
treeb59f2754cba1e6cde8572acb9ba83cdf63db4af5 /pkg/sentry/kernel/task_signals.go
parentc38bcae214be4ce3561785bb35ec66a70d15166f (diff)
parentded5c963ae5c2a5d37508f8d122031a2cd60d642 (diff)
Merge release-20200323.0-222-gded5c96 (automated)
Diffstat (limited to 'pkg/sentry/kernel/task_signals.go')
-rw-r--r--pkg/sentry/kernel/task_signals.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/task_signals.go b/pkg/sentry/kernel/task_signals.go
index f07de2089..7d25e98f7 100644
--- a/pkg/sentry/kernel/task_signals.go
+++ b/pkg/sentry/kernel/task_signals.go
@@ -263,6 +263,19 @@ func (t *Task) deliverSignalToHandler(info *arch.SignalInfo, act arch.SignalAct)
if t.haveSavedSignalMask {
mask = t.savedSignalMask
}
+
+ // Set up the restorer.
+ // x86-64 should always uses SA_RESTORER, but this flag is optional on other platforms.
+ // Please see the linux code as reference:
+ // linux/arch/x86/kernel/signal.c:__setup_rt_frame()
+ // If SA_RESTORER is not configured, we can use the sigreturn trampolines
+ // the vdso provides instead.
+ // Please see the linux code as reference:
+ // linux/arch/arm64/kernel/signal.c:setup_return()
+ if act.Flags&linux.SA_RESTORER == 0 {
+ act.Restorer = t.MemoryManager().VDSOSigReturn()
+ }
+
if err := t.Arch().SignalSetup(st, &act, info, &alt, mask); err != nil {
return err
}