7 Commits

Author SHA1 Message Date
Florian Mayer
5ac240bbea [hwasan] Properly restore SP tag on exceptions
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D152036
2023-06-05 15:22:18 -07:00
Florian Mayer
9fa938d687 Revert "Properly restore SP tag on exceptions"
This reverts commit 6a2e0cb418175bb985aa898604560110a77c43da.
2023-06-05 10:26:33 -07:00
Florian Mayer
6a2e0cb418 Properly restore SP tag on exceptions
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D152036
2023-06-02 15:33:14 -07:00
Alexey Baturo
847fa84b3d [RISC-V][HWASAN] Adjust lit test support for RISC-V HWASAN feature
Reviewed by: vitalybuka

Differential Revision: https://reviews.llvm.org/D131344
2022-12-14 16:13:55 +03:00
Evgeniy Stepanov
e17b658fc7 [hwasan] Workaround unwinder issues in try-catch test.
Android links the unwinder library to every DSO. The problem is,
unwinder has global state, and hwasan implementation of personality
function wrapper happens to rub it the wrong way.

Switch the test to static libc++ as a temporary workaround.

llvm-svn: 375471
2019-10-21 23:57:12 +00:00
Peter Collingbourne
21a1814417 hwasan: Untag unwound stack frames by wrapping personality functions.
One problem with untagging memory in landing pads is that it only works
correctly if the function that catches the exception is instrumented.
If the function is uninstrumented, we have no opportunity to untag the
memory.

To address this, replace landing pad instrumentation with personality function
wrapping. Each function with an instrumented stack has its personality function
replaced with a wrapper provided by the runtime. Functions that did not have
a personality function to begin with also get wrappers if they may be unwound
past. As the unwinder calls personality functions during stack unwinding,
the original personality function is called and the function's stack frame is
untagged by the wrapper if the personality function instructs the unwinder
to keep unwinding. If unwinding stops at a landing pad, the function is
still responsible for untagging its stack frame if it resumes unwinding.

The old landing pad mechanism is preserved for compatibility with old runtimes.

Differential Revision: https://reviews.llvm.org/D66377

llvm-svn: 369721
2019-08-23 01:28:44 +00:00
Nico Weber
f9e0df071e compiler-rt: Rename .cc file in test/hwasan to .cpp
Like r367463, but for test/hwasan.

llvm-svn: 367849
2019-08-05 13:10:50 +00:00