llvm-project/llvm/test/Instrumentation/HWAddressSanitizer
Alex Shlyapnikov 788764ca12 [HWASan] Do not retag allocas before return from the function.
Summary:
Retagging allocas before returning from the function might help
detecting use after return bugs, but it does not work at all in real
life, when instrumented and non-instrumented code is intermixed.
Consider the following code:

F_non_instrumented() {
  T x;
  F1_instrumented(&x);
  ...
}

{
  F_instrumented();
  F_non_instrumented();
}

- F_instrumented call leaves the stack below the current sp tagged
  randomly for UAR detection
- F_non_instrumented allocates its own vars on that tagged stack,
  not generating any tags, that is the address of x has tag 0, but the
  shadow memory still contains tags left behind by F_instrumented on the
  previous step
- F1_instrumented verifies &x before using it and traps on tag mismatch,
  0 vs whatever tag was set by F_instrumented

Reviewers: eugenis

Subscribers: srhines, llvm-commits

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

llvm-svn: 336011
2018-06-29 20:20:17 +00:00
..
X86 hwasan: add -fsanitize=kernel-hwaddress flag 2018-04-13 18:05:21 +00:00
alloca-with-calls.ll [HWASan] Do not retag allocas before return from the function. 2018-06-29 20:20:17 +00:00
alloca.ll [HWASan] Do not retag allocas before return from the function. 2018-06-29 20:20:17 +00:00
atomic.ll [hwasan] Fix inline instrumentation. 2018-02-21 19:52:23 +00:00
basic.ll [HWASan] Introduce non-zero based and dynamic shadow memory (LLVM). 2018-04-20 20:04:04 +00:00
kernel-alloca.ll [hwasan] Fix inline instrumentation. 2018-02-21 19:52:23 +00:00
kernel-inline.ll asan: add kernel inline instrumentation test (retry) 2018-02-21 19:40:55 +00:00
kernel.ll hwasan: add -fsanitize=kernel-hwaddress flag 2018-04-13 18:05:21 +00:00
with-calls.ll [hwasan] Rename sized load/store callbacks to be consistent with ASan. 2018-01-16 23:15:08 +00:00