2 ms·
There's basically only one (or a family of) languages that have no optimisation at all, and enable complete control over what the machine does - Asm. The code y
by userbinator 12y ago
There's basically only one (or a family of) languages that have no optimisation at all, and enable complete control over what the machine does - Asm. The code you get is exactly the code you write, no matter how efficient or inefficient it is. This also enables much better the prevention of other attacks like timing/power analysis, since you can effectively insert dummy instructions as needed to keep the timing and power well-behaved.
The biggest downside I see is that it's non-portable, but the reality is that there's not all that many architectures out there to port to anyway (x86, ARM, MIPS probably covers 90%+) and for truly security-critical code having that level of control could be worth it. (This also avoids the "trusting the compiler" problem - an assembler is far easier to verify correctness of than even the simplest C compiler...)
- dllthomas 12y ago"There's basically only one (or a family of) languages that have no optimisation at all" ... sort of. Chips themselves perform some optimizations.
- schoen 12y agoI think I heard of a timing attack that was introduced by CPU optimizations, not in the underlying code at all! But I can't remember what research that was and maybe I'm confusing two different issues.
- dllthomas 12y agoCertainly plausible. If the CPU optimizes one path but not another, in principle that's some information. In practice, gathering enough data to get that above the noise floor and turning it into something useful besides would certainly be difficult but maybe not too difficult.
- schoen 12y agoI might be thinking of some of the cache timing issues about sharing physical hardware with other guest VMs. There were papers in the last two years showing circumstances in which another VM on the same device can learn about secrets in caches via timing experiments. But that's a cache issue rather than a general pipeline issue. So I still can't remember if there's something else that I'm thinking of or if I'm just confusing it with the cache stuff. http://blog.cryptographyengineering.com/2012/10/attack-of-week-cross-vm-timing-attacks.html http://blog.cryptographyengineering.com/2012/10/attack-of-we... More recent stuff in this vein: https://eprint.iacr.org/2014/435.pdf https://eprint.iacr.org/2014/435.pdf (Yikes!)
- TheLoneWolfling 12y agoWell, the most obvious form of that is cache. There's a entire class of timing attacks that rely on the CPU cache - they would not exist if CPUs didn't do the optimization of storing local copies of limited sections of RAM.