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

frida-helper-backend: add option to allocate stack #545

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

Conversation

ajwerner
Copy link
Contributor

For some target programs it's not reasonable to assume that any hijacked thread has a large stack. For example, in Go, stacks are often small and are allocated on the heap. The injector bootstrap program uses kilobytes of stack. In order to side-step this problem, this patch enables an option to allocate an auxiliary stack for the remote call to use and, for the bootstrapper and loader, uses it.

The calls to mmap and munmap don't use much stack, so they are fine.

Fixes #544

@ajwerner
Copy link
Contributor Author

@oleavr I'm sure you'll have style comments and suggestions. I'd like to learn the right way to do things so I can more effectively help myself in the future. Let me know what you think of this when you find the time. Thanks!

For some target programs it's not reasonable to assume that any hijacked
thread has a large stack. For example, in Go, stacks are often small and
are allocated on the heap. The injector bootstrap program uses kilobytes
of stack. In order to side-step this problem, this patch changes the
boostrapper to allocate an auxiliary stack for remote calls to use and,
for the bootstrapper and loader, uses it.

The calls to mmap and munmap don't use much stack, so they are fine.

Fixes frida#544.
@ajwerner
Copy link
Contributor Author

Okay, this patch relied on #550 to rebuild the bootstrapper images. I got rid of the build flags to enable this functionality from the original draft. I think this is a reasonable default.

@ajwerner ajwerner marked this pull request as ready for review September 26, 2024 21:56
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.

provide mechanism for injector to use allocated stack
1 participant