[PATCH] D16824: [cfi] Safe handling of unaddressable vtable pointers (compiler-rt).
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 3 11:56:59 PST 2016
pcc added inline comments.
================
Comment at: test/cfi/cross-dso/target_out_of_bounds.cpp:41
@@ +40,3 @@
+ for (uintptr_t *q = (uintptr_t *)p; q < (uintptr_t *)(p + sizeof(A)); ++q)
+ *q = v;
+ // CHECK-ZERO: runtime error: control flow integrity check for type 'A' failed during cast
----------------
Why not just `memset(p, 0, sizeof(A));`?
================
Comment at: test/cfi/cross-dso/target_out_of_bounds.cpp:51-55
@@ +50,7 @@
+ // typeinfo pointer.
+ void *empty = calloc(1, 128);
+ memset(empty, 0xFE, 128);
+ uintptr_t v = (uintptr_t)empty + 64;
+ for (uintptr_t *q = (uintptr_t *)p; q < (uintptr_t *)(p + sizeof(A)); ++q)
+ *q = v;
+ // CHECK-TYPEINFO: runtime error: control flow integrity check for type 'A' failed during cast
----------------
Likewise `memset(p, 0xFE, sizeof(A));`
Repository:
rL LLVM
http://reviews.llvm.org/D16824
More information about the llvm-commits
mailing list