What is Meltdown?

A vulnerability in some CPUs where kernel memory could be read speculatively before the permission exception took effect, with values inferred from cache traces. Mitigated by KPTI and other measures.

Field: Hardware Security

Japanese name: Meltdown

How the attack works

Meltdown abuses out-of-order execution. A user program issues a load from a kernel address. Architecturally this must raise a permission fault and return nothing, but on affected processors the loaded value was forwarded to dependent instructions before the fault took effect. Those transient instructions use the secret byte as an index into a user-owned probe array, pulling one particular cache line into the cache. When the fault is finally raised, register results are discarded, but the cache state is not rolled back.

Reading the secret through the cache

The attacker then times an access to every entry of the probe array. The one entry that loads quickly, a cache hit instead of a slow trip to DRAM, reveals the value that was read transiently. This timing side channel, commonly built with a flush-and-reload technique, is repeated byte by byte to dump kernel memory. The permission fault itself can be caught with a signal handler or otherwise suppressed, so the leak can proceed at a useful rate.

Meltdown vs. Spectre

Both attacks rely on transient execution leaving traces in the cache, but they bypass different things. Meltdown breaks the user/kernel privilege boundary directly by exploiting a permission check that completes too late, and it depended on specific microarchitectural behavior found in some processor designs. Spectre instead mistrains branch predictors so that a victim's own, legitimately privileged code speculatively accesses data the attacker chooses. Spectre affects nearly all high-performance speculative CPUs and is harder to eliminate completely.

KPTI and hardware fixes

The main software mitigation, kernel page-table isolation (KPTI), stops mapping most kernel memory into the page tables used while user code runs; only a small stub needed to enter the kernel stays mapped. Without an address translation, the data cannot be loaded even transiently. The cost is a page-table switch on every system call, interrupt and exception, which can noticeably slow syscall-heavy workloads; process-context identifiers (PCIDs) reduce the TLB-flush penalty. Processors fixed in hardware do not need KPTI.

Try it: questions about Meltdown

What is the principle of the vulnerability called Meltdown, which affected some CPUs?

  1. AThe CPU melts from heat and data leaks out
  2. BEven an instruction reading kernel memory without permission speculatively reads the value before the permission exception takes effect, leaving value-dependent traces in the cache
  3. CA misconfiguration exposing kernel memory to all processes
Show answer and explanation

Answer: B. Even an instruction reading kernel memory without permission speculatively reads the value before the permission exception takes effect, leaving value-dependent traces in the cache

When a user program tries to read kernel memory, it should take a permission exception and get no value. On affected CPUs, however, in the brief window before the exception took effect, later instructions using the loaded value ran speculatively and brought a value-dependent location into the cache. The results were discarded by the exception, but kernel data could be inferred through a cache side channel.

What is the idea behind KPTI (kernel page-table isolation), introduced as a software countermeasure to Meltdown?

  1. AWhile user programs run, most kernel memory is removed from the page tables so it cannot be read even speculatively
  2. BEncrypt the entire kernel and store it on disk
  3. CForbid user programs from running
Show answer and explanation

Answer: A. While user programs run, most kernel memory is removed from the page tables so it cannot be read even speculatively

For fast switching, OSes without KPTI map kernel memory into each user process's page tables, marked as inaccessible. Meltdown read it speculatively before that mark was checked, so KPTI removes kernel pages from the mapping altogether while user code runs. Without an address translation, the data cannot be read even speculatively. Switching page tables on every system call, however, costs performance.

FAQ

Is Meltdown the same as Spectre?

No. Both leak data through cache traces of speculative execution, but Meltdown reads kernel memory past a delayed permission check, while Spectre tricks a victim program's own speculation into touching secret data.

Why does the Meltdown patch slow down computers?

KPTI switches page tables on every transition between user and kernel mode, adding overhead and TLB misses to each system call and interrupt. Programs that make many system calls are affected most.

Has Meltdown been fixed in hardware?

Processors designed after the disclosure generally block the faulting data from reaching dependent instructions, and operating systems detect such CPUs and skip KPTI. Older affected CPUs still rely on the software mitigation.

Questions that mention Meltdown (2)

Meltdown appears in 4 practice questions across 3 topics, including Hardware Security, CPUs and architecture, Hardware Security: Advanced Topics and Trends.

  1. Which is an example of vulnerabilities revealing attacks that exploit traces of speculative execution left in the cache to infer data that should not be accessible?
  2. Regarding hardware features that support control-flow integrity, which correctly pairs what protects returns from functions with what protects indirect calls and jumps such as those through function pointers?

Books on Hardware Security Ad

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary