mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: Fix map access race in boot.Loader.waitContainer.
PiperOrigin-RevId: 204522004 Change-Id: I4819dc025f0a1df03ceaaba7951b1902d44562b3
This commit is contained in:
committed by
Shentubot
parent
6dce46d4c0
commit
9059983fdb
@@ -499,10 +499,12 @@ func (l *Loader) waitContainer(cid string, waitStatus *uint32) error {
|
||||
// multiple clients to wait on the same container.
|
||||
l.mu.Lock()
|
||||
tgid, ok := l.containerRootTGIDs[cid]
|
||||
l.mu.Unlock()
|
||||
if !ok {
|
||||
defer l.mu.Unlock()
|
||||
return fmt.Errorf("can't find process for container %q in %v", cid, l.containerRootTGIDs)
|
||||
}
|
||||
l.mu.Unlock()
|
||||
|
||||
// If the thread either has already exited or exits during waiting,
|
||||
// consider the container exited.
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user