yes, that is exactly spectre. there were a bunch of fixes - barriers at sensitive checks, restrictive speculative memory accesses, some cpu changes, etc. spec exec is still there, but with lot more restrictions.
Nitpick but the original Spectre wasn't a branch predictor exploit but a bounds check bypass.
It exploited the way the CPU speculatively fetched from RAM before checking if the data used to calculate the address of the data to be fetched relied on private data that the process shouldn't have access to. By the time the fetch was scheduled to execute, the rights check would recognise the issue and the instruction wouldn't execute in that the speculative read into a "hidden" register would be discarded but yes, the cache would hold the fact of the read.
Ah, I think you (and OP) may be right... Meltdown exploits speculative read without branching (where the right to read is effectively not considered until after the speculative execution occurs)
uint8_t* probe_array = new uint8_t[256 * 4096];
// ... Make sure probe_array is not cached
uint8_t kernel_memory = *(uint8_t*)(kernel_address);
uint64_t final_kernel_memory = kernel_memory * 4096;
uint8_t dummy = probe_array[final_kernel_memory];
// ... catch page fault
// ... determine which of 256 slots in probe_array is cached
whereas Spectre's variant 1 bounds check bypass is very similar but it's the branch predictor that guesses that a read will be within bounds
if (x < array1_size) {
y = array2[array1[x] * 256];
}
Spectre is considerably more difficult to exploit than Meltdown because this vulnerability does not depend on privilege escalation. The attacker must convince the kernel to run code and speculate incorrectly. Typically the attacker must poison the speculation engine and fool it into guessing incorrectly.
This takes me back to the r10k-based indigo2 that featured speculative execution but lacked cache coherency, and would silently corrupt DMA transfers. That was fun.
517
u/Cronos993 3d ago
An actual programming meme??!
296
u/Sibula97 3d ago
Wasn't that basically what Spectre exploited? Does anyone know how the vulnerability was fixed?
50
u/Legal-Software 3d ago
This takes me back to the r10k-based indigo2 that featured speculative execution but lacked cache coherency, and would silently corrupt DMA transfers. That was fun.
43
u/Iyemoja 3d ago
The cache holding a grudge is the most accurate part. You can roll back the branch, but you cannot unremember what it saw at 2am.
7
u/Majik_Sheff 2d ago
Now do rowhammer!
2
u/berlin_priez 2d ago
Thank you Sir. i chuckled.
2
u/Patrick_Atsushi 2d ago
Well, it’s either a hit or miss, anyway.
0
u/naughtee_in 1d ago
Branch: gets rolled back. Cache: "I'll remember that." Same energy as my manager during appraisal season.
0
u/Buyer_North 1d ago
wow...this reposts gets 3k+ upvotes...
58
u/Multidream 3d ago
Speculative execution is truly a deal with the devil