Properly fix heap_tagging_helper for HWASan.
Test: atest bionic-unit-tests Change-Id: Ia9fbb436676257810d1c379d5d65dd7ccfcf90ac
This commit is contained in:
parent
668c061986
commit
e2d50fe622
1 changed files with 5 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue