Home · ASPLOS 2024 · Security, Privacy & Trusted Execution

Rubix: Reducing the Overhead of Secure Rowhammer Mitigations via Randomized Line-to-Row Mapping

Anish Saxena, Saurav Mathur and Moinuddin K. Qureshi

Conference
ASPLOS 2024
Published
2024
Pages
1014-1028
Citations
18

Rowhammer lets an attacker flip DRAM bits by hammering a row, and the provably-secure defenses (which track hammered rows and expensively relocate or throttle them) are getting crushingly slow as the hammer threshold drops — 15% to 600% overhead at the low thresholds coming soon — because so many rows get hammered; the reason is that DRAM deliberately packs consecutive memory into the same row for speed, so any hot data structure piles thousands of activations into a few "hot rows" that keep tripping the defense; this paper (Georgia Tech) builds Rubix, which doesn't make the defense cheaper but makes it RARE — it scatters consecutive cache lines across many different rows with a randomized, encrypted address mapping so no row naturally gets hammered, cutting the number of hot rows about 220x and collapsing the overhead of existing secure mitigations to 1 to 3%, in under a kilobyte of storage and without weakening their security; a dynamic version re-randomizes the mapping over time so an adaptive attacker can never learn it, turning the time to reverse-engineer the layout from a day into 38 years.

The argument in one glance

  1. Problem

    Secure Rowhammer defenses work — but they get crushingly slow as the threshold falls

    Rowhammer flips bits in a DRAM row by repeatedly activating an adjacent one, letting an attacker corrupt memory they do not own. Provably-secure defenses stop it by tracking which rows are being hammered and, once a row crosses a threshold, taking an expensive protective action: migrating the aggressor to a quarantine region (AQUA), swapping it with a random location (SRS), or throttling accesses so no row can be hammered fast enough (Blockhammer). The catch is the falling ROWHAMMER THRESHOLD — the number of activations that induces a flip has dropped about 30x in six years, heading toward the low hundreds. The lower the threshold, the more rows cross it, so the expensive defense fires more and more often, and its cost explodes.

  2. What people did

    Deploy the secure mitigation and pay its cost

    The straightforward approach is to run one of these secure mitigations, which are attractive because they resist even complex attacks (like Half-Double, which exploits the refresh used to protect victim rows). You track activation counts per row, and when a row gets dangerously hot, you migrate, swap, or throttle it. This is correct and secure, and it is the state of the art in provable Rowhammer defense.

  3. Why it fell short

    At low thresholds the defense fires constantly, because benign workloads create thousands of hot rows

    The mitigative action is expensive — a row migration takes microseconds, and throttling can multiply latency tenfold — and how OFTEN it fires depends on how many rows get hammered. At today's high thresholds (around a thousand), few rows qualify, so overhead is modest (at most about 10%). But at the low thresholds coming soon (around 128), far more rows cross it and the defense fires constantly, causing prohibitive slowdowns: 15% for AQUA, 60% for SRS, and 600% for Blockhammer. The root cause is a design choice deep in the memory system: DRAM deliberately maps spatially-consecutive cache lines into the SAME row (so that sequential accesses hit the fast row buffer). One Intel mapping puts all 128 lines of 8KB of consecutive memory in one row. So whenever an application hammers a hot data structure — an array, a page table — hundreds or thousands of activations pile into a few "hot rows." Benign workloads produce over 7,000 hot rows per configuration, and each one keeps tripping the expensive defense.

  4. This paper's idea

    Do not make the defense cheaper — make it rare, by scattering the lines

    This paper (Georgia Tech — Saxena, Mathur, Qureshi) builds Rubix, which attacks the FREQUENCY of mitigations rather than their per-event cost. Its insight: hot rows exist because the memory mapping concentrates spatially-local accesses into the same row. Break that spatial correlation and the hot rows vanish. Rubix scatters consecutive cache lines across many different rows using a RANDOMIZED (encrypted) line-to-row mapping — a low-latency cipher applied to the address in the memory controller — so no row naturally accumulates many activations. This cuts the number of hot rows about 220x (from 7,600 to 33 per workload) and collapses the overhead of existing secure mitigations to 1 to 3%, in under a kilobyte of storage, WITHOUT changing their security (the mitigations are secure under any memory mapping; Rubix is just a mapping). To keep DRAM efficient, Rubix randomizes "gangs" of a few contiguous lines so some row-buffer locality survives — a tunable security-versus-efficiency knob. And to defeat an adaptive attacker who could learn a static mapping, Rubix-D periodically re-randomizes it, turning the time to reverse-engineer the layout from 27.5 hours into 38.5 years. Rubix composes with any secure mitigation, making them practical at the low thresholds ahead.

