Live data from Hacker News

Meltdown Proof-of-Concept

github.com

31–40 of 187 posts

Re: Meltdown Proof-of-Concept

#31
post #12

Earlier quoted context omitted.

> "read any physical memory" as "read memory in cache" You can force values from any memory to affect the cache in a predictable manner which enables you to read all physical memory. See https://news.ycombinator.com/item?id=16108574 or read the paper yourself https://meltdownattack.com/meltdown.pdf

This is from Google Zero on Meltdown: We believe that this precondition is that the targeted kernel memory is present in the L1D cache. Not only is L1D tiny, but stuff like prefetch doesn't touch it. So how exactly do you force any memory into L1D cache unless, like in all the examples we have seen, the victim program is pretty much accessing it in a busy loop?

I'll try to explain the small snippet from the paper. The exploit uses a Flush+Reload attack to use the cache as a side channel to leak memory read in speculative execution. They use a 256 * 4096 byte memory region to leak a 1 byte value from any location mapped to the process. 4096 is the page size and is used to make sure the caching doesn't create false positives. Data across two pages are not cached apparently.

Here's the example from the paper.

  1: ; rcx = kernel address
  2: ; rbx = probe array
  3: retry:
  4: mov al, byte [rcx] ; Read kernel memory(1 byte) into AL which is the least significant byte of RAX
  5: shl rax, 0xc ; Multiply the collected value by 4096 
  6: jz retry ; Retry in case of zero to reduce noise
  7: mov rbx, qword [rbx + rax] ; Access memory based on the value read on line 4
  8: ; Note: The read on line 4 is illegal, but the CPU speculatively executes line 5-7 before this triggers a fault.
The receiving code then trys to access each of these 256 memory locations and measure the time taken. For one of them the value will be much lower since that memory is cached and thus that location is the value read. So if you read the value 84 on line 4 when you access the value at 344064dec(0x54000)in your memory it will be faster and you can deduce the read value was 84.

So in pseudo code the attack is

   start = 0xFFEE // No idea if this is a reasonable start location
   result = []
   offset = 0
   page_size = 4096
   probe_array = malloc(256 * page_size)

   loop {
     flush_caches(probe_array)
     read_and_prepare_cache(start + offset * 8, probe_array) // The above assembly
     result.push(determine_read_value(probe_array)) 
     offset += 1
   }

There's an extra detail here about recovering from the illegal memory access in a quick way that I've skipped.

To answer the parents question I believe this only uses a single cache line(64 bits) since it only accesses a single value.

This is my understanding anyway, happy to be corrected

Re: Meltdown Proof-of-Concept

#33
post #9
post #2

This was the GitHub repo mentioned in the meltdown.pdf that was 404'ing until now. We have native Spectre replication code too. What still seems to be elusive is the JS-based Spectre impl (probably waiting at least for Chrome 64, though I confirmed via https://jsfiddle.net/5n6poqjd/ that Chrome seems to have disabled SharedArrayBuffer even before they said they would which wasn't the case a few days ago).

This is the closest thing to a javascript implementation I have seen: http://xlab.tencent.com/special/spectre/js/check.js from: http://xlab.tencent.com/special/spectre/spectre_check.html

