-
Notifications
You must be signed in to change notification settings - Fork 13
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
DDC switching API #45
Comments
The first example & surrounding paragraphs look a little confused. Did some thing get renamed? I think I got the gist, though. My first impression is that the proposed "compartment" is a compartmentalisation of data only (i.e. DDC not PCC). This is stated explicitly in the first line, but it's also why
The result could be called with an invoke-like mechanism (e.g. Morello's Also, how can I call from |
I think I just did things too quickly! Hopefully they look more like prototypes now!
Yes, this is definitely true. I'm not sure that we need PCC compartmentalisation quite yet and, if we do, I'm not sure the best way to do it, though your suggestion seems like a reasonable one!
That depends entirely on whether you pass the right sealed capability to the other compartment: if you do, that other compartment can call another compartment. But, by default, I think it's simple (and most secure) to disallow one compartment from calling another. I think that's what you mean by "It can be permitted by sealing an {f1, comp2} pair and passing that to comp2"? |
#44 is our first attempt to write a DDC-altering compartmentalisation scheme. We're trying to keep that PR simple, so it doesn't do everything we think we want. This issue is a quick attempt to sketch out a more powerful (and secure) API. This won't be complete, but it might help us think about where we want to go.
I think the basic C API for a data-only compartmentalisation scheme might look something like:
where the
compartment_*
functions must (I think) be sentries that can access any compartment created by them. My assumption is that the compartments returned bycompartment_malloc
are sealed so that a caller can't do anything with them other than callcompartment_call
(andcompartment_call
can carefully validate the capability!). An interesting question is whetherf
has to be passedheap
-- I guess it could recreate it from the DDC but that seems horrible. One will also needcompartment_free
and probablycompartment_realloc
: both seem easy enough not to need sketching out.To use this API in a basic way, I would do something like:
This would create two compartments and then call
f
in the context ofcomp1
and then callf
in the context ofcomp2
.I can pass compartments around and call one compartment from another:
In terms of the underlying memory layout, my assumption is that
compartment_malloc
allocatesize+<something>
bytes wheresomething
is enough to hold the new call stack that the compartment will need. There are some slightly tricky questions to think about like: where should the stack go (before or after the compartments main data?) and how does that affect things like resizing a compartment (should we actually pre-allocate huge virtual address ranges to a compartment in the expectation that it will grow?). At least at first I don't think we need to worry about those considerations and, hopefully, they mostly wouldn't leak out into our API either.The text was updated successfully, but these errors were encountered: