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

Secure PKRU during thread startup #440

Merged
merged 4 commits into from
Oct 15, 2024
Merged

Secure PKRU during thread startup #440

merged 4 commits into from
Oct 15, 2024

Conversation

rinon
Copy link
Collaborator

@rinon rinon commented Oct 10, 2024

Rather than saving and restoring the PKRU from a register when allocating and securing thread stacks, we branch on the initial value to one of a set of duplicated initialization routines, each of which hard-codes the PKRU value to restore after initialization.

Fixes #257

@rinon rinon requested review from ayrtonm and fw-immunant October 10, 2024 18:58
@rinon rinon force-pushed the sjc/secure_thread_startup branch 2 times, most recently from 9aad931 to 6daa93c Compare October 11, 2024 22:02
Copy link
Contributor

@fw-immunant fw-immunant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semantically LGTM, a couple non-functional nits.

@rinon
Copy link
Collaborator Author

rinon commented Oct 14, 2024

@fw-immunant how about REPEATB_REV()?

rinon added 4 commits October 14, 2024 16:25
Rather than saving and restoring the PKRU from a register when allocating and securing thread stacks, we branch on the initial value to one of a set of duplicated initialization routines, each of which hard-codes the PKRU value to restore after initialization.
@rinon rinon force-pushed the sjc/secure_thread_startup branch from 196dc17 to 3359811 Compare October 14, 2024 23:26
@fw-immunant
Copy link
Contributor

Thanks! Feel free to merge.

@rinon rinon merged commit 74a55e8 into main Oct 15, 2024
34 checks passed
@rinon rinon deleted the sjc/secure_thread_startup branch October 15, 2024 17:09
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.

Thread startup saves PKRU in spillable register across function calls
2 participants