vminitd: make the runc-backed launch path work, and add a default sec… - #926
Open
crosbymichael wants to merge 1 commit into
Open
crosbymichael wants to merge 1 commit into
crosbymichael wants to merge 1 commit into
Conversation
crosbymichael
force-pushed
the
cz-runc-over-vmexec
branch
from
September 16, 2026 15:14
a583b05 to
f1b62e7
Compare
…comp profile `LinuxContainer.Configuration.ociRuntimePath` has existed on main for some time and looks complete: the field is plumbed through the proto, and `ManagedContainer` already branched on it to build a `RuncProcess`. It has never worked. Nothing ever placed a runc binary inside the guest, and once one is there, `runc create` deadlocks on its own output capture before any container starts. This makes it work, and then uses it for what it is for: runc implements seccomp and the advanced LSMs, so they do not have to be reimplemented in Swift. A pure-Swift seccomp compiler was evaluated and abandoned; delegating to runc is the alternative. Signed-off-by: michael_crosby <michael_crosby@apple.com>
crosbymichael
force-pushed
the
cz-runc-over-vmexec
branch
from
September 16, 2026 15:55
f1b62e7 to
f4d51aa
Compare
| /// read `spec.linux.seccomp`, so such a container would run unfiltered | ||
| /// while every observable said it was sandboxed. | ||
| private static func requireOCIRuntimeForSeccomp(_ configuration: Configuration) throws { | ||
| guard configuration.ociRuntimePath != nil else { |
Contributor
There was a problem hiding this comment.
if someone specified ociRuntimePath = /sbin/vmexec this would not throw but the seccomps would still not be supported right?
| /// ``Configuration/ociRuntimePath`` is set. Runs at mount-assembly time, so | ||
| /// the order a configuration closure sets its properties in doesn't matter. | ||
| private func mountsForRuntime() -> [Mount] { | ||
| guard self.config.ociRuntimePath != nil else { |
Contributor
There was a problem hiding this comment.
similar as above? Should the check be if ! vmexec
| /// | ||
| /// Class-bound so owners can track a process by identity: `pid` is `nil` before | ||
| /// start and, for the runc implementations, `nil` again after exit. | ||
| protocol ContainerProcess: AnyObject, Sendable { |
Contributor
There was a problem hiding this comment.
Why do we need AnyObject?
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.
…comp profile
LinuxContainer.Configuration.ociRuntimePathhas existed on main for some time and looks complete: the field is plumbed through the proto, andManagedContaineralready branched on it to build aRuncProcess. It has never worked. Nothing ever placed a runc binary inside the guest, and once one is there,runc createdeadlocks on its own output capture before any container starts.This makes it work, and then uses it for what it is for: runc implements seccomp and the advanced LSMs, so they do not have to be reimplemented in Swift. A pure-Swift seccomp compiler was evaluated and abandoned; delegating to runc is the alternative.