This is an archive of the discontinued LLVM Phabricator instance.

[cfi] Safe handling of unaddressable vtable pointers.
AbandonedPublic

Authored by eugenis on Jan 28 2016, 5:36 PM.

Details

Reviewers
kcc
pcc
Summary

This change attempts to safely check the cast validity, even when
vtable itself, or its typeinfo object, are unaddressable. The check
is quite slow (requires a system call), so we only do this when an
error is already detected to avoid slowing down the vptr sanitizer.

Diff Detail

Repository
rL LLVM

Event Timeline

eugenis updated this revision to Diff 46329.Jan 28 2016, 5:36 PM
eugenis retitled this revision from to [cfi] Safe handling of unaddressable vtable pointers..
eugenis updated this object.
eugenis added reviewers: pcc, kcc.
eugenis set the repository for this revision to rL LLVM.
eugenis added a subscriber: llvm-commits.
pcc added inline comments.Jan 28 2016, 6:29 PM
lib/ubsan/ubsan_type_hash_itanium.cc
212

I don't think we should add a parameter to make the checking optional unless we know that it is necessary. Have you measured the perf impact on UBSan? (Note that UBSan is already calling getDynamicTypeInfoFromVtable on every cache miss).

eugenis added inline comments.Jan 29 2016, 10:54 AM
lib/ubsan/ubsan_type_hash_itanium.cc
212

Not on every cache miss. On every check failure, right before consulting the blacklist and printing a report.