This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Allow for weak hooks, gated by a define
ClosedPublic

Authored by cryptoad on Jan 23 2018, 9:26 AM.

Details

Summary

Hooks in the allocation & deallocation paths can be a security risk (see for an
example https://scarybeastsecurity.blogspot.com/2016/11/0day-exploit-advancing-exploitation.html
which used the glibc's __free_hook to complete exploitation).

But some users have expressed a need for them, even if only for tests and
memory benchmarks. So allow for __sanitizer_malloc_hook &
__sanitizer_free_hook to be called if defined, and gate them behind a global
define SCUDO_CAN_USE_HOOKS defaulting to 0.

Diff Detail

Event Timeline

cryptoad created this revision.Jan 23 2018, 9:26 AM
Herald added a subscriber: Restricted Project. · View Herald TranscriptJan 23 2018, 9:26 AM
alekseyshl accepted this revision.Jan 23 2018, 1:27 PM
This revision is now accepted and ready to land.Jan 23 2018, 1:27 PM
This revision was automatically updated to reflect the committed changes.