diff options
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/platform/ptrace/ptrace_unsafe.go | 6 | ||||
-rw-r--r-- | pkg/sentry/platform/ptrace/subprocess.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/sentry/platform/ptrace/ptrace_unsafe.go b/pkg/sentry/platform/ptrace/ptrace_unsafe.go index 7a3cb8f49..223b23199 100644 --- a/pkg/sentry/platform/ptrace/ptrace_unsafe.go +++ b/pkg/sentry/platform/ptrace/ptrace_unsafe.go @@ -130,8 +130,8 @@ func (t *thread) getSignalInfo(si *arch.SignalInfo) error { // call attach on it. // // Precondition: the OS thread must be locked and own t. -func (t *thread) clone(initRegs *syscall.PtraceRegs) (*thread, error) { - r, ok := usermem.Addr(initRegs.Rsp).RoundUp() +func (t *thread) clone() (*thread, error) { + r, ok := usermem.Addr(t.initRegs.Rsp).RoundUp() if !ok { return nil, syscall.EINVAL } @@ -153,7 +153,7 @@ func (t *thread) clone(initRegs *syscall.PtraceRegs) (*thread, error) { arch.SyscallArgument{}, // We use these registers initially, but really they // could be anything. We're going to stop immediately. - arch.SyscallArgument{Value: uintptr(unsafe.Pointer(initRegs))}) + arch.SyscallArgument{Value: uintptr(unsafe.Pointer(&t.initRegs))}) if err != nil { return nil, err } diff --git a/pkg/sentry/platform/ptrace/subprocess.go b/pkg/sentry/platform/ptrace/subprocess.go index 2cd49d1ec..5e56a1514 100644 --- a/pkg/sentry/platform/ptrace/subprocess.go +++ b/pkg/sentry/platform/ptrace/subprocess.go @@ -160,7 +160,7 @@ func newSubprocess(create func() (*thread, error)) (*subprocess, error) { // Wait for requests to create threads. for r := range requests { - t, err := firstThread.clone(&firstThread.initRegs) + t, err := firstThread.clone() if err != nil { // Should not happen: not recoverable. panic(fmt.Sprintf("error initializing first thread: %v", err)) |