Skip to content

Commit

Permalink
kill all processes in container with shared PID Ns
Browse files Browse the repository at this point in the history
Signed-off-by: lifubang <[email protected]>
  • Loading branch information
lifubang committed Oct 2, 2023
1 parent ee45b9b commit ccfd894
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libcontainer/container_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ func (c *Container) Signal(s os.Signal) error {
// To avoid a PID reuse attack, don't kill non-running container.
switch status {
case Running, Created, Paused:
case Stopped:
// if PID namespace is shared, we should send signal to other processes.
if !c.cgroupManager.Exists() {
return nil
}
default:
return ErrNotRunning
}
Expand Down

0 comments on commit ccfd894

Please sign in to comment.