r/programming • • Apr 09 '14

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

[deleted] — view deleted post

2.0k Upvotes

661 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Apr 10 '14 edited Apr 10 '14

[removed] — view removed comment

1

u/oridb Apr 11 '14 edited Apr 11 '14

For large allocations (> 4kb) this is viable. For a general allocator that needs to support small allocations as well not so much.

I already said what happens in the case of small allocs, although looking back I wasn't very clear: They are shuffled within the page, such that the offset is not predictable, and that allocations have 1/chunks_per_page chance of being placed at the tail of the block. It doesn't guarantee that you will get a segfault when accessing past the end of the buffer, but it will cause crashes in often used programs.

I do mean the C allocator in OpenBSD's libc (http://www.openbsd.org/papers/eurobsdcon2009/otto-malloc.pdf), although the kernel also does ASLR among other mitigation techniques.