[cfe-dev] external libraries and dataflow sanitizer

Peter Collingbourne peter at pcc.me.uk
Wed Jan 28 11:36:19 PST 2015


On Wed, Jan 28, 2015 at 02:13:50PM -0500, Christian Convey wrote:
> Hello, I was wondering with dataflow sanitizer what the preferred mechanism
> is for handling un-instrumented functions in external libraries?
> 
> I'm using a fresh download / build of 3.6 from github, specifically llvm,
> clang, and compiler-rt.  I built them with cmake, and the "check-all" tests
> succeeded.
> 
> I'm able to run the dataflow sanitizer example code
> <http://clang.llvm.org/docs/DataFlowSanitizer.html#example> without a
> problem.
> 
> I then tweaked the example to also call the "readline" function.  Here's
> <http://pastebin.com/eUwcNGL7> the modified code.  When I tried to build
> it, I got an undefined linker error regarding "dfs$readline", shown here
> <http://pastebin.com/uLM0wdnA>.
> 
> From the dataflow design document
> <http://clang.llvm.org/docs/DataFlowSanitizer.html#id3>, I thought the
> solution might be to write my own special-case file.  That results in
> linker errors regarding functions like "dfsan_create_label", show here
> <http://pastebin.com/J6BGr5n1>.
> 
> The only solution that worked for me was to create a copy of the existing
> blacklist file
> "/home/cconvey/src/llvm-install/lib/clang/3.6.0/dfsan_abilist.txt", add an
> entry for "readline" to the end of it, and specify that as my blacklist.
> That seemed to work fine, shown here <http://pastebin.com/QDgq7q8X>.
> 
> Is that the preferred approach for the moment: cloning the
> "dfsan_abilist.txt" file, and appending external library functions as
> needed?

Yes. I would like to introduce a mechanism for reading from multiple abilist
files, but it will take time to implement.

Thanks,
-- 
Peter



More information about the cfe-dev mailing list