[PATCH] D62927: [sanitizers][windows] Rtl-Heap Interception and tests

Matthew G McGovern via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 12:37:15 PDT 2019


mcgov created this revision.
mcgov added reviewers: rnk, vitalybuka, zturner, mstorsjo.
mcgov added a project: Sanitizers.
Herald added subscribers: llvm-commits, mgorny, kubamracek.
Herald added a project: LLVM.
mcgov updated this revision to Diff 203225.

Adds interceptors for Rtl(Allocate|Free|Size|ReAllocate)Heap family of functions on windows. Hooking these requires more thorough hooking of the Heap(Alloc|Free|Size|ReAlloc) family. This feature is hidden behind a CMake configuration variable since it will incur a performance penalty due to many calls to RtlValidateHeap and HeapValidate.

The tests that exercise this code are also hidden with an environment variable that will add an available feature. This is a hack since I'm not sure the best way to turn these on and off based on the cmake configuration. I am super open to suggestions on a better way to do this :)


https://reviews.llvm.org/D62927

Files:
  .gitignore
  compiler-rt/.gitignore
  compiler-rt/CMakeLists.txt
  compiler-rt/lib/asan/asan_malloc_win.cc
  compiler-rt/lib/asan/asan_win.cc
  compiler-rt/test/CMakeLists.txt
  compiler-rt/test/asan/TestCases/Windows/dll_host.cc
  compiler-rt/test/asan/TestCases/Windows/dll_unload.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_double_free.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_dll_unload_realloc_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_doublefree.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_flags_fallback.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_huge.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_rtl_transfer.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_transfer.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_uaf.cc
  compiler-rt/test/asan/TestCases/Windows/heapalloc_zero_size.cc
  compiler-rt/test/asan/TestCases/Windows/heaprealloc.cc
  compiler-rt/test/asan/TestCases/Windows/heaprealloc_alloc_zero.cc
  compiler-rt/test/asan/TestCases/Windows/lit.local.cfg
  compiler-rt/test/asan/TestCases/Windows/rtlallocateheap.cc
  compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_double_free.cc
  compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_dll_unload_realloc.cc
  compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_flags_fallback.cc
  compiler-rt/test/asan/TestCases/Windows/rtlallocateheap_zero.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62927.203225.patch
Type: text/x-patch
Size: 48291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190605/b7b594a5/attachment.bin>


More information about the llvm-commits mailing list