r/programming •

Theo de Raadt: "OpenSSL has exploit mitigation countermeasures to make sure it's exploitable"

[deleted] — view deleted post

0 Upvotes

661 comments sorted by

View all comments

Show parent comment

4

u/AReallyGoodName Apr 10 '14

It depends on the malloc implementation but I've never seen one that will absolutely give you the same pointer address for the same size alloc as consistently as this one.

Most allocators have bins for a range of sizes which means that a range of objects will use those addresses and you're unlikely to get the same pointer back as other objects will be using that allocation bin (unless allocating/deallocating in a tight loop).

Here the allocations are down to the byte. If no other object in the OpenSSL library allocates something of that exact size between a free and a re-allocation you absolutely will get the same pointer back. It's not just a chance like it is with malloc. You consistently get the same pointers back for an alloc of the same sized objects regardless of how long you take between a free() and an alloc().