summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/platform/ptrace/subprocess_arm64.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2020-01-06 15:53:21 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-06 15:54:53 -0800
commit17c18241cdeb66e75738c3892730f1a434a4bd60 (patch)
treeba647bf74ba238a0e0c73763d3d480d7fefe4745 /pkg/sentry/platform/ptrace/subprocess_arm64.go
parent51f3ab85e024fcd74c49d273ce5202a207577d31 (diff)
platform/syscall: use syscall + int3 to execute a system call in a stub process
Right now, we need to call ptrace(PTRACE_SYSCALL) and wait() twice to execute one system call in a stub process. With these changes, we will need to call ptrace + wait only once. In addition, this allows to workaround the kernel bug when a stub process doesn't stop on syscall-exit-stop and starts executing the next system call. Reported-by: syzbot+37143cafa8dc3b5008ee@syzkaller.appspotmail.com PiperOrigin-RevId: 288393029
Diffstat (limited to 'pkg/sentry/platform/ptrace/subprocess_arm64.go')
-rw-r--r--pkg/sentry/platform/ptrace/subprocess_arm64.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/sentry/platform/ptrace/subprocess_arm64.go b/pkg/sentry/platform/ptrace/subprocess_arm64.go
index 62a686ee7..7b975137f 100644
--- a/pkg/sentry/platform/ptrace/subprocess_arm64.go
+++ b/pkg/sentry/platform/ptrace/subprocess_arm64.go
@@ -127,6 +127,8 @@ func (t *thread) adjustInitRegsRip() {
// Pass the expected PPID to the child via X7 when creating stub process
func initChildProcessPPID(initregs *syscall.PtraceRegs, ppid int32) {
initregs.Regs[7] = uint64(ppid)
+ // R9 has to be set to 1 when creating stub process.
+ initregs.Regs[9] = 1
}
// patchSignalInfo patches the signal info to account for hitting the seccomp