]> granicus.if.org Git - clang/commit
Allow specifying sanitizers in blacklists
authorVlad Tsyrklevich <vlad@tsyrklevich.net>
Mon, 25 Sep 2017 22:11:12 +0000 (22:11 +0000)
committerVlad Tsyrklevich <vlad@tsyrklevich.net>
Mon, 25 Sep 2017 22:11:12 +0000 (22:11 +0000)
commit156b6794501ad194264c3f7fc5e3c3c18d2f1e50
treede06ba0456912d63ad6d2177577d0f9d4249972c
parent4f45cc691315f2daaaa5a78fbc644d106f050af3
Allow specifying sanitizers in blacklists

Summary:
This is the follow-up patch to D37924.

This change refactors clang to use the the newly added section headers
in SpecialCaseList to specify which sanitizers blacklists entries
should apply to, like so:

  [cfi-vcall]
  fun:*bad_vcall*
  [cfi-derived-cast|cfi-unrelated-cast]
  fun:*bad_cast*

The SanitizerSpecialCaseList class has been added to allow querying by
SanitizerMask, and SanitizerBlacklist and its downstream users have been
updated to provide that information. Old blacklists not using sections
will continue to function identically since the blacklist entries will
be placed into a '[*]' section by default matching against all
sanitizers.

Reviewers: pcc, kcc, eugenis, vsk

Reviewed By: eugenis

Subscribers: dberris, cfe-commits, mgorny

Differential Revision: https://reviews.llvm.org/D37925

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314171 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
docs/ControlFlowIntegrity.rst
docs/SanitizerSpecialCaseList.rst
include/clang/Basic/SanitizerBlacklist.h
include/clang/Basic/SanitizerSpecialCaseList.h [new file with mode: 0644]
lib/AST/Decl.cpp
lib/Basic/CMakeLists.txt
lib/Basic/SanitizerBlacklist.cpp
lib/Basic/SanitizerSpecialCaseList.cpp [new file with mode: 0644]
lib/Basic/XRayLists.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGen/Inputs/sanitizer-special-case-list.sanitized.txt [new file with mode: 0644]
test/CodeGen/Inputs/sanitizer-special-case-list.unsanitized1.txt [new file with mode: 0644]
test/CodeGen/Inputs/sanitizer-special-case-list.unsanitized2.txt [new file with mode: 0644]
test/CodeGen/Inputs/sanitizer-special-case-list.unsanitized3.txt [new file with mode: 0644]
test/CodeGen/Inputs/sanitizer-special-case-list.unsanitized4.txt [new file with mode: 0644]
test/CodeGen/sanitizer-special-case-list.c [new file with mode: 0644]
test/CodeGenCXX/cfi-blacklist.cpp