Master the fundamental concepts of pipelining & out-of-order execution through this focused micro-challenge.
Spectre and Meltdown exploit speculative execution and cache timing. The CPU may transiently execute instructions that should never commit; microarchitectural side effects (cached lines) remain measurable.
cLoading…
Even when x is out of bounds and the branch later rolls back, the probe line may enter cache, revealing secret[x] via timing.
For this exercise, you will study a toy flush+reload or speculative load demo in a controlled sandbox. This task asks you to explain why fences alone do not fix speculation, connecting pipeline speculation from earlier tasks to CVE-2017-5753/5754.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Explain Spectre/Meltdown side-channel attacks.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github