Skip to content

Commit c32cfbc

Browse files
committed
DataFlowSanitizer: Add a design doc paragraph on checking ABI consistency.
Differential Revision: http://llvm-reviews.chandlerc.com/D1443 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189055 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b969e84 commit c32cfbc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/DataFlowSanitizerDesign.rst

+13
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,16 @@ native ABI function directly and the pass will compute the appropriate label
205205
internally. This has the advantage of reducing the number of union operations
206206
required when the return value label is known to be zero (i.e. ``discard``
207207
functions, or ``functional`` functions with known unlabelled arguments).
208+
209+
Checking ABI Consistency
210+
------------------------
211+
212+
DFSan changes the ABI of each function in the module. This makes it possible
213+
for a function with the native ABI to be called with the instrumented ABI,
214+
or vice versa, thus possibly invoking undefined behavior. A simple way
215+
of statically detecting instances of this problem is to prepend the prefix
216+
"dfs$" to the name of each instrumented-ABI function.
217+
218+
This will not catch every such problem; in particular function pointers passed
219+
across the instrumented-native barrier cannot be used on the other side.
220+
These problems could potentially be caught dynamically.

0 commit comments

Comments
 (0)