Can't you executive the trapping access in a not-taken speculatively-executed branch à la Meltdown?
Re:Intel SA-00145: Lazy FP State Restore
by cperciva on Wednesday June 13, 2018 @09:04PM
(#17308425)
Sure, but that gives you an even shorter window because the pipeline flushes as soon as the CPU realizes that it mis-speculated.
It is my understanding that you can make that window very long by having the mis-speculated branch depend on a value that has to be loaded from main memory.
Hmm, good point. Yes, that would probably make this much easier to exploit.
Unless the CPU does a partial pipeline flush upon realizing that there would be a trap. I don't know -- do Intel CPUs check for exceptions in order?
Leaking secrets via javascript -- I'll be impressed if someone pulls that off. There's a very tight timing window to exploit this before a trap fires and flushes your pipeline, and I doubt you can get the right instructions in there using javascript.