[all-commits] [llvm/llvm-project] 6ce34c: hwasan: enable mmap interception (no tagging used)

Thurston Dang via All-commits all-commits at lists.llvm.org
Fri May 26 09:34:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6ce34c089bf6806a40359b0ecaba7ffbfc809a7d
      https://github.com/llvm/llvm-project/commit/6ce34c089bf6806a40359b0ecaba7ffbfc809a7d
  Author: Thurston Dang <thurston at google.com>
  Date:   2023-05-26 (Fri, 26 May 2023)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan_interceptors.cpp
    M compiler-rt/lib/hwasan/hwasan_platform_interceptors.h
    M compiler-rt/test/sanitizer_common/TestCases/Posix/mmap_write_exec.cpp

  Log Message:
  -----------
  hwasan: enable mmap interception (no tagging used)

This enables HWASan interception for mmap, to prevent users from allocating in the shadow memory regions. For compatibility, it does not use pointer tagging, nor does it allow MAP_FIXED with a tagged address.

This patch initializes the common interceptors, but that should be a no-op (except for the mmap interceptor), due to the disable-by-default nature of hwasan_platform_interceptors.h (from D150708). As the first patch to utilize this common interceptor machinery for HWASan, it also defines some macros (e.g., COMMON_INTERCEPT_FUNCTION) that will be useful as future interceptors are enabled.

TestCases/Posix/mmap_write_exec.cpp now passes for HWASan.

Reviewed By: kstoimenov, vitalybuka

Differential Revision: D151262




More information about the All-commits mailing list