Massaging Physical Memory Layouts for Rowhammer Attacks

103 concepts38 papers3 proposals

Rowhammer is fundamentally a hardware-level electrical leakage problem. As dynamic random-access memory (DRAM) cells continue to shrink to achieve higher densities, the physical charge required to trigger a bit flip in an adjacent row drops significantly, as noted by Woo et al.. However, transforming an electrical vulnerability into a reliable security exploit requires bridging a massive abstraction gap: software operates entirely within virtual address spaces, whereas Rowhammer requires precise physical adjacency on the silicon die.

Early Rowhammer exploits relied heavily on probabilistic memory spraying or exhaustive grooming. The modern evolution of this research direction focuses on deterministic physical memory placement—techniques that exploit the predictable internal behaviors of operating system allocators and hardware interfaces to force sensitive victim data exactly into rows adjacent to attacker-controlled "aggressor" rows.

Mapping the Silicon Grid

Before an attacker can strategically place data, they must understand the secret mapping functions that translate a physical address into its actual geometric location (channel, rank, bank, and row) inside the DRAM chip.

Virtual Address  --->  Physical Address  --->  DRAM Geometry (Channel, Bank, Row)
   (Software)             (OS Paging)             (Reverse-Engineered Mapping)

Pessl et al. demonstrated that these complex, undocumented mapping functions can be reverse-engineered entirely in software by measuring row-buffer conflicts via timing side-channels. When two memory accesses target different rows within the same bank, the memory controller must close the active row and open a new one, causing a measurable latency spike.

By systematically analyzing these timing variations, tools like the one proposed by Wang et al. can extract exact address mappings in minutes. Knowing the precise topology dramatically changes the efficacy of an attack: accurate mapping knowledge can more than double the number of observed bit flips compared to blind or imprecise hammering patterns.

Exploiting Allocator Determinism

Once the physical map is known, the attacker faces a core challenge: how can an unprivileged user-space process force the operating system kernel or a target application to place sensitive data (such as page tables or cryptographic keys) into a specific, vulnerable physical row?

The solution lies in the deterministic design of operating system memory allocators. To optimize performance and minimize fragmentation, modern kernels recycle memory pages as efficiently as possible. The authors of DeepHammer and Rakin et al. independently demonstrated that the Last-In-First-Out (LIFO) behavior of kernel page allocators can be weaponized for precise layout manipulation.

When a process frees a page, the kernel places it at the head of a per-CPU page pool. If another request arrives shortly after, the allocator immediately returns that same physical page. An attacker can exploit this by:

  1. Allocating a large block of memory to drain the allocator's free lists.
  2. Releasing specific physical pages known to be adjacent to a target row (determined via mapping functions).
  3. Triggering the victim application to perform an allocation (e.g., loading a deep learning model or creating a new process).

Because of the LIFO reuse pattern, the victim's sensitive data lands exactly on the physical pages the attacker just vacated, achieving predictable physical co-location without requiring administrative privileges.

Bypassing Architectural Boundaries via System APIs

On restricted platforms, such as mobile devices, standard Rowhammer primitives are often blocked. For instance, mobile operating systems typically restrict explicit cache-flushing instructions (like clflush), which are traditionally used to force memory reads to bypass the CPU cache and hit the DRAM rows directly.

To overcome this, van der Veen et al. showed that Direct Memory Access (DMA) buffer management APIs can be leveraged. Because DMA hardware requires physically contiguous, uncached memory regions to operate without CPU intervention, interacting with these APIs inherently provides the attacker with large blocks of uncached physical memory. This allows the attacker to bypass CPU cache defenses entirely and execute deterministic row manipulation directly on mobile hardware.

+-------------------------------------------------------+
| User Space Exploitation Primitive                     |
| (Leverages DMA APIs / Double-Owned Buffers)           |
+-------------------------------------------------------+
                           |
                           v
+-------------------------------------------------------+
| CPU Cache Bypassed (Direct DRAM Access)              |
+-------------------------------------------------------+
                           |
                           v
+-------------------------------------------------------+
| Target Victim Row Massaged via LIFO Allocator         |
+-------------------------------------------------------+

Similarly, when attempting to breach isolated kernel boundaries, Cheng et al. introduced a "memory ambush" technique using "double-owned" buffers. Certain system buffers (such as video or SCSI subsystems) are allocated within the kernel partition but can be mapped directly into user space. By manipulating these shared buffers, an unprivileged user can establish highly effective aggressor rows immediately adjacent to isolated kernel data structures, such as page tables, completely undermining software-defined physical isolation.

Surgical Fault Injection

By shifting Rowhammer from a chaotic, probabilistic phenomenon to a deterministic layout manipulation tool, researchers have turned hardware faults into surgical primitives. This precision is highly visible in recent attacks on Deep Neural Networks (DNNs).

Instead of corrupting random memory cells to cause a system crash, modern exploits target specific bits that control critical application logic. For example, Chen et al. target structural "superbits" within compiled DNN executables to alter model behavior, while Wang et al. optimize bit flips to surgically manipulate scale factors in quantized Vision Transformers.

Crucially, these advanced attacks incorporate physical memory layout constraints directly into their optimization algorithms. By ensuring that targeted bits respect real-world hardware boundaries—such as ensuring no two targeted bits reside within the same 4KB memory page—the exploits remain highly effective and stealthy under standard operating system memory isolation constraints.

Key Foundational Work

From Collision To Exploitation: Unleashing Use-After-Free Vulnerabilities in Linux Kernel (2015) — contributed 6 concept elements to this direction.
ATRA: Address Translation Redirection Attack against Hardware-based External Monitors (2014) — contributed 2 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_dram_scaling_vulnerability_7b7e3604,
  title = {DRAM scaling vulnerability},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/dram-scaling-vulnerability/rdr_7b7e36042cba48d9b0c9f46269b59391},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-24},
}

This exact version (version 1, frozen text):

@misc{lacuna_dram_scaling_vulnerability_7b7e3604_v1,
  title = {DRAM scaling vulnerability},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/dram-scaling-vulnerability/rdr_7b7e36042cba48d9b0c9f46269b59391/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-24},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake