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

guminterceptor: add alt stack support #826

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajwerner
Copy link

This commit adds a new public API to gum to configure the size of an alternate stack to use for hooking. If the configuration is set, then when an interceptor is triggered, it will switch to this stack after the trampoline but before executing the handler. This is needed to support go or programs which do not have large and mutable thread stacks.

One note is that only x86_64 support has initially been added, and that it only applies for entry invocation listeners. Exit invocation listeners are not supported because they still would not work with go out-of-the-box because go doesn't like junk being added to call stacks.

This commit adds a new public API to gum to configure the size of an
alternate stack to use for hooking. If the configuration is set, then
when an interceptor is triggered, it will switch to this stack after the
trampoline but before executing the handler. This is needed to support
go or programs which do not have large and mutable thread stacks.

One note is that only x86_64 support has initially been added, and that
it only applies for entry invocation listeners. Exit invocation
listeners are not supported because they still would not work with go
out-of-the-box because go doesn't like junk being added to call stacks.
@ajwerner
Copy link
Author

One question I have is how best to test this in CI. Locally I changed the default value the stack size to enable the alternate stack switching and I observed the tests passing. Ideally we could run the interceptor suite twice -- once on the local stack and once on the switched stack. Any pointers on how best to do this would be great.

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.

1 participant