Nice tool. Sadly, it reports that my browser (Chromium 63.0.3239.132 with strict site isolation (chrome://flags/#enable-site-per-process) enabled) is vulnerable to Spectre. Do you know if there are any other steps that I can take to secure myself aside from using Firefox?

Re: Meltdown Proof-of-Concept

#34

Can the videos be put on YouTube for convenience?

#1 - realtime password input - https://www.youtube.com/watch?v=yTpXqyRYcBM

#2 - physical memory leak - https://www.youtube.com/watch?v=kn0FopiF16o

the videos aren't very long, someone should compress it to <10mb as an animated gif and do a pull request to put it in the README

Re: Meltdown Proof-of-Concept

#35

These two bugs (Meltdown and Spectr) are really very speculative things. It is like when human beings became aware of astroid orbits they thought that earth is in danger of being hit by one. Now that is indeed a theoritical possibility but what are the chances? These two bugs have been existent for 20 years and there is no known exploits of them. In the GitHub demos also they mention that the demos will work only if…

If you don't know the difference between the existence of an earthbound asteroid and the existence of people who write computer viruses, I don't know what to tell you.

What's the name for this logical fallacy? You see this shit all the time.

Re: Meltdown Proof-of-Concept

#36
post #9
post #2

This was the GitHub repo mentioned in the meltdown.pdf that was 404'ing until now. We have native Spectre replication code too. What still seems to be elusive is the JS-based Spectre impl (probably waiting at least for Chrome 64, though I confirmed via https://jsfiddle.net/5n6poqjd/ that Chrome seems to have disabled SharedArrayBuffer even before they said they would which wasn't the case a few days ago).

This is the closest thing to a javascript implementation I have seen: http://xlab.tencent.com/special/spectre/js/check.js from: http://xlab.tencent.com/special/spectre/spectre_check.html

Found this earlier today via GitHub search: https://github.com/cgvwzq/spectre/blob/master/spectre.js

Re: Meltdown Proof-of-Concept

#37
post #15
post #14

Earlier quoted context omitted.

I wonder what happened to "This bug is subject to a 90 day disclosure deadline. After 90 days elapse or a patch has been made broadly available, the bug report will become visible to the public." Executive meddling? Edit: Probably the 'extreme circumstances' bit mentioned in https://news.ycombinator.com/item?id=16108434

I think for a bug this big it is pretty understandable. So far, it seems clear the actions of all involved were in a good spirit of responsible disclosure.

Except if you are into *BSD. In that case you might want to label it "selective disclosure" instead of "responsible disclosure".

Re: Meltdown Proof-of-Concept

#38
post #17

Earlier quoted context omitted.

Hmm, wasn't there that Microsoft Windows(?) bug that they derestricted before the patch was out? Memory escapes me at the moment. I thought it somewhat cemented/promoted their adherence to 90 days regardless of patch availability.

Perhaps you're thinking of this bug report https://bugs.chromium.org/p/project-zero/issues/detail?id=11... Project Zero evaluated and relaxed their disclosure policy after that incident as described here https://googleprojectzero.blogspot.com/2015/02/feedback-and-...

One could also consider Microsoft leaking Meltdown here:

https://twitter.com/aionescu/status/930412525111296000

Re: Meltdown Proof-of-Concept

#39
post #15

Earlier quoted context omitted.

I think for a bug this big it is pretty understandable. So far, it seems clear the actions of all involved were in a good spirit of responsible disclosure.

Except if you are into *BSD. In that case you might want to label it "selective disclosure" instead of "responsible disclosure".

Yeah, if you're not using Linux/Windows/macOS, this sucks. I wonder what happens next. Either alternative OSs for Desktops/Servers will become less popular or people are moving away from Intel chips. Obviously Intel CEO's betted on the latter - stocks are a representation of the future value of a company.

Last year I was already hoping that ARM Chromebooks would become more popular but in reality you cannot find them in any retail store.

Re: Meltdown Proof-of-Concept

#40
post #33
post #9

Earlier quoted context omitted.

This is the closest thing to a javascript implementation I have seen: http://xlab.tencent.com/special/spectre/js/check.js from: http://xlab.tencent.com/special/spectre/spectre_check.html

Nice tool. Sadly, it reports that my browser (Chromium 63.0.3239.132 with strict site isolation (chrome://flags/#enable-site-per-process) enabled) is vulnerable to Spectre. Do you know if there are any other steps that I can take to secure myself aside from using Firefox?

I'm running the same version of Chrome(with site isolation enabled), its reporting "Your browser is NOT VULNERABLE to Spectre" for me. Also in incognito mode with extensions disabled.
Post reply on HN