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

c18n: Improve detection of interrupted compartment #2220

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dpgao
Copy link
Contributor

@dpgao dpgao commented Sep 12, 2024

Previously, a bounds-check was missing for the tail-call scenario, which might result in reading from the stack table using an invalid index.

Also, the tail-call scenario cannot be ruled-out even when the presumptive callee's stack is not allocated---we might be interrupted when a tail-call is taking place and the callee's stack is unallocated.

Fix a bug where the dummy untrusted stack is not installed when a thread
launches.

Previously, the interrupted compartment is identified by checking
whether its untrusted stack is a subset of the canonical copy of that
stack. However, this subset relation should actually be inverted, that
is, the untrusted stack of the interrupted compartment should be a
superset of the canonical stack. Otherwise, a compartment which holds a
portion of another compartment's stack would be able to impersonate it.
(The SW_VMEM permission on the canonical stack has to be stripped before
the comparison.)

In addition, a bounds-check was missing for the tail-call scenario,
which might result in reading from the stack table using an invalid
index.

Also, the tail-call scenario cannot be ruled-out even when the
presumptive callee's stack is not allocated---we might be interrupted
when a tail-call is taking place _and_ the callee's stack is
unallocated.
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