mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix races in kernel.(*Task).Value()
PiperOrigin-RevId: 209627180 Change-Id: Idc84afd38003427e411df6e75abfabd9174174e1
This commit is contained in:
@@ -568,12 +568,18 @@ func (t *Task) Value(key interface{}) interface{} {
|
||||
case CtxPIDNamespace:
|
||||
return t.tg.pidns
|
||||
case CtxUTSNamespace:
|
||||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
return t.utsns
|
||||
case CtxIPCNamespace:
|
||||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
return t.ipcns
|
||||
case CtxTask:
|
||||
return t
|
||||
case auth.CtxCredentials:
|
||||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
return t.creds
|
||||
case context.CtxThreadGroupID:
|
||||
return int32(t.ThreadGroup().ID())
|
||||
|
||||
Reference in New Issue
Block a user