Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MAP_ALIGNED_CHERI #2180

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Remove MAP_ALIGNED_CHERI #2180

merged 2 commits into from
Sep 13, 2024

Conversation

brooksdavis
Copy link
Member

This PR proposes to remove MAP_ALIGNED_CHERI and MAP_ALIGNED_CHERI_SEAL. I'm not 100% certain this is what I want to do, but I did it in an old branch where I was aiming to add capability PROT_ values and I'd like to do it or discard it.

The argument for removal is that a hybrid program needs to be aware of size rounding or it will either create aliasing violations or leak address space on munmap, thus adding MAP_ALIGN() macros isn't a big deal. Reservations could solve this, but I you probably need to opt all the way in to forcing representability on all allocations at which point it's a new ABI whose rules you need to follow. One could decide that MAP_ALIGNED_CHERI* triggers reservation roundup in which case at least the main one is useful. (I think sentries likely eliminate the possibility of separate sealing alignment in practice.)

There are no differences in alignment between regular and sealed
capabilities on current architectures and even if there were there
is little value in putting this support in the kernel where callers
who need to seal values returned by mmap() will be highly CHERI-aware.
Kernel reservation managment code takes care of alignment (and size)
rounding for CheriABI binaries.  Hybrid binaries that need CHERI
alignment can, and for length must, do their own rounding in code that
will already be CHERI-aware.
@bsdjhb
Copy link
Collaborator

bsdjhb commented Aug 6, 2024

I'm definitely fine with dropping the separate flag for sealing alignment (first commit). I'm probably fine with the second commit as well. I think it's probably fine if you are doing CHERI-aware hybrid userspace that you have to figure out the desired alignment and just use MAP_ALIGNED().

@brooksdavis brooksdavis changed the title Remove MAP_ALIGNED_CHERI (for discussion) Remove MAP_ALIGNED_CHERI Sep 12, 2024
@bsdjhb bsdjhb merged commit c3d7e5b into dev Sep 13, 2024
30 checks passed
@bsdjhb bsdjhb deleted the no-map-aligned-cheri branch September 13, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants