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

gcc UAF warning in test/perf/singlethread -malloc #679

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

nwf
Copy link
Collaborator

@nwf nwf commented Sep 21, 2024

When building test/perf/singlethread to use the system allocator, gcc (Debian 14.2.0-3) correctly sees that we were using the value of a pointer after it had been passed to the privileged free(), which is UB.

Flip the check and dealloc, so that we query the set of pointers we're tracking first, using the pointer while the allocation is still live.

When building test/perf/singlethread to use the system allocator, gcc
(Debian 14.2.0-3) correctly sees that we were using the value of a
pointer after it had been passed to the privileged free(), which is UB.

Flip the check and dealloc, so that we query the set of pointers we're
tracking first, using the pointer while the allocation is still live.
@nwf nwf requested a review from mjp41 September 21, 2024 10:51
@nwf nwf merged commit 416fd39 into microsoft:main Sep 21, 2024
52 checks passed
@nwf nwf deleted the 202409-gcc-singlethread branch September 21, 2024 14:48
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