Yep. In fact, this was actually one of the reasons Heartbleed was so bad. Normally, anybody repeatedly attempting to read 64k chunks of heap space would hit an unallocated page pretty quickly, causing a crash alerting the victims to something being wrong. However, OpenSSL uses their own funky versions of malloc and free which pre-allocate large chunks of memory from the OS (as in, many pages), then implement their own in-process memory management on top of that. They don't free those pages back to the OS either, at least not anywhere near as soon as a sane memory manager would. This doesn't actually mean huge amounts of wasted memory - the library can mostly re-use the memory it has already requested, rather than grabbing more from the OS - but it does mean that just because something is freed doesn't mean it isn't still mapped into that process. The end result is that Heartbleed had no externally-visible evidence for the vast majority of its victims, so people didn't even know there was something to look for until the news broke.

The code is largely in a subset of C; there are certain language features that make it intrinsically harder to do static analysis and checking, and which you avoid in order to avoid introducing certain classes of problems into the code. Examples include unspecified array lengths for arrays declared at the ends of structures (a c99 feature first defined with a slightly different syntax by gcc), use of function pointers that don't end up with a const qualifier after initialization, serialization and deserialization of data objects containing pointers, variant length arrays, varradic functions, with or without in-band format strings for interpretation of arguments subsequent to the format strings, etc.. For a given compiler technology, it can also include dynamic scoping, locally scoped variable, and basic block replications which introduce issues when using some code constructs. Typically, there is also a requirement for single entry/single exit, and similar techniques that can use runtime assertions (statically or optionally compiled in) in order to test on larger data sets, although by definition, such things are relative Ad Hoc, and therefore not provable in terms of code coverage.

Similar dialects are defined by standards, such as "MISRA C" (Motor Industry Software Reliability Association), but of course, it costs money to get that standard, and it's not disclosed, so there's no open source compliance checkers, and there's no open source static analysis tools that can check the compliant code based on compliance related assumptions. One of the disclosed requirement is use of sized type everywhere, so fundamental C types are eschewed in favor of them; so you don't use "char", "short", "int", "long", and "long long", you use things like "uint8_t" and "int32_t", and so on. Another is that there are limits to allowed cyclomatic complexity, as determined by static analysis tools.

What it pretty much comes down to is that C by itself lets you get away with things that, if you are allowed to get away with them, makes the outcome of running the program indeterminate. It's still not possible to solve/prevent the halting problem in these dialects, but it's easier to avoid getting into a situation where you have to, if you use the constrained dialect and programming style in your code.

It's really be handy if some day MISRA or something similar became an open standard so that we could raise the level of discourse on these things, particularly as they apply to life support systems, since some people place both privacy, security of financial transactions, and so on, on an equal footing with straight life support.

Flensed, refactored, rewritten, and fixed enough of the code so we have stable baseline that we trust and can be maintained/improved.
The right Portability team in place.
A Stable Commitment of Funding to support an increased development and porting effort.

Partially true but...A key issue is that the LibreSSL developers have a different approach to portability than OpenSSL has.- OpenSSL keeps support for very very old platforms, old compilers, old platform and compiler bugs, etc, etc.- OpenSSL implements this support by sprinkling the code with different code paths, depending on which platform it's being compiled to.

LibreSSL, like OpenSSH, takes a different approach:- Aim at a modern platform (OpenBSD) and a modern C dialect.- Support other platforms by providing implementations of whatever functions are missing on those platforms.

It's in the slides. They stripped out code supporting Win16 (which won't run on modern Windows anyway), and they dropped support for pre OSX versions of Mac OS.

That said currently they are cleaning up and perfecting the code with one and only one sane target in mind, OpenBSD. The goal is to have a very good very secure fork of OpenSSL running on OpenBSD that is fully POSIX compliant. Once that has been achieved porting should be relatively pain free.

This is because the C standard is full of crap such as undead(maybe it was half-unsigned?) chars and non-zero NULL and Harvard architecture hacks. If you want to be sure your program will work as intended when some starry-eyed clang/gcc developer reasons he can optimize away your security code because it is undefined behavior, you must support all the brain-dead architectures that motivated the standard, in order to serve as canaries.This is not related to supporting non-standard shitty libcs and OSes which run on 64-bit architectures and yet do not support 64-bit pointers.

Yes, I am extremely annoyed at the misquoting of my presentation, and my slides, by the person who wrote this summary for Slashdot. As I said in the talk, and in the slides, the Linux Foundation has not *yet* committed to support us. Discussions with them are ongoing. Saying that they have somehow "Ignored" us is both slanderous and wrong, and shows exactly what is wrong with Slashdot when they let garbage like this go up. If you have some sort of beef with the Linux Foundation, please take it up on your own time, and use your own name. Don't use mine, or LibreSSL's.

Not me. I'm not guilty. Even responses to requests for help in compiling against OpenSSL were a huge red flag: "If you're not compiling from source, we won't help you." Asking to clarify behavior about things in their API you're linking against was frowned upon, so I go get get the sources, and then I see why they don't want to help anyone -- they don't know how. Told the 3rd party I was contracting for at the time that I would not recommend OpenSSL for future projects, and to use GnuTLS, Mozilla's Network Security Services (NSS) (Apache mod_nss + mod_revocator), or for embedded: PolarSSL or MatrixSSL. When asked why I said the project did not have code quality or standard testing harnesses and that there were many unpatched bugs filed against the system which had gone unfixed for years.

The only people who are guilty are fucking morons. Saying "We're All Guilty" is just blame shifting. I was just building some business logic for a proprietary CMS / Portal and wrote that shit off on my first encounter -- Fuckers actually put OpenSSL on a distro CD for an OS that purports to be security focused. How retarded is that?!

After having more experience with NSS and MatirxSSL and seeing the complexity FUBAR in the entire security theater CA system I've been "rolling my own" security suites despite "common wisdom". That shit doesn't pass as "secure". Honestly I can't fathom why ANY of the OpenSSL codebase is being used in LibreSSL. Implementing these ciphers isn't hard, the math is well understood, the example code is published, and things like side-channel attack mitigation are well documented, if a bit tinfoil hatty (considering the state of end user OS security). The OpenSSL project does deserve bashing. It doesn't even have a proper test harness and unit test with proper code coverage. How can you even tell if both sides of an #ifdef are equivalent, let alone which one is faster? How can a security product be released with ANY untested branches of code?

Given the existing alternatives and reduction in their target platform environments it just seems fucked to me that LibreSSL would use anything other than the header files from OpenSSL. Sorry, anything to do with that cluster fuck is tainted. No amount of "well, you're guilty too" will dissuade me: OpenBSD, you got egg on your face, and you're aiming for more of the same with forking OpenSSL. Oh, wait... None of those SSL libs I mentioned are BSD licensed... Ah, I see. It's fanaticism vs security, round two, fight!

You are aware that OpenBSD are keeping API compatibility so that the ports tree of all the useful software that people actually want to use keeps running? I mean it's not like people need any of that software or anything.