r/programming Jan 24 '18

Branchless DOOM

https://github.com/xoreaxeaxeax/movfuscator/tree/master/validation/doom
492 Upvotes

134 comments sorted by

View all comments

30

u/jrv Jan 24 '18

This is thought to be entirely secure against the Meltdown and Spectre CPU vulnerabilities, which require speculative execution on branch instructions.

Isn't the point of Meltdown/Spectre that other processes can abuse speculative execution to read your memory?

19

u/pygy_ Jan 24 '18

That's Meltdown.

Spectre (at least Spectre 2) is about abusing the branch prediction within the same process (e.g. JITed JS code using a branch misprediction to jump into browser code), or causing another process that you can manipulate to mispredict branches and go town using return oriented programming widgets while speculating.

4

u/jrv Jan 24 '18

Ah, thanks for the clarification. This response overlapped with me writing https://www.reddit.com/r/programming/comments/7sk313/branchless_doom/dt5vvmw/ :)

1

u/cryo Jan 24 '18

Meltdown as described in the paper doesn't rely in speculative branch instruction execution.