[compiler-rt] r349115 - Windows ASan: Instrument _msize_base()

Vlad Tsyrklevich via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 13 16:39:16 PST 2018


Author: vlad.tsyrklevich
Date: Thu Dec 13 16:39:16 2018
New Revision: 349115

URL: http://llvm.org/viewvc/llvm-project?rev=349115&view=rev
Log:
Windows ASan: Instrument _msize_base()

Summary:
A recent update to the VS toolchain in chromium [1] broke the windows
ASan bot because the new toolchain calls _msize_base() instead of
_msize() in a number of _aligned_* UCRT routines. Instrument
_msize_base() as well.

[1] https://crbug.com/914947

Reviewers: rnk, #sanitizers, vitalybuka

Reviewed By: rnk, #sanitizers, vitalybuka

Subscribers: vitalybuka, kubamracek, llvm-commits

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

Modified:
    compiler-rt/trunk/lib/asan/asan_malloc_win.cc
    compiler-rt/trunk/lib/asan/asan_win_dll_thunk.cc

Modified: compiler-rt/trunk/lib/asan/asan_malloc_win.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_malloc_win.cc?rev=349115&r1=349114&r2=349115&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_malloc_win.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_malloc_win.cc Thu Dec 13 16:39:16 2018
@@ -141,6 +141,11 @@ size_t _msize(void *ptr) {
 }
 
 ALLOCATION_FUNCTION_ATTRIBUTE
+size_t _msize_base(void *ptr) {
+  return _msize(ptr);
+}
+
+ALLOCATION_FUNCTION_ATTRIBUTE
 void *_expand(void *memblock, size_t size) {
   // _expand is used in realloc-like functions to resize the buffer if possible.
   // We don't want memory to stand still while resizing buffers, so return 0.
@@ -235,6 +240,7 @@ void ReplaceSystemMalloc() {
   TryToOverrideFunction("_recalloc_base", (uptr)_recalloc);
   TryToOverrideFunction("_recalloc_crt", (uptr)_recalloc);
   TryToOverrideFunction("_msize", (uptr)_msize);
+  TryToOverrideFunction("_msize_base", (uptr)_msize);
   TryToOverrideFunction("_expand", (uptr)_expand);
   TryToOverrideFunction("_expand_base", (uptr)_expand);
 

Modified: compiler-rt/trunk/lib/asan/asan_win_dll_thunk.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_win_dll_thunk.cc?rev=349115&r1=349114&r2=349115&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_win_dll_thunk.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_win_dll_thunk.cc Thu Dec 13 16:39:16 2018
@@ -48,6 +48,7 @@ INTERCEPT_WRAP_W_WWW(_recalloc)
 INTERCEPT_WRAP_W_WWW(_recalloc_base)
 
 INTERCEPT_WRAP_W_W(_msize)
+INTERCEPT_WRAP_W_W(_msize_base)
 INTERCEPT_WRAP_W_W(_expand)
 INTERCEPT_WRAP_W_W(_expand_dbg)
 




More information about the llvm-commits mailing list