Conversation
4d081df to
e4dcfc1
Compare
brooksdavis
approved these changes
Feb 20, 2026
Member
brooksdavis
left a comment
There was a problem hiding this comment.
Other than the too-long lines in the arm64 vm_map_prot2perms implementation I think this is good.
brooksdavis
reviewed
Feb 20, 2026
brooksdavis
reviewed
Feb 20, 2026
Member
brooksdavis
left a comment
There was a problem hiding this comment.
Sorry, one more comment. I wonder if vm_map_prot2perms should be vm_prot2perms now that it's no longer in vm_map.c.
Contributor
Author
Yeah I have a similar feeling that the name / placement may not be entirely right. I considered also moving it to vm_machdep, but given that it is a cheri-specific thing perhaps it fits well in cheri_machdep. |
e4dcfc1 to
aaa407c
Compare
brooksdavis
reviewed
Feb 20, 2026
Remove the definition indirection via CHERI_PERMS_PROT2PERM_*; instead, make vm_map_prot2perms fully machine-dependent. Since vm_map_prot2perms is no longer in vm_map.c, rename it to vm_prot2perms. Add a base_perms argument to vm_prot2perms. This removes the direct use of CHERI_PROT2PERM_MASK and makes it clearer that the permission mask is inherited from a base permission bitmask that is altered according to VM_PROT_*. Add a CHERI_PERMS_RWX_MASK macro that serves a similar function as CHERI_PROT2PERMS_MASK, but this is more general. This is useful to clearly separate the permission bits that the system implicitly ties to RWX memory access from the permission bits that are part of other mechanisms, such as c18n, sealing, etc. Note that this serves a different purpose from the existing USER/KERNEL permission bit macros.
This prevents issuing PERM_SYSCALL for data capabilities.
aaa407c to
a06560c
Compare
brooksdavis
approved these changes
Feb 23, 2026
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.
This should simplify the handling of prot2perm in a few ways:
#definelayers otherwise.base_permsargument tovm_map_prot2permso that it is clearer that the permissions are being "inherited" from a base bitmask and modified according to VM_PROT.Currently this places vm_map_prot2perms in cheri_machdep.c, it is unclear to me whether this is the right place. It may also make sense to rename it to something else.