[scudo] Allow for weak hooks, gated by a define
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. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42430 llvm-svn: 323278
Loading
Please register or sign in to comment