Repository navigation
docs(sandbox): record the cgroup limits evaluation and defer it (#748) - #982
Merged
Merged
Conversation
Section 12.1 of docs/sandbox-design.md records what the rlimits bound, what cgroup v2 would add, where it is unavailable, the fail-closed shape it would need, its cost, why it is deferred and the condition to revisit.
…#748) Command consumers have no ledger line (warning and doctor only), jobs have no --die-with-parent and no caller-timeout bound, the CI and systemd-run claims are softened to what was verified, and the section 12 line about sizing /tmp now matches the code (the tmpfs is unsized).
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.
What
Adds docs/sandbox-design.md section 12.1: the evaluation of cgroup limits for the sandbox, with the decision to defer. Updates the other places that said "later work" (section 2.2, section 15) and fixes a pre-existing line in section 12 that said tole sizes
/tmp(it does not). No code change.Why
The last open sandbox item of #748 is "cgroup limits, only if cheap (deferred)". The evaluation says it is not cheap, so this records why and the exact condition to revisit, instead of leaving it implicit.
Changes
job_starttrees); how an unprivileged tole could get a cgroup v2 and where neither route is available; the fail-closed shape it would need under[sandbox.consumers](three-state rule, warning plustole doctorline like the other command consumers, never an implicit default); the cost; the verdict; revisit conditions; and what the sandbox still does not cover./tmpis sized.Testing
crates/tole-core/src/sandbox/command.rs(Limits defaults,die_with_parent, setrlimit between fork and exec),sandbox.rs(--tmpfs /tmp, no size),delegation/resource_guard.rs(cgroup v2 read-only parsing) and.github/workflows/ci.yml(sandbox-bwrapjob,sudo sysctl).cgroup2mounted read-only at/sys/fs/cgroup/unified,systemd-run --user --scope truefails with "Failed to connect to bus: No medium found", PID 1 not systemd. Not a claim about CI or other hosts.--die-with-parentnot applying to jobs, overstated CI and systemd claims, the section 12/tmpsizing line); all are fixed in the second commit.