[PATCH] Add Forward-Edge Control-Flow Integrity support

Kostya Serebryany kcc at google.com
Mon Jul 7 04:50:24 PDT 2014


I've made a very quick glance. Before the second round I'd like to see tests that use opt (IR=>IR) instead of (or in addition to) llc tests (IR=>ASM).

Maybe in a separate patch I'd like to see end-to-end tests (like we have in compiler-rt/test).

off-topic: are you going to handle RET instructions?

================
Comment at: lib/CodeGen/ForwardControlFlowIntegrity.cpp:68
@@ +67,3 @@
+
+namespace {
+// Checks to see if a given CallSite is making an indirect call, including
----------------
Please use 'static' instead of anon namespace.
>From http://llvm.org/docs/CodingStandards.html#anonymous-namespaces
make anonymous namespaces as small as possible, and only use them for class declarations.

================
Comment at: test/CodeGen/X86/cfi_non_default_function.ll:10
@@ +9,3 @@
+  call void ()* %fun()
+; CHECK: callq cfi_new_failure
+  ret i32 0
----------------
add 
CHECK-LABEL: @m

================
Comment at: test/CodeGen/X86/cfi_simple_indirect_call.ll:12
@@ +11,3 @@
+define i32 @m(void ()* %fun) {
+  call void ()* %fun()
+; SUB: subl    
----------------
use SUB-LABEL, etc

http://reviews.llvm.org/D4167






More information about the llvm-commits mailing list