llvm-project/llvm/test/Instrumentation
Jianzhou Zhao c88fedef2a [dfsan] Conservative solution to atomic load/store
DFSan at store does store shadow data; store app data; and at load does
load shadow data; load app data.

When an application data is atomic, one overtainting case is

thread A: load shadow
thread B: store shadow
thread B: store app
thread A: load app

If the application address had been used by other flows, thread A reads
previous shadow, causing overtainting.

The change is similar to MSan's solution.
1) enforce ordering of app load/store
2) load shadow after load app; store shadow before shadow app
3) do not track atomic store by reseting its shadow to be 0.
The last one is to address a case like this.

Thread A: load app
Thread B: store shadow
Thread A: load shadow
Thread B: store app

This approach eliminates overtainting as a trade-off between undertainting
flows via shadow data race.

Note that this change addresses only native atomic instructions, but
does not support builtin libcalls yet.
   https://llvm.org/docs/Atomics.html#libcalls-atomic

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D97310
2021-02-25 23:34:58 +00:00
..
AddressSanitizer [asan] Avoid putting globals in a comdat section when targetting elf. 2021-02-24 12:01:56 +00:00
BoundsChecking OpaquePtr: Bulk update tests to use typed byval 2020-11-20 14:00:46 -05:00
DataFlowSanitizer [dfsan] Conservative solution to atomic load/store 2021-02-25 23:34:58 +00:00
HWAddressSanitizer [NFC] Disallow unused prefixes under llvm/test 2021-01-21 20:31:52 -08:00
HeapProfiler [MemProf] Fix a potential "permission denied" test failure on some systems. 2020-12-07 14:04:23 +01:00
InstrOrderFile
InstrProfiling Revert "[InstrProfiling] Use nobits as __llvm_prf_cnts section type in ELF" 2021-02-24 00:41:43 -08:00
MemorySanitizer [msan] Set cmpxchg shadow precisely 2021-02-19 20:23:23 +00:00
PoisonChecking [PoisonCheker] Support for out of bounds operands on shifts + insert/extractelement 2019-07-09 19:26:12 +00:00
SanitizerCoverage [SanitizerCoverage] Drop !associated on metadata sections 2021-02-25 11:59:23 -08:00
ThreadSanitizer [test][TSan] Fix tests under NPM 2020-09-18 11:37:55 -07:00
cgprofile.ll [CGProfile] don't emit cgprofile entry if called function is dllimport 2020-09-23 16:56:54 -07:00