News for hackers. Stuff that matters.
Re:Reading privileged memory with a side-channel by ErikAugust on Wednesday January 03, 2018 @07:18PM (#16066804)
I've thrown the C code in the Spectre paper up if anyone wants to feel the magic: https://gist.github.com/ErikAugust/724d4a969fb2c6ae1bbd7b2a9...
Re:Reading privileged memory with a side-channel by dpwm on Wednesday January 03, 2018 @09:17PM (#16067454)
Just tested this on systems of varying age.

Works on processors going back as far as 2007 (the oldest I have access to now is an Athlon 64 X2 6000+), but the example code relies on an instruction that the Atom D510 does not suport.

Because Spectre seems to be an intrinsic problem with out-of-order execution, which is almost as old as the FDIV bug in intel processors, I would be very surprised if the Atom D510 did not turn out to be susceptible using other methods as outlined in the paper.

EDIT: I originally suspected this instruction was CLFLUSH and erroneously claimed the D510 doesn't support sse2. It does support sse2, so it must be that it does not support the RDTSCP instruction used for timing.

EDIT: This gets very interesting. I made some modifications to use a CPUID followed by RDTSC, which now runs without illegal instructions and works everywhere the previous version worked. Except on the D510, this runs but I cannot get the leak to happen despite exploring values of CACHE_HIT_THRESHOLD. Could the Atom D510 really be immune from Spectre?

Re:Reading privileged memory with a side-channel by ENOTTY on Wednesday January 03, 2018 @10:03PM (#16067688)
The D510 might not have speculative execution. https://en.wikipedia.org/wiki/Bonnell_(microarchitecture)
Re:Reading privileged memory with a side-channel by sargun on Thursday January 04, 2018 @04:07AM (#16068926)
Certain Atom CPUs have no speculative execution nor OoO execution.
Re:Reading privileged memory with a side-channel by ojiikun on Wednesday January 03, 2018 @07:43PM (#16066943)
Thanks for this. Would love an annotated version of this if anyone is up for it. My C is pretty good, but some high level "what is being done here" and "this is what shouldn't work" comments would be cool to see.
Re:Reading privileged memory with a side-channel by JetSpiegel on Wednesday January 03, 2018 @08:34PM (#16067243)
Worked on a Intel(R) Celeron(R) CPU 847 @ 1.10GHz.

With "gcc (GCC) 7.2.1 20171128", remove the parenthesis from CACHE_HIT_THRESHOLD macro[1] to compile correctly.

[1]: https://gist.github.com/ErikAugust/724d4a969fb2c6ae1bbd7b2a9...

Re:Reading privileged memory with a side-channel by airesQ on Wednesday January 03, 2018 @07:25PM (#16066850)
Worked on my system.

(Set cache_hit_threshold to the default value of 80, my cpu is an Intel i7-6700k.)

Re:Reading privileged memory with a side-channel by diyseguy on Wednesday January 03, 2018 @09:44PM (#16067581)
I thought it was supposed to be exploitable by javascript? If you can get to the machine and run c code, well, that doesn't seem like an exploit?
Re:Reading privileged memory with a side-channel by PeterisP on Friday January 05, 2018 @11:12AM (#16079448)
At its core both vulnerabilities are essentially local privilege escalation bugs (i.e. a random process can read e.g. secret keys from another process), but that still is a very important exploit - if I can run unprivileged C code on e.g. AWS and are able to read the memory of someone else running on the same shared machine, that's really bad.

The Javascript case is the main one that makes it remotely exploitable.

Re:Reading privileged memory with a side-channel by FranOntanaya on Wednesday January 03, 2018 @09:56PM (#16067651)
My understanding is it's anything that can make a running process mis-train the CPU core and read the values back. Consider, for example, shared hosts without separate process pools, running code from different users with the same interpreter processes.
Re:Reading privileged memory with a side-channel by ComputerGuru on Thursday January 04, 2018 @01:50AM (#16068516)
Just because it runs in a C PoC does not mean it only runs in C.
Re:Reading privileged memory with a side-channel by porjo on Wednesday January 03, 2018 @11:43PM (#16068098)
From the Spectre whitepaper:

> In addition to violating process isolation boundaries using native code, Spectre attacks can also be used to violate browser sandboxing, by mounting them via portable JavaScript code. We wrote a JavaScript program that successfully reads data from the address space of the browser process running it.

The whitepaper doesn't contain example JS code however

Re:Reading privileged memory with a side-channel by diyseguy on Thursday January 04, 2018 @12:01AM (#16068166)
This whitepaper describes the Javascript exploit in Section IV. I'm struggling to understand it though: http://www.cs.vu.nl/~herbertb/download/papers/anc_ndss17.pdf
Re:Reading privileged memory with a side-channel by diyseguy on Thursday January 04, 2018 @11:00AM (#16071321)
This too was provided as a proof of concept (without explanation): https://brainsmoke.github.io/misc/slicepattern.html. I'm not sure what I'm looking at though
Re:Reading privileged memory with a side-channel by diyseguy on Tuesday January 09, 2018 @08:42PM (#16111928)
This is the first implementation in Javascript I have seen so far: http://xlab.tencent.com/special/spectre/js/check.js
Re:Reading privileged memory with a side-channel by PeterisP on Friday January 05, 2018 @11:10AM (#16079433)
At its core both vulnerabilities are essentially privilege escalation bugs (i.e. a random process can read e.g. secret keys from another process), but the Javascript case is the one that makes it remotely exploitable.
Re:Reading privileged memory with a side-channel by mfukar on Thursday January 04, 2018 @10:01AM (#16070739)
It is.
Re:Reading privileged memory with a side-channel by leni536 on Thursday January 04, 2018 @03:59AM (#16068898)
Work's on Intel® Core™2 Duo Processor T7200. Had to replace __rdtscp(&junk) with __rdtsc(), the Core 2 doesn't have the former.
Re:Reading privileged memory with a side-channel by sqldba on Wednesday January 03, 2018 @10:53PM (#16067914)
Works on MacOS 10.13.2.

Looking back, the Mac patches were to address KPTI (Meltdown) which is separate to Spectre.

Re:Reading privileged memory with a side-channel by bspammer on Thursday January 04, 2018 @05:22PM (#16074642)
Terrifyingly, this seems to work on a DigitalOcean droplet. I'm assuming this means people could potentially read memory from other VMs on the same system, albeit with a great deal of difficulty.
Re:Reading privileged memory with a side-channel by diyseguy on Thursday January 04, 2018 @11:45AM (#16071734)
So... it reads a string that was declared at the top of the file?