mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-27 18:57:53 +00:00
getContainerNetworkInfo: lock netNsCtr before sync
`syncContainer()` requires the container to be locked, otherwise we can end up with undefined behavior. [NO TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
b957bff8b5
commit
ab5e770c4b
1 changed files with 4 additions and 0 deletions
|
|
@ -866,6 +866,10 @@ func (c *Container) getContainerNetworkInfo() (*define.InspectNetworkSettings, e
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// see https://github.com/containers/podman/issues/10090
|
||||
// the container has to be locked for syncContainer()
|
||||
netNsCtr.lock.Lock()
|
||||
defer netNsCtr.lock.Unlock()
|
||||
// Have to sync to ensure that state is populated
|
||||
if err := netNsCtr.syncContainer(); err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue