This is an archive of the discontinued LLVM Phabricator instance.

[asan] Check for pvalloc overlow
ClosedPublic

Authored by cryptoad on Aug 2 2017, 7:51 PM.

Details

Summary

Last one of the pvalloc overflow checks!

CheckForPvallocOverflow was introduced with D35818 to detect when pvalloc
would wrap when rounding up to the next multiple of the page size.

Add this check to ASan's pvalloc implementation.

Event Timeline

cryptoad created this revision.Aug 2 2017, 7:51 PM
alekseyshl accepted this revision.Aug 3 2017, 2:44 PM
This revision is now accepted and ready to land.Aug 3 2017, 2:44 PM

FYI this will break on google3 due to allocator_may_return_null set to 1 for tests by default, so won't submit as is.
Haven't figured out a way to get around this and have it work for both, except migrating to a lit test with ASAN_OPTIONS set accordingly.
WDYT?

cryptoad updated this revision to Diff 109745.Aug 4 2017, 8:25 AM

Switching the test to a lit test to avoid breaking places with a different
allocator_may_return_null value.

cryptoad requested review of this revision.Aug 4 2017, 8:26 AM
cryptoad edited edge metadata.
alekseyshl accepted this revision.Aug 4 2017, 1:21 PM
This revision is now accepted and ready to land.Aug 4 2017, 1:21 PM
cryptoad closed this revision.Aug 4 2017, 1:29 PM