Repository navigation
Conversation
net_cls is a cgroup v1 controller and cgroup2.cc has no net_cls handling. With use_cgroupv2 (or detect_cgroupv2 on a v2 host) and cgroup_net_cls_classid set, nsjail started the jail without any error or warning and never applied the class id. Refuse to start instead, right after the cgroup version is known. The README listed net_cls under "v1 and v2"; correct that. The new run_test cases use tests/cgroupv2, an empty stub cgroup root, so they do not depend on the host's cgroups. Before: nsjail -Mo --use_cgroupv2 --cgroup_net_cls_classid 5 -- /bin/true exits 0 with no message about the class id. After: it exits 255 with "cgroup_net_cls_classid is not supported with cgroup v2". The v1 path and cgroup v2 without a class id behave as before.
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.
With
--use_cgroupv2(or--detect_cgroupv2on a v2 host) and--cgroup_net_cls_classidset, nsjail starts the jail without an error or a warning and never applies the class id, because net_cls is a cgroup v1 controller and cgroup2.cc has no handling for it.This refuses to start in that case, right after the cgroup version is known, and corrects the README line that listed net_cls under v1 and v2. If you would rather have a warning, I am happy to switch.
The new
run_testcases use an empty stub cgroup root; the one with a class id exits 255 with this change and 0 without it.