Skip to content

Commit

Permalink
DataFlowSanitizer: greylist is now ABI list.
Browse files Browse the repository at this point in the history
This replaces the old incomplete greylist functionality with an ABI
list, which can provide more detailed information about the ABI and
semantics of specific functions.  The pass treats every function in
the "uninstrumented" category in the ABI list file as conforming to
the "native" (i.e. unsanitized) ABI.  Unless the ABI list contains
additional categories for those functions, a call to one of those
functions will produce a warning message, as the labelling behaviour
of the function is unknown.  The other supported categories are
"functional", "discard" and "custom".

- "discard" -- This function does not write to (user-accessible) memory,
  and its return value is unlabelled.
- "functional" -- This function does not write to (user-accessible)
  memory, and the label of its return value is the union of the label of
  its arguments.
- "custom" -- Instead of calling the function, a custom wrapper __dfsw_F
  is called, where F is the name of the function.  This function may wrap
  the original function or provide its own implementation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188402 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
pcc committed Aug 14, 2013
1 parent 35d5e90 commit fdb1a6c
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 99 deletions.
8 changes: 5 additions & 3 deletions include/llvm/Transforms/Instrumentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ FunctionPass *createMemorySanitizerPass(bool TrackOrigins = false,
FunctionPass *createThreadSanitizerPass(StringRef BlacklistFile = StringRef());

// Insert DataFlowSanitizer (dynamic data flow analysis) instrumentation
ModulePass *createDataFlowSanitizerPass(void *(*getArgTLS)() = 0,
ModulePass *createDataFlowSanitizerPass(StringRef ABIListFile = StringRef(),
void *(*getArgTLS)() = 0,
void *(*getRetValTLS)() = 0);

#if defined(__GNUC__) && defined(__linux__)
inline ModulePass *createDataFlowSanitizerPassForJIT() {
return createDataFlowSanitizerPass(getDFSanArgTLSPtrForJIT,
inline ModulePass *createDataFlowSanitizerPassForJIT(StringRef ABIListFile =
StringRef()) {
return createDataFlowSanitizerPass(ABIListFile, getDFSanArgTLSPtrForJIT,
getDFSanRetValTLSPtrForJIT);
}
#endif
Expand Down
Loading

0 comments on commit fdb1a6c

Please sign in to comment.