Merge "Properly fix heap_tagging_helper for HWASan." am: 0f6d493d28 am: 08b0b29b7e

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2083905

Change-Id: I98bf00c8d3edc4c75fb983e9318937b99a9ed086
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2022-05-03 06:25:34 +00:00 committed by Automerger Merge Worker
commit a42a68798b

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];