Properly fix heap_tagging_helper for HWASan.

Test: atest bionic-unit-tests
Change-Id: Ia9fbb436676257810d1c379d5d65dd7ccfcf90ac
This commit is contained in:
Florian Mayer 2022-04-29 14:05:24 -07:00
parent 668c061986
commit e2d50fe622

View file

@ -44,11 +44,15 @@ void action2(int signo, siginfo_t* info __unused, void*) {
_exit(0);
}
__attribute__((optnone)) __attribute__((no_sanitize("hwaddress"))) int main() {
__attribute__((optnone)) int main() {
struct sigaction sa = {};
sa.sa_sigaction = action;
sa.sa_flags = SA_SIGINFO;
sigaction(SIGSEGV, &sa, nullptr);
// suppress HWASan crash in logcat / tombstone.
struct sigaction dfl_sa = {};
dfl_sa.sa_handler = SIG_DFL;
sigaction(SIGABRT, &dfl_sa, nullptr);
std::unique_ptr<int[]> p = std::make_unique<int[]>(4);
volatile int oob = p[-1];