-
Notifications
You must be signed in to change notification settings - Fork 113
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
Introduce AAL StrictProvenance flag, factor CDLList #193
Conversation
My intent with this code for CHERI was that the CdLLNode* next, prev
Ptrdiff_t to_next
Do you think that doesn't work? Or did my comments not imply that to you? The comments are probably only sufficient for me to remember what I was thinking. |
Perhaps I'm missing something, but it looks as if this is used only for finding things inside a metaslab and is called only by the metaslab. Would it be possible instead to restructure this code so that we always passed a capability to the metaslab into the address calculations and did the offsetting relative to that? |
@davidchisnall, this a doubly linked list of slabs, but they can be in different superslabs, i.e. anywhere in memory. You would need to pass an all superslabs' metadata permissions. Which doesn't exist. |
That makes sense, thanks. |
@mjp41 Ah! I took that to be "will need a real next pointer [in addition to the prev pointer]" not "[in addition to the to_next field]". But: since the |
I think this passes |
Okay. Fair point re: min allocation size. Happy with your choice. We can always revisit. This is the second fastest path for allocation. So does occur reasonably often. Re-running the CI to see what happened. |
I think CI is unhappy as you are not against the latest commit. I think the merge commit is not the value it thinks it should be so the line
The
I think this should fix the error. I would sooner it be in a separate PR, but testing is easy with your current situation. |
As per discussion in microsoft#193
Choose between implementations based on aal's requirement of strict provenance.
aae71e0
to
12111ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CHERI will assert StrictProvenance (probably via AAL Mixin) and we can gate on that everywhere we need.
One such example is the contents of the CDDList nodes, where on non-StrictProvenance architectures, a relative encoding of the next pointer allows for tolerance of zero-initialized (and not constructed) values. For StrictProvenance, point explicitly at the next element but accept
nullptr
in lieu ofthis
as the empty case.With these (atop the other PRs I have open), we're back to being able to at least minimally run
snmalloc
on CHERI, but without capability bounds being enforced (that is, all pointers returned always authorize access to the entire underlying large allocation). Still, it's nice to be doing this in a way of which upstream approves, this time. :)