Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change limiting the non-dumpable restriction to joining existing namespaces.
No open issues 🎉
What changed in this PR
This PR addresses #3649 by limiting when container creation marks the process non-dumpable: only when joining an existing namespace, rather than whenever namespace configuration is present.
Changes:
- Adds
joins_existing_namespacesto detect namespace entries with a path. - Uses the helper to guard
prctl::set_dumpable(false), avoiding the restriction when only creating new namespaces. - Adds unit tests for absent namespaces, new namespaces, and an existing namespace.
| File | Description |
|---|---|
crates/libcontainer/src/container/builder_impl.rs |
Narrows the non-dumpable condition and adds helper tests. |
Review effort: Balanced
…-dumpable only breaks things like rootless containers. Signed-off-by: Proorocu Eric <proorocueric@gmail.com>
This branch has not been deployed
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.
Description
youki made the container process non-dumpable whenever
linux.namespaceswas set, which in practice is almost every container. if we only create new namespaces, the security context doesn't change, and non-dumpable only breaks things like rootless containers.This PR adds a small helper,joins_existing_namespaces, which returns true only if at least one namespace in the spec has a path, and uses it as the condition forprctl::set_dumpable(false), like runc does.Type of Change
Testing
Added unit tests for the helper: no namespaces, only new namespaces, and at least one namespace with a path.
Related Issues
Fixes #3649
Additional Context
This is my first contribution to youki, feedback is very welcome.