DataFlowSanitizer: Prefix the name of each instrumented function with "dfs$".
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 22 Aug 2013 20:08:08 +0000 (20:08 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 22 Aug 2013 20:08:08 +0000 (20:08 +0000)
commitf1366c552480f7c6b2b46b03e19bb798b3a47c66
tree5277472cc316f2be70f568db1eca3074927ce6f3
parent094637408b806bb17c02daba2027f39eb73bb98a
DataFlowSanitizer: Prefix the name of each instrumented function with "dfs$".

DFSan changes the ABI of each function in the module.  This makes it possible
for a function with the native ABI to be called with the instrumented ABI,
or vice versa, thus possibly invoking undefined behavior.  A simple way
of statically detecting instances of this problem is to prepend the prefix
"dfs$" to the name of each instrumented-ABI function.

This will not catch every such problem; in particular function pointers passed
across the instrumented-native barrier cannot be used on the other side.
These problems could potentially be caught dynamically.

Differential Revision: http://llvm-reviews.chandlerc.com/D1373

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189052 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
test/Instrumentation/DataFlowSanitizer/abilist.ll
test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll
test/Instrumentation/DataFlowSanitizer/arith.ll
test/Instrumentation/DataFlowSanitizer/call.ll
test/Instrumentation/DataFlowSanitizer/debug-nonzero-labels.ll
test/Instrumentation/DataFlowSanitizer/load.ll
test/Instrumentation/DataFlowSanitizer/memset.ll
test/Instrumentation/DataFlowSanitizer/prefix-rename.ll [new file with mode: 0644]
test/Instrumentation/DataFlowSanitizer/store.ll