5 ms·
The code that led to the Heartbleed vulnerability was checked in in December 2011. The first pre-Alpha release of Rust was in January 2012 (source: Wikipaedia f
by gaius 12y ago
The code that led to the Heartbleed vulnerability was checked in in December 2011. The first pre-Alpha release of Rust was in January 2012 (source: Wikipaedia for both). Would technology from the future have prevented it, is the actual question, and the answer should be obvious...
- saidajigumi 12y agoThis rant is disingenuous both to the author's post and the ongoing conversation about the benefits and limitations of memory safe languages. To put it more generously, one might write: Could this specific technology from the future have prevented Heartbleed?
- zzzcpan 12y agoI think he has a point. Do we really need this specific technology from the future to prevent Heartbleed? No, because we have ASan and other things like that.
- wyldfire 12y agoASan is wicked awesome, to be sure. But despite its existence, it's not IMO widely-used, or at least as-widely-used-as-I'd-like.
- danudey 12y agoWe also have 'not using a custom malloc() wrapper that doesn't actually free memory as a wrapper around free()' to prevent Heartbleed, but instead of this technology being from the future, it's actually from decades ago.
- lmm 12y agoASan is a runtime detector; it only works if you have a test case that covers the buggy thing, like in this case sending a malformed heartbeat request. OpenSSL pretty clearly didn't have a test case for that - if they did, they'd've caught the problem, with or without ASan. It's like the difference between a type system and unit testing.
- the_why_of_y 12y agoYou miss an important distinction between proof-based approaches (such as type systems) and testing (such as ASan): for any non-trivial problem it's impossible to test all potential inputs, and the inputs that trigger security issues tend to be ... unusual. As Dijkstra said: "Program testing can be used to show the presence of bugs, but never to show their absence."
- zzzcpan 12y agoHow about static analyzers? I'm sure there is one that prevents heartbleed if you follow its suggestions.
- kibwen 12y agoThe Rust typechecker is a static analyzer, and thanks to the language's strict semantics it's more powerful and more reliable than any static analyzer that can be written for C or C++. The language also has a pluggable lint system, so that if you concoct your own correctness guidelines (say, "trigger a compiler warning whenever a buffer is reused"), you can easily implement it and distribute it as a regular Rust library so that others can benefit from it as well. See https://github.com/Manishearth/rust-clippy https://github.com/Manishearth/rust-clippy for an example of such user-defined lint passes.
- geofft 12y agoRust isn't technology from the future, for the most part. It's engineering from the future -- everything is in one language with a native ABI -- but with very few exceptions, each technology in Rust has been around for a while. Memory-safe arrays, which is what's at issue here, is precedented in tons of languages. Even GW-BASIC got this right. It should be an embarrassment to the entire systems programming community that it's 2015 and we're only starting to think of replacing C.
- steveklabnik 12y agoIt's been an explicit goal of Rust to not use cutting edge PLT. For an industry language, Rust's stuff is pretty new, but that's because industry languages lag so far behind PLT as a field.
- martin1975 12y agoWe're about 2 decades away from replacing C, IF, and that's a big IF, Rust delivers on all its promises. So far so good though. As you might be aware, the best technology doesn't always win. I'm not saying Rust won't, I want it to - but it's not just a matter of technology.. also a matter of community support, civility toward newbies/adopters, SOLID, TOP NOTCH documentation so that one doesn't have to scour the tubes for answers, plenty of examples demonstrating suggested use of all the language features, small as they might be, they need to get the point across. If the Rust devs give it their all, I can see no reason why in due time a decade or two from now, Rust cannot be taught as the primary language in universities worldwide, in lieu of the preferred systems language nowadays, C and/or C++.