This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Fix data leak in wrappers_c_test.cpp
ClosedPublic

Authored by Riley-Roberts on Jun 21 2023, 4:16 PM.

Details

Summary

In SmallAlign implemented deallocation for the pointers

Diff Detail

Event Timeline

Riley-Roberts created this revision.Jun 21 2023, 4:16 PM
Riley-Roberts requested review of this revision.Jun 21 2023, 4:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 4:16 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
cryptoad added inline comments.Jun 22 2023, 8:34 AM
compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
124

File probably could use some clang-format'ing

cferris requested changes to this revision.Jun 22 2023, 12:01 PM
cferris added inline comments.
compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
120–128

As we discussed offline, you need to update this comment and the one below.

Adding this to give you experience about how to resolve comment in phabricator.

This revision now requires changes to proceed.Jun 22 2023, 12:01 PM

In SmallAlign implemented deallocation for the pointers

Test: m scudo_wrappers_unit_tests

cferris requested changes to this revision.Jun 22 2023, 2:16 PM
cferris added inline comments.
compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
121

This looks like an error, possibly pulled the line below into the comment.

123

I think "during" is a better word to use here. That describes that you don't want any allocations to happen while the test is running.

This revision now requires changes to proceed.Jun 22 2023, 2:16 PM

In SmallAlign implemented deallocation for the pointers

Test: m scudo_wrappers_unit_tests

In SmallAlign implemented deallocation for the pointers

Test: m scudo_wrappers_unit_tests

cferris requested changes to this revision.Jun 22 2023, 2:49 PM
cferris added inline comments.
compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp
122

This can fit on the line above.

Also, it might be better to say something about hitting many sizes in the primary and also to allocate out of the secondary.

I said this would hit every size class in the primary, but that's not true, doing every power of 2 is not guaranteed to do that.

This revision now requires changes to proceed.Jun 22 2023, 2:49 PM
Riley-Roberts marked 5 inline comments as done.

In SmallAlign implemented deallocation for the pointers

Test: m scudo_wrappers_unit_tests

Chia-hungDuan accepted this revision.Jun 22 2023, 5:40 PM

Please remove the line

Test: m scudo_wrappers_unit_tests

in the commit message and update the summary here.

Other than that, LGTM! Please wait for @cferris 's approval.

Riley-Roberts edited the summary of this revision. (Show Details)Jun 23 2023, 10:57 AM
cferris accepted this revision.Jun 23 2023, 12:10 PM

I'll take of landing this.

This revision is now accepted and ready to land.Jun 23 2023, 12:10 PM
This revision was automatically updated to reflect the committed changes.