forked from OSchip/llvm-project
[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:
parent
c7b7e2569c
commit
756e1c1e4b
|
@ -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,
|
||||
|
|
|
@ -31,6 +31,7 @@ static const uptr kNumberOfSizeClasses = 255;
|
|||
struct AsanChunk;
|
||||
|
||||
void InitializeAllocator();
|
||||
void ReInitializeAllocator();
|
||||
|
||||
class AsanChunkView {
|
||||
public:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue