3 ms·
Re #3: vtable pointers aren't mutable...?
by kllrnohj 2mo ago
Re #3: vtable pointers aren't mutable...?
- jstimpfle 2mo agoOf course they are. The pointers to the vtable are part of the object. They aren't mutable fields as per the language, but for security concerns it doesn't matter what the language thinks. Being part of the object, the vtable pointer has to live in a writeable memory mapping (like stack / heap).
- Conscat 2mo agoClang pointer authentication makes any type of vtable attack impossible in C++.
- jstimpfle 2mo agoFair enough, this is an extension though and I suppose you could use it with manually constructed vtables as well?
- kllrnohj 2mo agoThen I don't understand your argument. If you're just saying what could go wrong with heap corruption, then your vtable complaint also applies to storing function pointers in arena allocators in Zig? Zig doesn't have anything special here?
- jstimpfle 2mo agoI asked you what's wrong with pool destructor function pointers. You gave a reason what's wrong and I refuted it. So no, I'm not saying that storing a function pointer is special, just that nothing's wrong with it. (And implying that since there's nothing wrong and it's probably the most straightforward thing to do, it's also probably the right thing).