Spectre Badness, Torque Goodness
April 2018
Run for a while
Gather feedback
Google proprietary
Google proprietary
Google proprietary
function lookup(i) {
let data = 0;
if (i < secret_size) {
data = memory[ secret[i] ];
}
return data;
}
IFRAME boundary
// pass "nice" values to lookup to train
// the branch predictor
train();
// flush the memory array from the cache
fill_cache_with_junk();
// Pass a "bad" (out of bounds) i value
attack(bi);
// Which region of memory array load
// quickly?
region = sense(); // timers!
secret_at_bi = compute(memory, region, bi);
function lookup(i) {
let data = 0;
if (i < secret_size) {
LFENCE();
data = memory[ secret[i] ];
}
return data;
}
Costs a lot
function lookup(i) {
let data = 0;
let MASK = 0xffffffff;
{MASK, O} = i < secret_size;
if (O) {
data = memory[ MASK & secret[i] ];
}
return data;
}
Not really JavaScript anymore...
MASK = 0xffffffff; // CPU register
function lookup(i) {
let data = 0;
{MASK, O} = i < secret_size;
if (O) {
data = memory[ MASK & secret[i] ];
}
return data;
}
Not really JavaScript anymore...
JavaScript
Assembly? C++?
Some unholy combination?
Google proprietary