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

0

u/[deleted] Apr 09 '14

The synopsis is in the very article you are commenting on. You still have not read it apparently. So why are you commenting?

So years ago we added exploit mitigations counter measures to libc malloc and mmap, so that a variety of bugs can be exposed. Such memory accesses will cause an immediate crash, or even a core dump, then the bug can be analyed, and fixed forever.

But around that time OpenSSL adds a wrapper around malloc & free so that the library will cache memory on it's own, and not free it to the protective malloc.

These methodologies have been around for quite some time. OpenSSL decided to circumvent it for optimization purposes. Even though on 99.99% of platforms it doesn't matter.

12

u/[deleted] Apr 09 '14

I have read it, maybe it is you who are not understanding. The "countermeasures" are a workaround for the fact that C does not check array bounds accesses! They are not 100% guaranteed to work in all cases since system memory is returned in pages which might include several malloc()ed blocks of memory within them. Of course the caching was dumb and made the countermeasure less effective, and maybe it would have been caught sooner. But it does not negate the fact that C allows this kind of errant runtime behaviour to fall through without complaint!

-6

u/[deleted] Apr 09 '14

If I write unsafe code in C# and wave my dick around, am I free to blame the language? Because that's what it sounds like is going on here.

11

u/[deleted] Apr 09 '14

All C code is unsafe code. C programming is the art of intellectual dick waving.

-7

u/[deleted] Apr 09 '14

How is it the art of intellectual dick waving?