News for hackers. Stuff that matters.
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by SomeHacker44 on Friday January 05, 2018 @01:06PM (#16080298)
This is a good overview of modern, superscalar, out-of-order, speculative CPUs that literally any programmer could easily understand. Recommended reading for every single engineer in the whole world (who doesn't already understand this stuff from reading source material e.g., Google Zero post).
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by PuffinBlue on Friday January 05, 2018 @03:52PM (#16081524)
Non-engineer here, this bit is key right:

> However, suppose we flush our cache before executing the code, and arrange a, b, c, and d so that v is zero. Now, the speculative load in the third cycle:

> v, y_ = u+d, user_mem[x_]

> will read from either address 0x000 or address 0x100 depending on the eighth bit of the result of the illegal read. Because v is zero, the results of the speculative instructions will be discarded, and execution will continue. If we time a subsequent access to one of those addresses, we can determine which address is in the cache. Congratulations: you’ve just read a single bit from the kernel’s address space!

To my understanding it is that saying that by...

1) ...flushing the cache so you have a 'clean' state, you can get...

2) ...the speculative execution to 'pull in' to cache the address user_mem[x_] but...

3) ...the particular address that's pulled into cache, 0x000 or 0x100, is determined by whether...

4) ...the illegal read of kern_mem[address] 8th bit was a 1 or 0...

5) ...which you can then subsequently determine the value of by...

6) ...timing how long it takes to access that user_mem[x] address once again and...

7) ...thereby leaking the value of kern_mem[address]...

So you still have to perform some logic on the result of the speed of the access to the secondary address read right?

If read of 0x000 is slow you know kern_mem[address] was a 1 and if fast kern_mem[address] a 0, and if 0x100 is slow you know kern_mem[address] was a 0 and if fast that kern_mem[address] was a 1?

Is that correct?

If it is it seems that timing is the key right, and actually the clever leap of creativity in completing the exploit, at least to my untrained mind.

Please do correct anything I've got wrong, I'm not an engineer/developer!

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by pilom on Friday January 05, 2018 @04:03PM (#16081612)
You're exactly correct. This is why the browsers decreased timing resolution in javascript so that you couldn't time memory accesses accurately enough to tell if the address was cached or not.
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by CamperBob2 on Friday January 05, 2018 @09:50PM (#16083568)
You're exactly correct. This is why the browsers decreased timing resolution in javascript so that you couldn't time memory accesses accurately enough to tell if the address was cached or not.

What does that do, besides turn the exfiltration problem from an immediate one into a statistical one?

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by eximius on Friday January 05, 2018 @11:35PM (#16083869)
IF it can be turned into a statistical problem, it may become an infeasible attack. You'd have to run the whole attack (not just the last reading bit since that would bring it into the cache after the first read) many times to be able to ascertain the difference. Even then, the difference might be less than the noise from other processes on the system (I think 80 cycles was used in the PoC?).

Maybe there will end up being a new Jumping Around Kernal Address Space System (JAKASS - a cousin of Linux's FUKWIT patch) that periodically resets kernel ASRL to make it fully impossible.

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by floatboth on Saturday January 06, 2018 @05:00AM (#16084622)
This Mozilla post https://blog.mozilla.org/security/2018/01/03/mitigations-lan... mentions that "other timing sources and time-fuzzing techniques are being worked on".

The paper they linked to references this one: https://www.usenix.org/system/files/conference/usenixsecurit...

I think this is what all sandboxes have to do: set the TSC disable flag, restrict system timer precision (make it configurable per sandbox: web servers generally don't need more than 1ms precision), make system timer report fuzzy (randomized) time. Heck, why not also make the CPU run at randomized frequency to mess with busy loop timers.

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by O_H_E on Friday January 05, 2018 @04:25PM (#16081801)
Does that mean -another- slight performance drop ???
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by tialaramex on Friday January 05, 2018 @05:11PM (#16082202)
Not in general.

Consider an Olympic 100 metre sprinter. Today we time this event very accurately, I think it's to one hundredth of a second, using sophisticated technology.

But even if the judges used a much less accurate mechanical stopwatch, Usain Bolt wouldn't actually be slower, we'd just be less confident of how ridiculously fast he is.

In some special cases, timing things very accurately might be essential to a use of Javascript, but I can't think of any examples off the top of my head.

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by make3 on Friday January 05, 2018 @06:47PM (#16082795)
gotta get that sweet rollover effect right to the 24th decimal baby
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by mjevans on Friday January 05, 2018 @04:31PM (#16081867)
It means the only secure system is one where the performance of any given instruction is constant in all cases for that instruction.
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by tempestn on Friday January 05, 2018 @05:11PM (#16082203)
A system like that would certainly be secure against these types of attacks, but I don't believe there is evidence that that is the only secure system. It certainly opens up many of these sorts of problems, but that just means it is difficult to secure, not impossible.
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by crispinb on Friday January 05, 2018 @01:49PM (#16080632)
Yes, CPU architecture is one of many subjects I don't know enough about, and this was both interesting & has added to my reading list.

It's also quite fun to think that the little Pi I have chugging away in a tiny corner doing a variety of background tasks, which was already the most trouble-free machine I own, may also be the safest (OK I know that's an oversimplification, but I'm feeling affectionate towards it).

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by O_H_E on Friday January 05, 2018 @04:29PM (#16081843)
Finally the minimalist approach proved its ..... (I lost the word, non English speaker, but you did understand me :D)
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by mulmen on Friday January 05, 2018 @04:55PM (#16082052)
I think "merit" may be the word you are looking for.

https://en.wiktionary.org/wiki/merit

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by saganus on Friday January 05, 2018 @04:46PM (#16081982)
"worth" maybe?
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by el_benhameen on Friday January 05, 2018 @01:23PM (#16080449)
Agreed. This was the best of the explanations I've read, and it helped me to finally wrap my mind around the exploits.
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by vinn124 on Friday January 05, 2018 @01:38PM (#16080555)
agreed
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by DrTung on Friday January 05, 2018 @01:59PM (#16080714)
Me too. Finally I understand how the leakage works: no actual reading of kernel memory is taking place.

Instead, the read-ahead/speculative logic causes one of two addresses in user space to be read, and thus placed in the cache. So, by reading both of them, and checking the time it took, the exploit can indirectly determine one bit (0 or 1) of kernel memory. Scary!

Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by foobarian on Friday January 05, 2018 @03:05PM (#16081213)
What are the exploits enabled by this? Seems like mostly security-related attacks on encryption keys and such.
Re:Why Raspberry Pi Isn't Vulnerable to Spectre or Meltdown by infinite8s on Friday January 05, 2018 @03:28PM (#16081383)
Well that value has to still be read into the cache, since the "kern_mem[address]&0x100" calculation is speculatively carried out. I don't think the MMU can do any bit level computations.