-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switcher: faults in cross-call spill return error
Don't forcibly unwind if the invoker has exhausted its stack, just return an error. Certain other "unlikely to work well" scenarios (such as stripping store permission from csp before invoking the switcher) can also trigger this "just an error" logic. However, the defenses against invoking the callee with a bad stack remain and will catch things like "stripping capability handling permission from csp". Add a test to ensure that this is what happens. In terms of implementation, this causes the trap handler (exception_entry_asm) to `mret` to a `cjalr ra` (`cret`) instruction at the end of the switcher function while clobbering only caller-ignored registers (t2 in __Z26compartment_switcher_entryz) and the return registers (a0, a1) to signal the error code. Thanks to Murali for brainstorming and pointing out deficiencies in other approaches. Co-authored-by: Murali Vijayaraghavan <[email protected]>
- Loading branch information
Showing
4 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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