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/artee Apr 09 '14

He does, and is right that this is very much a flat memory model issue (of which C and C++ are by far the most important examples). I challenge you to reproduce any of these problems in Java, Smalltalk, Scheme, .NET (managed) or any functional language (Haskell, whatever you want).

And sure, you get exploitable VM bugs in return, that's true. But those can at least be fixed by just updating the VM and not all programs written against it.

4

u/[deleted] Apr 09 '14

He does, and is right that this is very much a flat memory model issue (of which C and C++ are by far the most important examples). I challenge you to reproduce any of these problems in Java, Smalltalk, Scheme, .NET (managed) or any functional language (Haskell, whatever you want).

Rust and ATS are memory safe without requiring a different memory model than C and C++. Their version of memory safety also includes preventing all data races. A garbage collector is not required for safety.

And sure, you get exploitable VM bugs in return, that's true. But those can at least be fixed by just updating the VM and not all programs written against it.

It's not possible to write a secure TLS implementation in these languages due to side channels.

-2

u/[deleted] Apr 09 '14

If I used unsafe code in Rust, can I still blame the language? If I made a conscious choice to use that unsafe code for performance reasons, and then got fucked for it, am I still allowed to blame the language?

Because that's exactly what is happening here.

It's not possible to write a secure TLS implementation in these languages due to side channels.

Here we go again, with your hypotheticals that have no basis in reality. I already gave you what you asked for yesterday and then you decided to nitpick my examples while not answering any of my concerns or questions

6

u/[deleted] Apr 09 '14

If I used unsafe code in Rust, can I still blame the language? If I made a conscious choice to use that unsafe code for performance reasons, and then got fucked for it, am I still allowed to blame the language?

C does not draw any bounds between safe and unsafe code, it's all unsafe. It's not capable of abstracting resource handling and buffer management to the point where it's not possible for the high-level code to get it wrong. It has no destructors, checked reference lifetimes, etc.

There is no way to opt-in to a safe subset of C, even expensive static analysers only catch a fraction of these bugs.

Here we go again, with your hypotheticals that have no basis in reality. I already gave you what you asked for yesterday and then you decided to nitpick my examples while not answering any of my concerns or questions

It's well known why writing most cryptographic algorithms in languages using a VM is infeasible without side channels... it's not a hypothetical.

-5

u/[deleted] Apr 09 '14

Being able to do and consciously deciding to circumvent default tooling are not comparable circumstances.

The OpenSSL developer/contributor made a bad decision and now people are trying to blame the language. Moronic.

As I have stated elsewhere, this is the equivalent of me using unsafe C# code for performance reasons and then blaming C# for letting me do it.

I highly doubt shaurz has written C/C++ code professionally, because for C/C++ developers, the nature of this issue is fairly obvious.

4

u/[deleted] Apr 09 '14

This specific exploit circumvention for malloc and free is present on OpenBSD, but not on FreeBSD, Linux (with glibc, bionic or musl), Windows or OS X. Zero/junk fill is an opt-in feature of jemalloc, but I don't know of any projects using it in production. Firefox and FreeBSD use jemalloc but do not enable zero/junk fill as it has a high cost and is considered a debugging feature. It would not have prevented this from working elsewhere, only on OpenBSD where they are willing to sacrifice some allocator performance for security.