aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-09-11 22:18:35 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-09-11 22:18:35 +0000
commitcf303a4d8b2a0795f10f59691c98212c0951daa5 (patch)
tree2ff7a593b51a389170b50be63207abd78eb86a78 /clang/lib/CodeGen/CodeGenModule.h
parent983366ab12d0d46cbeeba2e8e2c3f299bcf49ac7 (diff)
downloadllvm-cf303a4d8b2a0795f10f59691c98212c0951daa5.zip
llvm-cf303a4d8b2a0795f10f59691c98212c0951daa5.tar.gz
llvm-cf303a4d8b2a0795f10f59691c98212c0951daa5.tar.bz2
ubsan: Implement memory permission validation for vtables.
If the pointer passed to the getVtablePrefix function was read from a freed object, we may end up following pointers into objects on the heap and printing bogus dynamic type names in diagnostics. However, we know that vtable pointers will generally only point into memory mapped from object files, not objects on the heap. This change causes us to only follow pointers in a vtable if the vtable and one of the virtual functions it points to appear to have appropriate permissions (i.e. non-writable, and maybe executable), which will generally exclude heap pointers. Only enabled for Linux; this hasn't been tested on FreeBSD, and vtables are writable on Mac (PR24782) so this won't work there. Differential Revision: http://reviews.llvm.org/D12790 llvm-svn: 247484
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions