diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-02-24 10:07:45 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-24 10:07:45 +0000 |
commit | a004d3309c5d8320408b4661940e6b0839eef69b (patch) | |
tree | a1295517d02e17401932b9f0db45523f5a475868 /pkg/sentry/syscalls | |
parent | 2b0d4ebbbaa18506fdba8988210fc0f2009ca379 (diff) | |
parent | acd516cfe2920006a5d2760c78bd2245d498023a (diff) |
Merge release-20210208.0-85-gacd516cfe (automated)
Diffstat (limited to 'pkg/sentry/syscalls')
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_prctl.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_prctl.go b/pkg/sentry/syscalls/linux/sys_prctl.go index a892d2c62..9890dd946 100644 --- a/pkg/sentry/syscalls/linux/sys_prctl.go +++ b/pkg/sentry/syscalls/linux/sys_prctl.go @@ -172,6 +172,24 @@ func Prctl(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Syscall } return 1, nil, nil + case linux.PR_SET_PTRACER: + pid := args[1].Int() + switch pid { + case 0: + t.ClearYAMAException() + return 0, nil, nil + case linux.PR_SET_PTRACER_ANY: + t.SetYAMAException(nil) + return 0, nil, nil + default: + tracer := t.PIDNamespace().TaskWithID(kernel.ThreadID(pid)) + if tracer == nil { + return 0, nil, syserror.EINVAL + } + t.SetYAMAException(tracer) + return 0, nil, nil + } + case linux.PR_SET_SECCOMP: if args[1].Int() != linux.SECCOMP_MODE_FILTER { // Unsupported mode. |