[all-commits] [llvm/llvm-project] bb3a3d: [DFSan] Don't unmap during dfsan_flush().

Matt Morehouse via All-commits all-commits at lists.llvm.org
Fri Aug 14 11:44:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: bb3a3da38d01cd5639b502ec3979d201d59f1950
      https://github.com/llvm/llvm-project/commit/bb3a3da38d01cd5639b502ec3979d201d59f1950
  Author: Matt Morehouse <mascasa at google.com>
  Date:   2020-08-14 (Fri, 14 Aug 2020)

  Changed paths:
    M compiler-rt/include/sanitizer/dfsan_interface.h
    M compiler-rt/lib/dfsan/dfsan.cpp
    A compiler-rt/test/dfsan/threaded_flush.c

  Log Message:
  -----------
  [DFSan] Don't unmap during dfsan_flush().

Unmapping and remapping is dangerous since another thread could touch
the shadow memory while it is unmapped.  But there is really no need to
unmap anyway, since mmap(MAP_FIXED) will happily clobber the existing
mapping with zeroes.  This is thread-safe since the mmap() is done under
the same kernel lock as page faults are done.

Reviewed By: vitalybuka

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




More information about the All-commits mailing list