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

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

Change-Id: I851c7f6a7893b1906bb0791892c33d1a2a29d793
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2022-05-03 05:58:48 +00:00 committed by Automerger Merge Worker
commit 08b0b29b7e

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