contain: add core scheduling support (PR_SCHED_CORE)#271
Merged
Conversation
Adds --use_core_scheduling proto flag that calls prctl(PR_SCHED_CORE_CREATE) in the child process, giving each jail its own SMT scheduling group. Prevents sharing a physical core with other tenants and mitigates L1TF/MDS side-channel attacks in multi-tenant environments. Requires Linux >= 5.14; guarded with #ifdef PR_SCHED_CORE for compatibility with older kernel headers.
Collaborator
|
Thank you, great! |
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.
Closes #198
Adds
--use_core_schedulingflag that callsprctl(PR_SCHED_CORE_CREATE)in the child process, giving each jail itsown SMT scheduling group. This prevents a jailed process from sharing a physical CPU core with processes outside the
jail, mitigating L1TF/MDS side-channel attacks in multi-tenant environments.
Changes:
config.proto: newuse_core_schedulingbool field (field 101)cmdline.cc:--use_core_schedulingCLI flag; included in startup log vialogParams()contain.cc:containCoreSched(), called aftercontainDropPrivs()—PR_SCHED_CORE_CREATEdoes not requirecapabilities
missing_defs.h: fallback defines forPR_SCHED_CORE/PR_SCHED_CORE_CREATE/PR_SCHED_CORE_SCOPE_THREAD_GROUPfor builds against older kernel headers
README.md: flag documented in the security options sectionRequires Linux kernel >= 5.14. Disabled by default; no behavior change for existing configs.