This is an archive of the discontinued LLVM Phabricator instance.

[cfi-verify] Add blacklist parsing for result filtering.
ClosedPublic

Authored by hctim on Nov 1 2017, 6:24 PM.

Details

Summary

Adds blacklist parsing behaviour for filtering results into four categories:

  • Expected Protected: Things that are not in the blacklist and are protected.
  • Unexpected Protected: Things that are in the blacklist and are protected.
  • Expected Unprotected: Things that are in the blacklist and are unprotected.
  • Unexpected Unprotected: Things that are not in the blacklist and are unprotected.

llvm-cfi-verify now can optionally be invoked with a second command line argument, which specifies the blacklist file that the binary was built with.

Current -fsanitize=cfi-vcall,cfi-icall statistics for chromium:

Expected Protected: 100375 (69.00%)
Unexpected Protected: 12171 (8.37%)
Expected Unprotected: 16207 (11.14%)
Unexpected Unprotected (BAD): 16726 (11.50%)

Event Timeline

hctim created this revision.Nov 1 2017, 6:24 PM

I think there are some mistakes in the (Un)?expected (Un)?protected summary description that should be fixed as well.

tools/llvm-cfi-verify/lib/FileAnalysis.cpp
383

Will this do what we expect when !LineInfo?

tools/llvm-cfi-verify/llvm-cfi-verify.cpp
109

vcall?

unittests/tools/llvm-cfi-verify/GraphBuilder.cpp
129

Could we rename this to IgnoreDwarfFlag? Would make it a little clearer what was happening here.

hctim updated this revision to Diff 121357.Nov 2 2017, 1:25 PM
hctim marked 3 inline comments as done.
hctim edited the summary of this revision. (Show Details)

Updated with Vlad's comments, and rebased against master.

vlad.tsyrklevich accepted this revision.Nov 3 2017, 10:37 AM
vlad.tsyrklevich added inline comments.
tools/llvm-cfi-verify/llvm-cfi-verify.cpp
54

bool CFIProtected = Analysis.isIndirect... is a little clearer.

59

No braces here.

This revision is now accepted and ready to land.Nov 3 2017, 10:37 AM
hctim updated this revision to Diff 121544.Nov 3 2017, 1:52 PM
hctim marked 2 inline comments as done.

Updated with Vlad's comments and merged in master in preparation for submission.

This revision was automatically updated to reflect the committed changes.