[PATCH] Add a flag to clang to support forward-edge control-flow integrity

Nick Lewycky nicholas at mxc.ca
Sat Jul 5 19:39:47 PDT 2014


+cc Kostya.

Kostya, I'm wondering whether I could interest you or anyone on your 
team in looking at http://reviews.llvm.org/D4167 . It's an IR 
transforming runtime instrumentation with a lot in common with the 
asan/tsan/msan passes, except that it has a different goal (security 
guarantees instead of bug finding) and that it runs as part of llc due 
to its integration with the jump tables. I think the sanitizers are the 
closest thing to this in llvm and it would be nice to get a review from 
the sanitizer developers.

Tom Roeder wrote:
> This patch adds a clang flag -ffcfi that enables forward-edge
> control-flow integrity. It depends on the (not yet reviewed) FCFI
> patch at http://reviews.llvm.org/D4167.
>
> Specifically, it sets FCFI in llvm::TargetOptions when called LLVM
> directly, and it passes the LLVM flag -fcfi through LTO to LLVM when
> using gold.

There is not yet a -fcfi flag on the gold plugin. Is that out for review 
already? I looked but I may have missed it.

Nick

> This patch is related to the discussion on llvm-commits about my patch
> http://reviews.llvm.org/D4128, which would have added a
> -jump-table-all flag to LLVM directly; that flag would have set
> unnamed_addr and jumptable on all address-taken functions. Instead,
> this patch adds a flag that sets those attributes at CodeGen time
> under clang, since unnamed_addr changes the semantics of functions
> it's applied to.
>
> Tom




More information about the llvm-commits mailing list