From c4caccd54042ea80a6e8b5a8f5ce59ee87a7f424 Mon Sep 17 00:00:00 2001 From: Jamie Liu Date: Tue, 2 Apr 2019 18:12:11 -0700 Subject: Set options on the correct Task in PTRACE_SEIZE. $ docker run --rm --runtime=runsc -it --cap-add=SYS_PTRACE debian bash -c "apt-get update && apt-get install strace && strace ls" ... Setting up strace (4.15-2) ... execve("/bin/ls", ["ls"], [/* 6 vars */]) = 0 brk(NULL) = 0x5646d8c1e000 uname({sysname="Linux", nodename="114ef93d2db3", ...}) = 0 ... PiperOrigin-RevId: 241643321 Change-Id: Ie4bce27a7fb147eef07bbae5895c6ef3f529e177 --- pkg/sentry/kernel/ptrace.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/sentry/kernel') diff --git a/pkg/sentry/kernel/ptrace.go b/pkg/sentry/kernel/ptrace.go index e8043bf8a..8d78b2fb3 100644 --- a/pkg/sentry/kernel/ptrace.go +++ b/pkg/sentry/kernel/ptrace.go @@ -374,7 +374,7 @@ func (t *Task) ptraceAttach(target *Task, seize bool, opts uintptr) error { return syserror.EPERM } if seize { - if err := t.ptraceSetOptionsLocked(opts); err != nil { + if err := target.ptraceSetOptionsLocked(opts); err != nil { return syserror.EIO } } -- cgit v1.2.3