[compiler-rt] r247484 - ubsan: Implement memory permission validation for vtables.

H.J. Lu via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 11:44:33 PDT 2015


On Fri, Sep 11, 2015 at 3:18 PM, Peter Collingbourne via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: pcc
> Date: Fri Sep 11 17:18:35 2015
> New Revision: 247484
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247484&view=rev
> Log:
> 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
>

This caused:

https://llvm.org/bugs/show_bug.cgi?id=24826

-- 
H.J.


More information about the llvm-commits mailing list