[asan] Reinitialize allocator quarantine on activation.

This is covered by AddressSanitizer.UAF_* tests in asan_test
with start_deactivated=1.

llvm-svn: 200696
This commit is contained in:
Evgeniy Stepanov 2014-02-03 14:19:08 +00:00
parent c7b7e2569c
commit 756e1c1e4b
3 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "asan_activation.h"
#include "asan_allocator.h"
#include "asan_flags.h"
#include "asan_internal.h"
#include "sanitizer_common/sanitizer_flags.h"
@ -59,6 +60,8 @@ void AsanActivate() {
ParseExtraActivationFlags();
ReInitializeAllocator();
asan_is_deactivated = false;
VReport(
1,

View File

@ -31,6 +31,7 @@ static const uptr kNumberOfSizeClasses = 255;
struct AsanChunk;
void InitializeAllocator();
void ReInitializeAllocator();
class AsanChunkView {
public:

View File

@ -309,6 +309,10 @@ void InitializeAllocator() {
quarantine.Init((uptr)flags()->quarantine_size, kMaxThreadLocalQuarantine);
}
void ReInitializeAllocator() {
quarantine.Init((uptr)flags()->quarantine_size, kMaxThreadLocalQuarantine);
}
static void *Allocate(uptr size, uptr alignment, StackTrace *stack,
AllocType alloc_type, bool can_fill) {
if (!asan_inited)