summaryrefslogtreecommitdiff
path: root/lib/hwasan/hwasan_allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hwasan/hwasan_allocator.cpp')
-rw-r--r--lib/hwasan/hwasan_allocator.cpp29
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/hwasan/hwasan_allocator.cpp b/lib/hwasan/hwasan_allocator.cpp
index b4fae5820..81a57d3af 100644
--- a/lib/hwasan/hwasan_allocator.cpp
+++ b/lib/hwasan/hwasan_allocator.cpp
@@ -22,11 +22,6 @@
#include "hwasan_thread.h"
#include "hwasan_report.h"
-#if HWASAN_WITH_INTERCEPTORS
-DEFINE_REAL(void *, realloc, void *ptr, uptr size)
-DEFINE_REAL(void, free, void *ptr)
-#endif
-
namespace __hwasan {
static Allocator allocator;
@@ -301,14 +296,6 @@ void *hwasan_calloc(uptr nmemb, uptr size, StackTrace *stack) {
void *hwasan_realloc(void *ptr, uptr size, StackTrace *stack) {
if (!ptr)
return SetErrnoOnNull(HwasanAllocate(stack, size, sizeof(u64), false));
-
-#if HWASAN_WITH_INTERCEPTORS
- // A tag of 0 means that this is a system allocator allocation, so we must use
- // the system allocator to realloc it.
- if (!flags()->disable_allocator_tagging && GetTagFromPointer((uptr)ptr) == 0)
- return REAL(realloc)(ptr, size);
-#endif
-
if (size == 0) {
HwasanDeallocate(stack, ptr);
return nullptr;
@@ -381,13 +368,6 @@ int hwasan_posix_memalign(void **memptr, uptr alignment, uptr size,
}
void hwasan_free(void *ptr, StackTrace *stack) {
-#if HWASAN_WITH_INTERCEPTORS
- // A tag of 0 means that this is a system allocator allocation, so we must use
- // the system allocator to free it.
- if (!flags()->disable_allocator_tagging && GetTagFromPointer((uptr)ptr) == 0)
- return REAL(free)(ptr);
-#endif
-
return HwasanDeallocate(stack, ptr);
}
@@ -400,15 +380,6 @@ void __hwasan_enable_allocator_tagging() {
}
void __hwasan_disable_allocator_tagging() {
-#if HWASAN_WITH_INTERCEPTORS
- // Allocator tagging must be enabled for the system allocator fallback to work
- // correctly. This means that we can't disable it at runtime if it was enabled
- // at startup since that might result in our deallocations going to the system
- // allocator. If tagging was disabled at startup we avoid this problem by
- // disabling the fallback altogether.
- CHECK(flags()->disable_allocator_tagging);
-#endif
-
atomic_store_relaxed(&hwasan_allocator_tagging_enabled, 0);
}