847 karma · joined October 4, 2010
I remember in the 90s how awesome it seemed to get a *nix system for free with a book.
See: http://www.pelicanparts.com/techarticles/911_carrera_oil_coo...
When you start to pull the car apart you see all the hacks that had to be done to modernize the car to keep the original chassis design alive. My favorite is the air conditioning. It is obvious that air conditioning was not part of the original design. Another favorite is the oil cooler under the front fender. There are oil lines that go all the way from the back of the car to the front just for cooling. The original car didn't have them because the engines were much smaller and ran cooler.
If anyone is considering buying an air cooled 911, I'd say unless you've cashed out a bunch of stock that is blowing a hole in your pocket, stay away. With the current cost of parts any common problem with the cars could easily be a $10k fix. Ask me how I know.
Harry's is a great idea, but I've been happy with double edge razors for a while now: http://baus.net/shave-kit
I'm surprised more systems don't take this approach of doing more work in L7 proxies.
To be clear, this is NOT TRUE. The freelist is used for some allocations, but not in the patch in point. Here is the patch that addresses the bug: https://github.com/openssl/openssl/commit/731f431497f463f3a2...
It clearly uses OPENSSL_Malloc which is basically the equivalent of calling malloc.
https://github.com/openssl/openssl/commit/731f431497f463f3a2...
But where are they called from?
Update: To answer my own question the freelist is used in
ssl3_setup_read_buffer()
ssl3_release_read_buffer()
ssl3_setup_writer_buffer()
ssl3_release_write_buffer()
This is not the same as universally replacing the allocator.The code in question does not use the freelist implementation. It goes directly to OPENSSL_Malloc which is basically malloc.
What happened was the exploit allowed remote clients to read beyond the size of the buffer allocated by OPENSSL_Malloc. There just happened to be data from the freelist sitting next to it.
Even if the freelist implementation wasn't used, that wouldn't have prevented this exploit. There would just be something else sitting there in memory, but we can't predict what that would have been.
To clarify, are we calling the freelist implementation, which the heartbeat code does not use, an allocator?
Update: I agree with the author that it is wrong to point the blame at the freelist implementation. If every C application that manages the reuse of commonly used data structures is doing wrong, then pretty much every modern server application will have to be re-written -- for instance Apache [1].
C is fast and portable and binds to just about any language which is why OPENSSL is in such wide use. Maybe it would be better to use more 'secure' languages like Go, but if OPENSSL was written in Go, how many applications would use it? I'd say almost none.
[1] https://apr.apache.org/docs/apr/1.5/group__apr__pools.html
I feel like I'm missing something here. Where are the self written allocators? This article states that the OPENSSL_Malloc is simply malloc by default.
[1] https://news.ycombinator.com/item?id=7565064
[2] https://github.com/openssl/openssl/blob/a898936218bc279b5d7c...
OpenSSL is ubiquitous and runs everywhere including phones and low powered VPSs that everyone is using. If OpenSSL burned RAM and CPU cycles for the sake of correctness, alternatives would appear. The hard part about developing a library like OpenSSL is it has to be fast AND secure.
I'm not very familiar with how TLS heartbeats are implemented, but I wonder if the buffer could have just been alloc'd once when the connection was created.
Everyone has their biases, and my bias would be to embrace the dynamic and functional aspects of the languages that separate it from Java, rather than creating new syntax that pastes over the fact that the language is fundamentally different.
For example:
var objA = {doIt:function(){console.log('hello from a')}};
var objB = {doIt:function(){console.log('hello from b')}};
var doItDynamically = function(doitObj) {
doitObj.doIt();
};
doItDynamically(objA);
doItDynamically(objB);
a and b do not share a common class (since classes do not exist in JavaScript), but they implement the same interface. For this reason, they can be used polymorphically, as if they shared a common base class or interface in Java or C++.Yes it is inconvenient to do traditional OO programming with JavaScript, but I'm not convinced that is a bad thing. Encouraging subclassing, as pointed out by the author, could actually be detrimental.