5 ms·
And there are literally billions of lines of code and billions of devices that have never been analyzed for timing leaks. Industry reality is that we are still
by titzer 9y ago
And there are literally billions of lines of code and billions of devices that have never been analyzed for timing leaks.
Industry reality is that we are still fighting stack overflow bugs 40 years after safe languages were invented.
Timing attacks are going to be around a long time.
- nine_k 9y agoSecurity did not appear a feature worth spending money on in many cases. As devices become more powerful and more connected, thus increasing the attack surface and the potential losses form them being cracked, the cost-based analysis will start to prioritize security more. The tools for writing dramatically less brittle code are there, but there's the cost of switching. It needs to become lower than the potential losses. And with the current state of the industry, the losses and lawsuits are surely coming. Remember what it took to make an average e-commerce website become reasonably secure.
- jrochkind1 9y agoIt's going to take a LOT of money. Where does this money come from, or on what gets less money get spent, to use instead to pay the very significant cost of security we haven't been paying?
- jayd16 9y agoDo you mean buffer overflow? What language protects against stack overflow?
- kibwen 9y agoIt's not languages but compilers that protect against stack overflow. Rust has contributed code to LLVM that causes stack overflows to abort the process (via guard pages and stack cookies), which means that theoretically you could enable this for C and C++ as well. See https://github.com/rust-lang/rust/issues/16012 https://github.com/rust-lang/rust/issues/16012
- nine_k 9y agoIf you forbid self-recursive functions, the required depth of stack can be statically analyzed. I believe such tools exist even for (a feature-limited subset of) C.
- kibwen 9y agoNot just self-recursion, but all recursion, including transitive mutual recursion. I think it may be possible to do this via strictly lexically-scoped symbols (so imagine C with no forward declarations). Might still be ways to sneak recursion in there though.
- scatters 9y agoThat's what fix point combinators are for. The Y combinator won't work in a language like C++, but the Z will work fine. For example, here's Z in C++14, used to compute 5 factorial: https://godbolt.org/g/se5B8u https://godbolt.org/g/se5B8u
- kibwen 9y agoYeah, I specifically had combinators in mind when considering ways to sneak recursion in. :P And it occurs to me you'd have to forbid function pointers too.
- greiskul 9y agoYup, and you would probably not be able to do Object Oriented Programming either (or have to limit it horrendously), cause an object is similar to a closure, and you therefore can use it for unbounded recursion.
- nine_k 9y agoYes, I meant any recursive calls via a chain of calls to other functions. I think proving that no recursion exists should be relatively simple, just keep following the call graph and keep a set of the nodes (functions) called; you either reach the terminal node(s), or reach an already-visited node again, which means a recursion exists.
- UncleMeat 9y agoBut the comment here at the top was "how are we going to deal with these things at the language level?" and the implication that there are no understood strategies for tackling this problem. Getting people to use heavy static analysis is an uphill battle. Getting people to use prepared statements to prevent SQL injection is an uphill battle! But nobody should take then lesson that we are woefully unprepared to deal with timing leaks via program analysis and that we've entered some new unfamiliar territory.