Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bd26ab0 authored by Evgenii Stepanov's avatar Evgenii Stepanov
Browse files

Skip memory limits under HWASan, same as ASan.

HWASan is a new memory tool with similar properties: it also has a
large sparse "shadow" mapping that makes RLIMIT_AS ineffective.

Bug: 112438058
Test: mmm SANITIZE_TARGET=hwaddress

Change-Id: Iec3dee890e9d5fbdc4fee5e7e59c58ee2b03a0bf
parent db44c5d1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ void limitProcessMemory(
    size_t percentageOfTotalMem) {

    if (running_with_asan()) {
        ALOGW("Running with ASan, skip enforcing memory limitations.");
        ALOGW("Running with (HW)ASan, skip enforcing memory limitations.");
        return;
    }

+2 −1
Original line number Diff line number Diff line
@@ -20,9 +20,10 @@
namespace android {

extern "C" void __asan_init(void) __attribute__((weak));
extern "C" void __hwasan_init(void) __attribute__((weak));

static inline int running_with_asan() {
    return &__asan_init != 0;
    return &__asan_init != 0 || &__hwasan_init != 0;
}

/**