HomePhabricator

sanitizer_common: Introduce internal_madvise and start using it.

Authored by pcc on Aug 12 2020, 7:32 PM.

Description

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

Details

Committed
pccAug 13 2020, 1:09 PM
Differential Revision
D85870: sanitizer_common: Introduce internal_madvise and start using it.
Parents
rG114c9fa0e46f: Add "status" to the list of absl libraries.
Branches
Unknown
Tags
Unknown