This is an archive of the discontinued LLVM Phabricator instance.

[HWASAN] Add support for max_allocation_size_mb option
ClosedPublic

Authored by kstoimenov on Feb 9 2023, 10:24 AM.

Diff Detail

Event Timeline

kstoimenov created this revision.Feb 9 2023, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 10:24 AM
Herald added a subscriber: Enna1. · View Herald Transcript
kstoimenov requested review of this revision.Feb 9 2023, 10:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 10:24 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript

Fixed pattern.

vitalybuka added inline comments.Feb 9 2023, 10:39 AM
compiler-rt/lib/hwasan/hwasan_allocator.cpp
175

Make sure that max_user_defined_malloc_size is <= kMaxAllowedMallocSize in Init and you don'y need to check them both here

180

Report should not use kMaxAllowedMallocSize if it failed on max_user_defined_malloc_size

Changed to max_malloc_size.

kstoimenov marked 2 inline comments as done.Feb 9 2023, 10:53 AM
vitalybuka accepted this revision.Feb 9 2023, 11:05 AM
vitalybuka added inline comments.
compiler-rt/lib/hwasan/hwasan_allocator.cpp
146

It's Init, we call it once, LIKELY/UNLIKEY no important here, I reccomend to remove them for redability
we need them in hot code only.

148–150

Use Min() instead of if

This revision is now accepted and ready to land.Feb 9 2023, 11:05 AM

Removed UNLIKELY and used Min.

kstoimenov marked 2 inline comments as done.Feb 9 2023, 12:24 PM
This revision was landed with ongoing or failed builds.Feb 9 2023, 12:25 PM
This revision was automatically updated to reflect the committed changes.