This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizer][Darwin] Add interceptor for malloc_zone_from_ptr
ClosedPublic

Authored by yln on Aug 8 2019, 6:54 PM.

Details

Summary

Ensure that malloc_default_zone and malloc_zone_from_ptr return the
sanitizer-installed malloc zone even when MallocStackLogging (MSL) is
requested. This prevents crashes in certain situations. Note that the
sanitizers and MSL cannot be used together. If both are enabled, MSL
functionality is essentially deactivated since it only hooks the default
allocator which is replaced by a custom sanitizer allocator.

rdar://53686175

Event Timeline

yln created this revision.Aug 8 2019, 6:54 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 8 2019, 6:54 PM
Herald added subscribers: llvm-commits, Restricted Project, kubamracek. · View Herald Transcript
yln edited the summary of this revision. (Show Details)Aug 8 2019, 6:58 PM
yln updated this revision to Diff 214394.Aug 9 2019, 9:44 AM

Rename test file '.cc' -> '.cpp'.

kubamracek accepted this revision.Aug 9 2019, 1:32 PM
kubamracek added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
96–99

Is this a way of asking "is this a pointer from sanitizer_zone"? If yes, can we add a oneline comment explaining that?

This revision is now accepted and ready to land.Aug 9 2019, 1:32 PM
yln marked 2 inline comments as done.Aug 9 2019, 2:36 PM
yln added inline comments.
compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
96–99

Added comment.

This revision was automatically updated to reflect the committed changes.
yln marked an inline comment as done.