sanitizer_common: Introduce internal_madvise and start using it.
A recent change to sanitizer_common caused us to issue the syscall madvise(MADV_HUGEPAGE) during HWASAN initialization. This may lead to a problem if madvise is instrumented (e.g. because libc is instrumented or the user intercepted it). For example, on Android the syscall may fail if the kernel does not support transparent hugepages, which leads to an attempt to set errno in a HWASAN instrumented function. Avoid this problem by introducing a syscall wrapper and using it to issue this syscall. Tested only on Linux; includes untested updates for the other platforms. Differential Revision: https://reviews.llvm.org/D85870
Loading
Please sign in to comment