Lock TaskSet mutex for writing in ptraceClone().

This is necessary since ptraceClone() mutates tracer.ptraceTracees.

PiperOrigin-RevId: 365152396
This commit is contained in:
Jamie Liu
2021-03-25 16:50:06 -07:00
committed by gVisor bot
parent 6b085ba477
commit 79bc446fac
+2 -2
View File
@@ -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 {