[all-commits] [llvm/llvm-project] 4d1d8a: Replace shadow space zero-out by madvise at mmap

Z via All-commits all-commits at lists.llvm.org
Tue Oct 6 14:30:42 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d1d8ae7100ec3c7e1709addb7b3ec6f9ad0b44f
      https://github.com/llvm/llvm-project/commit/4d1d8ae7100ec3c7e1709addb7b3ec6f9ad0b44f
  Author: Jianzhou Zhao <jianzhouzh at google.com>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M compiler-rt/lib/dfsan/dfsan_interceptors.cpp
    R compiler-rt/test/dfsan/munmap_release_shadow.c
    A compiler-rt/test/dfsan/release_shadow_space.c

  Log Message:
  -----------
  Replace shadow space zero-out by madvise at mmap

After D88686, munmap uses MADV_DONTNEED to ensure zero-out before the
next access. Because the entire shadow space is created by MAP_PRIVATE
and MAP_ANONYMOUS, the first access is also on zero-filled values.

So it is fine to not zero-out data, but use madvise(MADV_DONTNEED) at
mmap. This reduces runtime
overhead.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D88755




More information about the All-commits mailing list