[PATCH] [RFC] Introduce support for multiple sanitizer blacklists (Clang side).

Peter Collingbourne peter at pcc.me.uk
Thu Aug 7 18:45:31 PDT 2014


> Support for adding special case list entries in commandline seems an overkill to me. Now, if you presumably need logic to dynamically construct special case list from object files, I don't see why Clang's codegen will be a good place for it. It won't even use this list, only pass it to the DFSan backend...

I don't think I actually need support for entries on the command line. Forget I brought it up.

I can probably live with having dfsan take two lists of strings, one for the ABI list files and the other for the object files. The thing is that I wanted the ABI list to be collected into an object before being used to create the pass. That way, it would probably be easier to do error handling and such from Clang or whatever is building the ABI list. The existing `SpecialCaseList` object seemed like a reasonable place to do it, but maybe it would be better to use `DFSanABIList` for that purpose and make it a public class.

I was imagining that the code that extracts the list from the object files would live in `DataFlowSanitizer.cpp` and be called from clang.

================
Comment at: lib/Driver/SanitizerArgs.cpp:118
@@ -137,1 +117,3 @@
+  // blacklist in the resource directory.
+  if (!Args.hasArg(options::OPT_fno_sanitize_blacklist)) {
     std::string BLPath;
----------------
Alexey Samsonov wrote:
> Hm. So now -fno-sanitize-blacklist only disables the default blacklist, but not blacklists specified in -fsanitize-blacklist= arguments? This looks weird. I'd suggest the following semantics:
>   * default blacklist in resource directory is implicitly enabled.
>   * -fsanitize-blacklist= specifes one more blacklist to use
>   * -fno-sanitize-blacklist - discards all blacklists previously defined in the command line, and the default blacklist.
> 
> That is,
>   BLSet.insert(DefaultBlacklist);
>   foreach (arg)
>     if arg is -fsanitize-blacklist=, insert the blacklist into BLSet
>     else if arg is -fno-sanitize-blacklist, clear BLSet.
> 
Sounds good. I initially wanted to have a `-fno-default-sanitize-blacklist` flag but I imagined that would be even more confusing if we needed to keep `-fno-sanitize-blacklist`.

http://reviews.llvm.org/D4547






More information about the cfe-commits mailing list