Why this problem is worth solving

Rowhammer is a physical vulnerability that reaches through every software defense, and as DRAM density climbs the thresholds keep falling, so the secure defenses that exist are about to become unaffordable exactly when they are most needed. Understanding those defenses and why they get costly comes first. A

a SECURE Rowhammer mitigation provably prevents bit-flips even against a sophisticated attacker, by tracking how many times each row is activated and taking a protective action when a row gets dangerously hot. The main families relocate or throttle: AQUA migrates a hot aggressor row to a quarantine region once it reaches half the Rowhammer threshold; SRS (Scalable Row-Swap) swaps a hot row with a random location; Blockhammer rate-limits activations so no row can exceed the threshold within a refresh window. Unlike weaker in-DRAM schemes that have been broken, these resist complex attacks such as Half-Double. But each protective action is EXPENSIVE — a row migration takes microseconds, throttling can multiply access latency tenfold — so the total overhead is roughly the cost per action times how often it fires. That last factor is the problem: as the Rowhammer threshold falls, far more rows cross it, and the expensive action fires far more often
is the setting. The mitigations are correct; their cost scales the wrong way as the threat worsens.

The specific reason so many rows get hammered, and the lever Rubix pulls, lies in how memory addresses map to DRAM. A

a DRAM row holds many cache lines (for example 128 lines, 8KB), and the memory controller deliberately maps spatially-CONSECUTIVE cache lines into the SAME row. This is good for performance: sequential accesses land in one row and hit the fast ROW BUFFER instead of paying to open a new row. But the same co-location is what creates HOT ROWS. When a workload repeatedly touches a hot data structure, all of its spatially-local lines funnel their activations into one row, so that row accumulates hundreds or thousands of activations even though no single line was accessed pathologically. Measurements show that for a row with many activations, almost all of them come from dozens of distinct lines within it (about 56 of 128 on average), confirming that spatial locality, not a single hot line, drives hot rows. Benign workloads produce thousands of these hot rows, and each one repeatedly triggers the secure mitigation
is the crux. The very mapping that makes DRAM fast is what makes the defenses expensive — so changing the mapping is the way out.

What people did before, and where it broke

  • Secure aggressor-tracking mitigations (AQUA, SRS, Blockhammer, counter-based schemes). Provably stop Rowhammer by tracking hot rows and migrating, swapping, or throttling them. Secure even against Half-Double, but the expensive action fires often at low thresholds.
  • Weaker in-DRAM trackers (TRR). Cheap, but repeatedly broken by crafted patterns — not provably secure.
  • Making the mitigative action itself cheaper. Optimize the migration or throttling cost. Helps a little, but does not change how OFTEN the action must fire, which is what dominates at low thresholds.
  • Detection-side improvements (per-row counters and alert schemes). Track activations precisely, as the companion Rowhammer-defense work on this site does. Complementary, but they still must mitigate every hot row, so they do not by themselves reduce how many hot rows arise.
  • The gap. No approach reduced the NUMBER of hot rows that benign workloads create — the root cause of the frequency — while preserving DRAM efficiency and the mitigations’ security. That is the gap Rubix fills.

How Rubix makes secure mitigations cheap

Scatter the lines to kill hot rows, keep some locality, and re-randomize to stay secure

  1. Secure mitigations get expensive at low thresholds

    Secure defenses track hot rows and take an expensive action (migrate, swap, throttle). As the Rowhammer threshold falls, many more rows cross it and the action fires constantly (15% to 600% overhead). The root cause is that DRAM maps consecutive cache lines into the same row, so hot data creates thousands of hot rows.

  2. Break the spatial correlation with a randomized mapping new

    Rubix applies a low-latency cipher to the line address in the memory controller, scattering consecutive cache lines across many different rows. Because spatial neighbors no longer share a row, no row naturally accumulates the activations of a hot data structure — the hot rows disappear.

  3. Preserve some row-buffer locality with gangs new

    Encrypting every line individually would destroy the row buffer (a 0% hit rate). Rubix instead randomizes "gangs" of a few contiguous lines, leaving the low address bits within a gang unencrypted, so gang-mates still co-reside and provide row-buffer hits — a tunable knob (larger gangs keep more locality, smaller gangs kill more hot rows).

  4. Collapse the hot rows and the overhead new

    With gangs of four, Rubix cuts hot rows about 220x (7,600 to 33 per workload), so the secure mitigation almost never fires. This drops AQUA from 15% to 1%, SRS from 60% to about 3%, and Blockhammer from 600% to about 3% at a threshold of 128 — in under a kilobyte of storage, and without changing the mitigations' security.

  5. Re-randomize to defeat the adaptive attacker (Rubix-D) new

    A static mapping could be learned by an attacker probing which lines share a row, then targeting them. Rubix-D periodically rotates the mapping using per-group XOR keys and migrates data in the background, so the attacker's knowledge goes stale — the time to reverse-engineer the layout rises from 27.5 hours to 38.5 years, and any learned mapping is valid for under a second.

  6. Compose under any secure mitigation new

    Rubix is an orthogonal address-mapping layer, not a defense of its own: the underlying mitigation still provides the security guarantee (it is secure for all mappings), and Rubix only reduces how often it must act. So Rubix drops in beneath AQUA, SRS, Blockhammer, or a counter-based scheme, making each affordable at low thresholds.

