Skip to content

Add --enable-nsdelegate flag to mount cgroups2 with nsdelegate option #682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emirbuljubasic
Copy link

This patch introduces a new flag, --enable-nsdelegate, in the lxcfs project.
When specified, the flag makes the __cg_mount_direct function use the "nsdelegate"
mount option when mounting a cgroup2 filesystem. This helps to properly delegate
cgroup namespace control to the container, as required in some configurations.

The change was tested to ensure that when the flag is enabled, the cgroup mount
includes "nsdelegate", and when it is not enabled, the original behaviour is preserved.

Fixes #681

@emirbuljubasic emirbuljubasic force-pushed the feature/cgroup-nsdelegate branch from 85d8cee to 85614ea Compare April 8, 2025 19:06
@stgraber
Copy link
Member

stgraber commented Apr 8, 2025

LGTM but I'll let @mihalicyn take a look as he's more familiar with how we handle arguments between the daemon and library and potential fun with updates and the like.

@stgraber stgraber requested a review from mihalicyn April 8, 2025 19:10
@emirbuljubasic
Copy link
Author

Hey @mihalicyn any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

User is able to modify cgroup resources inside the container - /sys/fs/cgroup/
2 participants