Skip to content

Only set non-dumpable when joining existing namespaces. - #3946

Open
Eric5342 wants to merge 1 commit into
youki-dev:mainfrom
Eric5342:fix-3649
Open

Eric5342 wants to merge 1 commit into
youki-dev:mainfrom
Eric5342:fix-3649

Conversation

@Eric5342

Copy link
Copy Markdown

Description

youki made the container process non-dumpable whenever linux.namespaces was 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 for prctl::set_dumpable(false), like runc does.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)
    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.

@saku3
saku3 requested a balanced review from Copilot November 28, 2026 20:06
@saku3 saku3 added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Nov 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_namespaces to 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Whether the dumpable setting is appropriate

3 participants