Meltdown

Also known as: Meltdown vulnerability

On this page 7

Meltdown is a hardware vulnerability, tracked as CVE-2017-5754, that allows an unprivileged process to read kernel memory by abusing out-of-order execution in modern processors and recovering the data through a cache timing side channel. Among the vulnerabilities studied in cybersecurity, it stands out because it breaks the most basic promise of an operating system: that user programs cannot see memory reserved for the kernel.

The Meltdown vulnerability was disclosed publicly in January 2018 together with its sibling Spectre, after a coordinated disclosure period involving chip vendors, operating system developers and cloud providers. It affected most Intel processors produced over roughly two decades, some ARM cores and certain IBM POWER designs, while most AMD processors were not vulnerable to this specific variant.

How Meltdown exploits out-of-order execution

Meltdown works because a vulnerable processor executes instructions speculatively before it has finished checking whether the program is allowed to run them. When user code loads a byte from a kernel address, the permission check eventually raises a fault, but the loaded value has already been used by transient instructions that follow it.

Those transient instructions do not change architectural registers, yet they leave measurable traces in the CPU cache. The attacker uses the secret byte as an index into a large probe array, so exactly one cache line of that array becomes cached. A timing technique such as Flush+Reload then reveals which line is fast to access, and therefore which value the secret byte held.

The following table breaks the attack into its stages and shows which processor behavior each stage depends on.

StageWhat happensProcessor behavior exploited
PreparationAttacker flushes a 256-entry probe array from the cacheCache flush instruction (clflush)
Illegal loadUser code reads a byte at a kernel addressLoad issued before the privilege check completes
Transient useSecret byte selects one probe array entryOut-of-order execution of dependent instructions
Fault handlingException is raised or suppressedResults discarded architecturally, cache state kept
RecoveryAttacker times access to every probe entryCache hit is far faster than a memory access
Stages of a Meltdown attack

The fault itself can be handled with a signal handler or avoided entirely with transactional memory (Intel TSX), which aborts silently. Researchers demonstrated read rates of hundreds of kilobytes per second, enough to dump passwords, keys and other processes’ data mapped into the kernel’s address space.

Why kernel memory was exposed

Before 2018, mainstream operating systems mapped the entire kernel into every process’s address space for performance. The kernel pages were marked supervisor-only, so the page tables were trusted to block user access, and switching into the kernel during a system call did not require changing page tables or flushing the translation lookaside buffer (TLB).

On Linux and several other systems, the kernel also maintained a direct physical memory map, which meant that reading arbitrary kernel virtual addresses effectively exposed all physical memory. That design choice turned a narrow processor flaw into a full confidentiality break across processes, containers and, on some hypervisors, virtual machines sharing the same host.

Meltdown and Spectre are both transient execution attacks, but they differ in what they break and how they are fixed. Meltdown violates the user-kernel isolation boundary directly, whereas Spectre tricks a victim program into speculatively accessing its own memory through branch misprediction.

The comparison below summarizes the main distinctions practitioners use when assessing exposure.

VulnerabilityIdentifierBoundary crossedPrimary mitigation
MeltdownCVE-2017-5754User to kernelKernel page table isolation
Spectre variant 1CVE-2017-5753Within a process or sandboxBounds-check hardening, fences
Spectre variant 2CVE-2017-5715Across processes and hypervisorRetpoline, IBRS, microcode
Foreshadow (L1TF)CVE-2018-3615 and othersEnclave, kernel, virtual machineL1 cache flush, disabling SMT
MDS (ZombieLoad, RIDL)CVE-2018-12130 and othersAcross hyper-threads and privilege levelsBuffer clearing, microcode
Meltdown versus related transient execution vulnerabilities

Unlike a buffer overflow or use-after-free, Meltdown is not a software memory safety bug, so memory-safe languages offer no protection against it. It also requires local code execution: an attacker must already run code on the target machine, for example as a cloud tenant, through a malicious application or through script running in a browser.

Mitigations and their performance cost

The principal software fix for Meltdown is kernel page table isolation (KPTI), originally developed as KAISER, which keeps almost all kernel memory unmapped while user code runs. Windows, macOS, Linux and the BSDs adopted equivalent designs within weeks of disclosure.

Because the page tables now change on every transition into and out of the kernel, workloads with frequent system calls pay a measurable price. The table below lists the typical layers of defense and their trade-offs.

MitigationWhere appliedTypical overheadNotes
KPTI or KVA shadowOperating system kernelLow to about 30 percentWorst for syscall-heavy and I/O-heavy loads
PCID supportProcessor feature used by the kernelReduces KPTI costAvoids full TLB flushes on context switch
Hypervisor patchesVirtualization layerVaries by workloadProtects host from paravirtualized guests
Hardware fixNewer CPU generationsNegligibleLets the kernel disable KPTI safely
Meltdown mitigation layers

Overhead figures vary widely: desktop applications usually see little noticeable slowdown, while databases, storage servers and network appliances on older processors without PCID reported double-digit losses. Processors released from about 2019 onward include in-silicon fixes that report immunity, allowing operating systems to skip KPTI.

Assessing and managing Meltdown exposure

Effective vulnerability management for Meltdown starts with knowing which processors and kernels are in service. Modern Linux kernels report status under the sysfs path for CPU vulnerabilities, and Windows exposes equivalent information through built-in verification tools.

  • Confirm the CPU model and whether it reports immunity to rogue data cache load.
  • Verify that KPTI is active on vulnerable hardware and has not been disabled by a boot parameter.
  • Apply microcode and firmware updates together with kernel patches, because related variants depend on both.
  • Benchmark critical workloads after patching instead of assuming a generic overhead figure.
  • Retire or isolate legacy hosts that cannot receive patches, especially multi-tenant systems.

A common mistake is to disable mitigations for speed on shared infrastructure. That decision may be defensible on a single-tenant, air-gapped computing node, but it is unsafe wherever untrusted code runs, including virtual desktops, CI runners and browser-facing endpoints.

Explained without jargon

A computer keeps its most private information in a protected area that ordinary programs are never allowed to read. Meltdown showed that many processors would briefly fetch that private data anyway, while they were still checking whether access was allowed.

The processor threw the answer away once it noticed the rule violation, but it left a faint footprint behind, much like a warm chair reveals that someone just sat in it. By measuring tiny timing differences, a program could read those footprints and rebuild the secret one piece at a time. The fix was to hide the protected area completely whenever ordinary programs run, at the cost of some speed.

A typical use case

A hosting provider runs several hundred virtual servers for small businesses on hardware built around older Intel processors. After the January 2018 disclosure, its security team classifies Meltdown as critical for multi-tenant hosts, because any customer able to run code could potentially read memory belonging to the host or to other tenants.

The team installs updated kernels with KPTI enabled, applies hypervisor patches and vendor microcode, and then measures a busy database tier. Throughput on that tier drops by about 12 percent, so the provider adds capacity and schedules a hardware refresh. Within the next budget cycle, the oldest hosts are replaced with processors that carry hardware Meltdown fixes, and the measured overhead on the new fleet becomes negligible.