llvm-mirror/test/Instrumentation
Alex Shlyapnikov eb18816b59 [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
..
AddressSanitizer Revert "[asan] Instrument comdat globals on COFF targets" 2018-06-26 22:43:48 +00:00
BoundsChecking [PM] Port BoundsChecking to the new PM. 2017-11-14 01:30:04 +00:00
DataFlowSanitizer [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00
EfficiencySanitizer Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
HWAddressSanitizer [HWASan] Do not retag allocas before return from the function. 2018-06-29 20:20:17 +00:00
InstrProfiling [InstrProfiling] Emit the runtime hook when no counters are lowered 2018-02-28 19:00:08 +00:00
MemorySanitizer [msan] Don't check divisor shadow in fdiv. 2018-05-18 20:19:53 +00:00
SanitizerCoverage [sanitizer-coverage] don't instrument a function if it's entry block ends with 'unreachable' 2018-05-11 01:09:39 +00:00
ThreadSanitizer [DebugInfo] Add DILabel metadata and intrinsic llvm.dbg.label. 2018-05-09 02:40:45 +00:00