[asan] Re-poison all redzones on activation.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 13 Sep 2016 18:38:40 +0000 (18:38 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 13 Sep 2016 18:38:40 +0000 (18:38 +0000)
commitb48348fec5776f2edb11768dac84effcd163c528
treea8e7e70bee86695be8f2f8f38e634fde303efa10
parentffa0241a03f917405634a744793a48877dfc22de
[asan] Re-poison all redzones on activation.

When running with start_deactivated=1 in ASAN_OPTIONS, heap redzones
are not poisoned until the first instrumented module is loaded. This
can cause false negatives even on memory allocated after activation,
because redzones are normally poisoned only once when a new allocator
region is mapped.

This change attempts to fix it by iterating over all existing
allocator chunks and poisoning their redzones.

llvm-svn: 281364
compiler-rt/lib/asan/asan_allocator.cc
compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc