Repository navigation
Fix two defects in the runc launch path - #941
Merged
Merged
Conversation
`runc kill` exits 1 with "container not running" once the init process has exited, and RuncProcess.kill propagated that. CRI requires StopContainer to succeed on an already-stopped container, so every teardown after a normal exit failed: containerd could not reap the task and sandboxes could not be removed. RuncExecProcess.kill and RuncProcess.resize already return early on .exited; only the container init path omitted the guard. Separately, an OCI runtime refuses a `net.*` sysctl unless the container's spec owns a network namespace. Pod containers never do — they share the VM's, which is how they reach the pod's address — so `runc create` failed with `sysctl "net.ipv4.ip_local_port_range" not allowed in host network namespace` and the container never started, while vmexec applied the same key by writing /proc/sys. That check guards a shared kernel; in a VM the guest kernel is the pod's, so a pod-level net.* sysctl is pod-scoped. ManagedContainer now applies those keys itself and hands the runtime only the remainder, which is ipc- or uts-namespaced and therefore accepted. net.ipv4.ip_local_port_range, tcp_syncookies, ping_group_range and ip_unprivileged_port_start are four of Kubernetes' six safe sysctls, allowed with no node configuration, so this affected pods that opted into nothing. Signed-off-by: michael_crosby <michael_crosby@apple.com>
adityaramani
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
runc killexits 1 with "container not running" once the init process has exited, and RuncProcess.kill propagated that. CRI requires StopContainer to succeed on an already-stopped container, so every teardown after a normal exit failed: containerd could not reap the task and sandboxes could not be removed. RuncExecProcess.kill and RuncProcess.resize already return early on .exited; only the container init path omitted the guard.Separately, an OCI runtime refuses a
net.*sysctl unless the container's spec owns a network namespace. Pod containers never do — they share the VM's, which is how they reach the pod's address — sorunc createfailed withsysctl "net.ipv4.ip_local_port_range" not allowed in host network namespaceand the container never started, while vmexec applied the same key by writing /proc/sys. That check guards a shared kernel; in a VM the guest kernel is the pod's, so a pod-level net.* sysctl is pod-scoped. ManagedContainer now applies those keys itself and hands the runtime only the remainder, which is ipc- or uts-namespaced and therefore accepted. net.ipv4.ip_local_port_range, tcp_syncookies, ping_group_range and ip_unprivileged_port_start are four of Kubernetes' six safe sysctls, allowed with no node configuration, so this affected pods that opted into nothing.