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

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 12:17:50 PDT 2015


I've reverted this in r247921.

On Tue, Sep 15, 2015 at 11:44 AM, H.J. Lu via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> 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.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list