7 ms·
> Since this flaw is not fundamental, that is, not even every currently existing processor exhibits it, it appears to be reasonable to replace the flawed design
by titzer 9y ago
> Since this flaw is not fundamental, that is, not even every currently existing processor exhibits it, it appears to be reasonable to replace the flawed design of the bricks, and not to re-engineer house construction.
Timing leaks are an absolutely fundamental flaw of computers. It may be the case that this specific instance of speculation-based attacks that leak information via timing channels can be fixed by stopping speculation or by complete rollback of speculated state including caches. "It's the chip's fault" is true for Spectre and Meltdown, yes, and it will take some time for Intel and other manufacturers to design new chips that stop leaking information due to speculation.
However, timing attacks are probably everywhere. They are covert channels that subvert language safety. The question isn't whether information leaks, but what and how fast. How are we going to deal with them comprehensively at the language level? I don't know.
- UncleMeat 9y agoUh, there are literal piles of papers on static analysis of timing based confidentiality leaks. We've been studying this for years. It is a hard problem, but by no means new or insurmountable.
- titzer 9y agoAnd 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.
- 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.
- nine_k 9y agoTime leaks are not fundamental to computing. They can be fundamental to running concurrent adversarial processes on the same core, though. Indeed, having no speculative execution, or just having caches separated by trust domains, would make Spectre impossible. This would make the whole promise of 'securely virtualized hardware' largely disappear, though. For guaranteed isolation, you'd have to have a physical core (or set of cores) per trust domain. With trust domains sliced pretty thinly, e.g. a domain per JS-executing web page, it's hard. AFAICT, reseting the caches when switching processes (that is, trust domains) sort of mitigates this attack at a relative low cost, a performance hit instead of having to replace the CPU.
- titzer 9y ago> Time leaks are not fundamental to computing. Ok, fine, in some abstract sense. But they are fundamental to realizations of computing that involve shared resources, as the rest of your comment is getting at. We want to share resources for efficiency, which is going to be the constant pressure that keeps leaks coming.
- nine_k 9y agoSure, there's a pressure for performance figures that makes hardware makers cut various corners, including security. Same with software. Reality is always about compromises and tradeoffs. Now we see how the balance point is being pushed back closer to the pole of "security". A new equilibrium will eventually appear. (You can see the very same process in e.g. encryption algorithms: tradeoffs between performance and security, and phasing out of solutions that yielded either to finding of logical flaws or increases in available computing power.)
- adrianN 9y agoCurrently we build CPUs with a handful of very powerful cores and multiplex processes onto them, to optimize for the use case that a process really does need all the power a core offers. We could build processors with, say, only two powerful cores and a hundred simple cores and give most processes their own core.
- floatboth 9y agoDeal with them on OS/VM/sandbox/"system" level. Treat time measurement as privileged. Make it really hard to get precise enough timing in untrusted processes. Disable TSC access, lower clock_gettime precision, make clock_gettime return fuzzy (randomized) time. Randomize CPU frequency to make usage of spinning threads for time measurement hard. Insert randomized delays into untrusted binaries, kinda like DTrace inserts probes (i.e. imagine a JavaScript JIT that inserts no-ops all over the compiled code, and randomly changes these to random sleeps). etc.
- jjuhl 9y agoBut those are all just mitigations, not fixes. Such changes don't guarantee that it's impossible to still leak information - just that it will be harder (but not inherently impossible) to exploit.
- nine_k 9y agoIf you increase the number of bits in a hash, you do not guarantee against collisions, but you can make them so infrequent that searching for them becomes impractical. If the randomizations have such an effect that data sniffing is still possible but its speed is 1 bit per week, trying to sniff something interesting becomes impractical. (Or not; depends on your threat model.)
- heiei98jejrj282 9y agoYes they are just mitigations. What else you got? Firewalls aren’t iron clad they just minimize who can get in There will always be deep, broadly unseen problems; it’s an information availability problem, not a technical one... testing won’t catch some clever edge case a random hacker can come up with because Intel, etc, have to ship, and they ship a design they can produce with information at hand; new deficiencies will be found And those of us in no position to make chips have to suck that up and accept mitigation’s So far no one has come up with a perfect model for any task that requires many layers of context and abstractions; physics, medicine... they’re all racing to find the next blocker and move on. Same with chip makers IMO what needs changing is economics. Information is being hidden and not for security but to protect business models. The economy could have been hit hard if this was known sooner. And having an economy hingeing on that truth, that theres a bug that could disrupt it we just haven’t found it yet, is economic stability and security through obscurity.