Skip to content

Add shadow stack support for fcontext #207

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

Merged
merged 1 commit into from
Sep 30, 2022

Conversation

PeterYang12
Copy link
Contributor

Shadow stack is part of Intel's Control-Flow Enforcement Technology.

Whenever a function is called, the return address is pushed onto both
the regular stack and the shadow stack. When that function returns, the
return addresses are popped off both stacks and compared; if they fail
to match, #CP raised.

Backport this commit from https://github.com/php/php-src/pull/9283
With this commit, we create shadow stack with syscall map_shadow_stack
(no.451) for each fiber context and switch the shadow stack accordingly
during fcontext switch.

Signed-off-by: PeterYang12 [email protected]
Signed-off-by: chen-hu-97 [email protected]

    Shadow stack is part of Intel's Control-Flow Enforcement Technology.

    Whenever a function is called, the return address is pushed onto both
    the regular stack and the shadow stack. When that function returns, the
    return addresses are popped off both stacks and compared; if they fail
    to match, #CP raised.

    Backport this commit from php/php-src#9283
    With this commit, we create shadow stack with syscall map_shadow_stack
    (no.451) for each fiber context and switch the shadow stack accordingly
    during fcontext switch.

Signed-off-by: PeterYang12 <[email protected]>
Signed-off-by: chen-hu-97 <[email protected]>
@olk
Copy link
Member

olk commented Sep 30, 2022

ty

@olk olk merged commit 86b4e71 into boostorg:develop Sep 30, 2022
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