llvm-project/llvm/test/Instrumentation/HWAddressSanitizer
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
..
X86 hwasan: add -fsanitize=kernel-hwaddress flag 2018-04-13 18:05:21 +00:00
alloca-array.ll hwasan: Pad arrays with non-1 size correctly. 2019-07-16 03:25:50 +00:00
alloca-with-calls.ll hwasan: Pad arrays with non-1 size correctly. 2019-07-16 03:25:50 +00:00
alloca.ll Added address-space mangling for stack related intrinsics 2019-07-22 12:42:48 +00:00
atomic.ll hwasan: Move memory access checks into small outlined functions on aarch64. 2019-01-23 02:20:10 +00:00
basic.ll hwasan: Initialize the pass only once. 2019-07-17 21:45:19 +00:00
dbg-declare-tag-offset.ll hwasan: Use bits [3..11) of the ring buffer entry address as the base stack tag. 2019-06-17 23:39:51 +00:00
globals.ll hwasan: Instrument globals. 2019-08-06 22:07:29 +00:00
kernel-alloca.ll Added address-space mangling for stack related intrinsics 2019-07-22 12:42:48 +00:00
kernel-inline.ll asan: add kernel inline instrumentation test (retry) 2018-02-21 19:40:55 +00:00
kernel.ll hwasan: Move memory access checks into small outlined functions on aarch64. 2019-01-23 02:20:10 +00:00
landingpad.ll hwasan: Untag unwound stack frames by wrapping personality functions. 2019-08-23 01:28:44 +00:00
lazy-thread-init.ll hwasan: Enable -hwasan-allow-ifunc by default. 2019-04-09 00:25:59 +00:00
mem-intrinsics.ll [HWASAN] Instrument memorty intrinsics by default 2018-12-24 16:02:48 +00:00
personality.ll hwasan: Untag unwound stack frames by wrapping personality functions. 2019-08-23 01:28:44 +00:00
prologue.ll hwasan: Use llvm.read_register intrinsic to read the PC on aarch64 instead of taking the function's address. 2019-06-27 23:24:07 +00:00
with-calls.ll hwasan: Remove the old frame descriptor mechanism. 2019-06-28 17:53:26 +00:00