mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Synchronize the call to linuxContainer.Signal()
linuxContainer.Signal() can race with another call to say Destroy() which clears the container's initProcess. This can cause a nil pointer dereference in Signal(). This patch will synchronize Signal() and Destroy() by grabbing the container's mutex as part of the Signal() call. Signed-off-by: Pradyumna Agrawal <pradyumnaa@vmware.com>
This commit is contained in:
@@ -379,6 +379,8 @@ func (c *linuxContainer) start(process *Process) error {
|
||||
}
|
||||
|
||||
func (c *linuxContainer) Signal(s os.Signal, all bool) error {
|
||||
c.m.Lock()
|
||||
defer c.m.Unlock()
|
||||
if all {
|
||||
return signalAllProcesses(c.cgroupManager, s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user