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

0-initialize thread-specific data upon thread creation. #508

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

veluca93
Copy link
Contributor

If thread-specific data is not set to 0 upon thread creation, __pthread_tsd_run_dtors will end up running destructors passing uninitialized memory as memory addresses, which can lead to memory corruption.

This issue can be triggered when malloc() returns a memory address that was freed before, as in that case memory is not zeroed out.

If thread-specific data is not set to 0 upon thread creation,
`__pthread_tsd_run_dtors` will end up running destructors passing
uninitialized memory as memory addresses, which can lead to memory
corruption.

This issue can be triggered when malloc() returns a memory address that
was freed before, as in that case memory is not zeroed out.
Copy link
Contributor

@yamt yamt left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Collaborator

@abrown abrown left a comment

Choose a reason for hiding this comment

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

Same here; thanks for the contribution!

@abrown abrown merged commit 5667be1 into WebAssembly:main Jul 3, 2024
8 checks passed
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.

None yet

3 participants