[PATCH] Add test suite for the Control Flow Integrity feature.

Peter Collingbourne peter at pcc.me.uk
Wed Feb 18 14:54:25 PST 2015


The purpose of this test suite is mostly to check that the enforcement mechanism works, i.e. that certain things (e.g. calls through classes of the wrong type, or calls through things that look like vtables but aren't) cause the program to crash. I'll add a few comments to each test case to explain what it is testing.


================
Comment at: test/cfi/overwrite.cpp:18
@@ +17,3 @@
+  *((void **)a) = fake_vtable;
+  a->f();
+}
----------------
jfb wrote:
> Could you explain this test?
The test overwrites `a`'s virtual function pointer with a pointer to `fake_vtable` and attempts to make a call through it. If the enforcement mechanism is working, the program will crash (checked via `not --crash` above).

http://reviews.llvm.org/D7738

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list