Evaluated in Gem5 (4-core out-of-order, DDR4) on SPEC2017 workloads, layered under AQUA, SRS, and Blockhammer, with a K-Cipher (3-cycle) for Rubix-S and XOR key rotation (1-cycle) for Rubix-D. A complement to detection-side Rowhammer defenses, not a replacement.

The idea

Break the spatial correlation the problem exploits — scatter to kill the hotspots. Hot rows are not created by any single pathological access; they emerge because the memory mapping funnels many spatially-local accesses into one row. Rubix’s move is to destroy that funneling: randomize the line-to-row mapping so consecutive cache lines land in different rows, and the activations that used to pile into one row now spread across many, so no row ever gets hot from ordinary locality. Randomizing a mapping to break a correlation and spread load evenly is the same scatter-to-eliminate- hotspots discipline the site’s hashing and load-balancing pages use when they distribute keys to avoid collisions, and it shares the security- randomization instinct of the kernel-re-randomization page — here aimed not at hiding a layout but at flattening an activation distribution the attacker and the defender both care about. The elegance is that the same mechanism serves benign performance (no hot rows to mitigate) and security (no row the attacker can drive to the threshold).

Attack the frequency, not the per-event cost. The obvious way to reduce a mitigation’s overhead is to make each mitigation action cheaper. Rubix instead makes the action RARE, by removing the root cause that made it frequent. Overhead is cost-per-action times number-of-actions, and at low thresholds the number of actions dominates — so collapsing the hot-row count by 220x does far more than shaving the cost of each migration. Reducing how often the expensive path is taken, rather than optimizing the expensive path itself, is the same fix-the-common-case-upstream discipline the site’s consensus and approximate-query pages use when they arrange for the cheap path to handle almost everything — and it is the complement to the companion Rowhammer page’s detection scheme: that work counts activations precisely and mitigates efficiently, while Rubix ensures there is far less to mitigate. Together, root-cause reduction plus efficient detection make the low-threshold future affordable.

An orthogonal layer that makes existing defenses practical — and stays secure by re-randomizing. Rubix provides no security guarantee of its own; it relies on the underlying mitigation, which is secure under ANY memory mapping, and simply supplies a mapping that makes that mitigation cheap. That separation — security stays with the mitigation, efficiency comes from the mapping — lets Rubix compose beneath whatever secure scheme is deployed, the same improve-the-shared-substrate move the site’s FHE- accelerator and GPU-persistence pages make when they boost any system built on a common layer. The one danger, an adaptive attacker learning a static mapping and targeting co-resident rows, is closed by Rubix-D’s continuous re-randomization: rotate the mapping faster than it can be learned, so the attacker’s knowledge expires before it is useful — the same expire-the- learned-secret, moving-target discipline the kernel-re-randomization page uses against runtime leaks. Efficiency by scattering, security by rotating, composed under any provable defense.

Making the expensive defense rare

From constant mitigation to almost none

Reducing the overhead of secure Rowhammer mitigations at a threshold of 128. Numbers from the paper's Gem5 evaluation.

Step 1 of 5

Why the defense gets expensive

A secure mitigation takes an expensive action (migrate, swap, or throttle) whenever a row gets hammered past the threshold, and the action cost is high (microseconds per migration, up to tenfold latency for throttling). At low thresholds, so many rows cross the line that the action fires constantly.

