Add a capability LSM module and route capability checks through the security stack#2
Draft
zzj-5341 wants to merge 55 commits intolsm-framework-yamafrom
Draft
Add a capability LSM module and route capability checks through the security stack#2zzj-5341 wants to merge 55 commits intolsm-framework-yamafrom
zzj-5341 wants to merge 55 commits intolsm-framework-yamafrom
Conversation
e7ff475 to
1e4ba7f
Compare
5382d4d to
303d372
Compare
1e4ba7f to
c07b860
Compare
303d372 to
51dd817
Compare
c07b860 to
800f579
Compare
51dd817 to
8b8c1d3
Compare
800f579 to
24c1421
Compare
c1db361 to
a35c905
Compare
6ac5ec4 to
a5a4937
Compare
7313d3d to
dda1683
Compare
dda1683 to
fe4d8fd
Compare
6dce4f2 to
14d14a1
Compare
…merge # Conflicts: # kernel/src/process/execve.rs
50ef908 to
6961279
Compare
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.
Summary
This draft PR builds on top of the initial LSM framework and Yama migration and introduces capability authorization into the LSM stack.
The main goal is to stop open-coding capability checks across subsystems and instead route them through the security facade and the built-in LSM dispatch path.
After this change, the built-in LSM stack becomes:
capabilityas the major authorization moduleyamaas a minor ptrace restriction moduleWhat this PR changes
Add a built-in
capabilityLSM moduleThis PR introduces a dedicated capability module under
kernel/src/security/lsm/modules/capability.rs.The module provides capability-based authorization through the LSM framework instead of keeping the logic scattered across subsystem-local checks.
Extend the LSM framework for capability authorization
This PR expands the current framework with the hook surface needed by capability migration, including:
capablebprm_check_securitybprm_committed_credsinode_permissionfile_openinode_dac_overrideIt also adds the supporting context types and
CapabilityReasonso capability checks carry explicit semantic intent through the security layer.Route capability checks through the security facade
This PR migrates several existing authorization paths to the LSM-backed capability interface, including:
capsetexecvecommitted-creds hook plumbingUpdate security regression coverage
This PR updates the security regression entry so capability-related tests run through the new LSM-based path.
Why
The initial LSM framework PR establishes the dispatch structure and migrates one narrow policy module,
Yama.This follow-up moves capability authorization into that same structure, which makes the security model more coherent:
Validation
Validated in:
/home/zzj/asterinas-cap-lsm-upstream-stackedcodex/capability-after-lsm-yamaCommands used:
Result:
Scope of this draft
This draft intentionally focuses on:
capabilitymoduleIt intentionally does not include design documents or boot-only helper programs.
Follow-up work
CapabilityReasonmore deeply