[all-commits] [llvm/llvm-project] 9f8c40: sanitizer_common: Introduce internal_madvise and s...

pcc via All-commits all-commits at lists.llvm.org
Thu Aug 13 13:10:12 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9f8c4039f202c4f8e8b820bce6f05039d53ea005
      https://github.com/llvm/llvm-project/commit/9f8c4039f202c4f8e8b820bce6f05039d53ea005
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_openbsd.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_posix.h
    M compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list