summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2021-03-25 16:47:57 -0700
committergVisor bot <gvisor-bot@google.com>2021-03-25 16:50:06 -0700
commit79bc446facf3d6920853c4cf35e72d25dd4c1011 (patch)
treec3ae98448b6f3171f1cf40dda50fcfcb91e1a71e /pkg
parent6b085ba47715a3e7283ec383c1ddf0f8b14dc60c (diff)
Lock TaskSet mutex for writing in ptraceClone().
This is necessary since ptraceClone() mutates tracer.ptraceTracees. PiperOrigin-RevId: 365152396
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/kernel/ptrace.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/kernel/ptrace.go b/pkg/sentry/kernel/ptrace.go
index c3980350a..f5a60e749 100644
--- a/pkg/sentry/kernel/ptrace.go
+++ b/pkg/sentry/kernel/ptrace.go
@@ -770,8 +770,8 @@ func (t *Task) ptraceClone(kind ptraceCloneKind, child *Task, opts *CloneOptions
if !t.hasTracer() {
return false
}
- t.tg.pidns.owner.mu.RLock()
- defer t.tg.pidns.owner.mu.RUnlock()
+ t.tg.pidns.owner.mu.Lock()
+ defer t.tg.pidns.owner.mu.Unlock()
event := false
if !opts.Untraced {
switch kind {