at a threshold of 128, AQUA slows down 15%, SRS 60%, and Blockhammer 600%
making each action cheaper barely helps, because it is the frequency, not the per-action cost, that explodes

Why it works

  • Hot rows arise because the memory mapping funnels spatially-local accesses into one row → randomizing the line-to-row mapping scatters those accesses across many rows → no row accumulates enough activations from ordinary locality to become hot.
  • Fewer hot rows means the expensive mitigation fires far less often → Rubix cuts hot rows about 220x → overhead falls from 15 to 600% down to 1 to 3%, since frequency, not per-action cost, dominates at low thresholds.
  • Randomizing every line would destroy the row buffer → randomizing gangs of a few contiguous lines keeps them co-resident → some row-buffer locality survives (a 31% hit rate at gangs of four), a tunable security-versus-efficiency knob.
  • A static mapping could be learned and exploited by an adaptive attacker → Rubix-D rotates the mapping continuously → the attacker’s knowledge expires before use (38.5 years to learn, valid under a second).
  • The security guarantee belongs to the underlying mitigation, which holds for any mapping → Rubix only supplies a mapping that reduces mitigation frequency → it composes under any secure scheme without weakening it.

What it costs (trade-offs and scope)

  • It trades row-buffer locality for security. Pure per-line randomization drops the row-buffer hit rate to zero; gangs recover only part of it (about 31% at gangs of four versus 55 to 63% baseline), and the extra row activations raise DRAM power by roughly 4 to 11% — the gang size is a knob, but even at its best Rubix loses about half the baseline row-buffer hits.
  • It is an efficiency layer, not a standalone defense. Rubix provides no security on its own; it relies entirely on an underlying secure mitigation for the guarantee and only reduces that mitigation’s frequency. If the underlying mitigation is flawed, Rubix does not help.
  • Rubix-D has continuous overhead. Re-randomization migrates data in the background (swapping gangs at a small remapping rate), consuming bandwidth and power continuously, and the vertical remapping and key management add memory-controller complexity and SRAM (512 bytes, more with optional segmentation, up to 16 KB).
  • It is a memory-controller hardware change. Rubix adds a cipher or XOR and extra logic on every access (about 3 cycles for the cipher, 1 for XOR), so it is deployable only in new designs, and it is evaluated in simulation on SPEC2017 rather than on silicon.
  • The benefit is largest in the future regime. At today’s high thresholds the secure mitigations are already cheap, so Rubix’s payoff concentrates at the low thresholds still to come; and the adaptive- attacker margin (38.5 years) rests on the chosen remapping rate and threat model, which a stronger attacker assumption could tighten.

The evaluation

Rubix in Gem5 (4-core out-of-order at 3 GHz, 8 MB shared last-level cache, DDR4 at 2400 MT/s), on 18 SPEC2017 rate benchmarks and 16 mixed configurations, layered under AQUA, SRS, and Blockhammer at a Rowhammer threshold of 128, measuring slowdown, hot-row counts, row-buffer hit rate, DRAM power, storage, and an adaptive-attacker security analysis, with Rubix-S (K-Cipher) and Rubix-D (XOR key rotation).

Making secure Rowhammer mitigations affordable

PropertyDefault DRAM mappingRubix-S (static randomized)Rubix-D (dynamic)
Line-to-row mapping
Hot rows per config
Overhead at threshold 128
Resists an adaptive attacker
Storage
The default spatial mapping funnels a hot data structure's activations into a few hot rows, so secure mitigations fire constantly and cost 15 to 600% at low thresholds. Rubix scatters consecutive lines across rows with a randomized mapping, cutting hot rows about 220x and the overhead to 1 to 3% in under a kilobyte, without weakening security — and Rubix-D re-randomizes continuously to defeat an attacker who might learn a static layout.Underlined values explain themselves when clicked.

Check yourself

Check your understanding

  1. 1. Secure Rowhammer mitigations cost little today but become prohibitive (up to 600%) at low thresholds. Rubix reduces this dramatically without making any single mitigation cheaper. Predict how.

  2. 2. Hot rows are what make the mitigations fire, and Rubix eliminates most of them by randomizing the line-to-row mapping. Predict why randomization is the right tool.

  3. 3. Rubix-S uses a fixed randomized mapping, but Rubix-D re-randomizes it continuously. Predict what threat this addresses and why re-randomization defeats it.

  4. 4. Rubix provides no Rowhammer security guarantee of its own, yet it is presented as a security contribution. Predict how to make sense of that.

Sources

Related papers on Security, Privacy & Trusted Execution

See all 153 →