Skip to content

Conversation

@anmaxvl
Copy link
Contributor

@anmaxvl anmaxvl commented Nov 14, 2025

When implementing signal container process enforcement policy we introduced a bug, where instead of signalling just the container init process we ended up sending signals (SIGTERM or SIGKILL) to all processes running inside a container (by invoking runc kill --all).

container.Kill no longer sends signals to all container processes.

This results in an unpleasant behavior, where the init process could be handling (e.g. ignoring) SIGTERM, where as other processes inside container don't.

This PR makes a change to the order in which the signal container policy is enforced:

  • always call EnforceSignalContainerProcessPolicy before sending any signals. Otherwise, this looks like a bug, since we would never call EnforceSignalContainerProcessPolicy with signalingInitProcess == true for SIGTERM and SIGKILL and potentially bypassing policies, which do not allow SIGTERM or SIGKILL to be sent to the init process.
  • no longer call ShutdownContainer and instead revert back to calling process.Kill.

(cherry picked from commit 04735e0)

…icrosoft#2538)

When implementing signal container process enforcement policy we
introduced a bug, where instead of signalling just the container
init process we ended up sending signals (SIGTERM or SIGKILL) to
all processes running inside a container (by invoking `runc kill --all`).

`container.Kill` no longer sends signals to all container processes.

This results in an unpleasant behavior, where the init process
could be handling (e.g. ignoring) SIGTERM, where as other processes
inside container don't.

This PR makes a change to the order in which the signal container
policy is enforced:
  - always call `EnforceSignalContainerProcessPolicy` before sending
    any signals. Otherwise, this looks like a bug, since we would
    never call `EnforceSignalContainerProcessPolicy` with
    `signalingInitProcess == true` for `SIGTERM` and `SIGKILL` and
    potentially bypassing policies, which do not allow `SIGTERM` or
    `SIGKILL` to be sent to the init process.
  - no longer call `ShutdownContainer` and instead revert back to
    calling `process.Kill`.

Signed-off-by: Maksim An <[email protected]>
(cherry picked from commit 04735e0)
@anmaxvl anmaxvl requested a review from a team as a code owner November 14, 2025 17:56
@anmaxvl anmaxvl merged commit 63c600d into microsoft:ms/release/0.1 Nov 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants