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 updates and FASAN fixes #2838

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

s1341
Copy link
Collaborator

@s1341 s1341 commented Jan 14, 2025

No description provided.

@@ -96,6 +96,25 @@ thread_local! {
static ASAN_IN_HOOK: Cell<bool> = const { Cell::new(false) };
}

#[inline]
#[cfg(target_arch = "aarch64")]
unsafe fn thread_local_initted() -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, what is the purpose of thread_local_initted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We use a thread local variable to determine if we are hooked or not, but sometimes a new thread spawns and we need to know if we are hooked or not BEFORE TLS has been set up. E.g. in the malloc call made by the TLS setup itself.

So we just ignore any calls before TLS is initialized.

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