Demonstrating Rowhammer Attacks on NVIDIA GPUs: A Step-by-Step Guide for Security Researchers

By

Introduction

Recent research has shown that Rowhammer attacks, long known to threaten CPUs, now pose a serious risk to NVIDIA GPUs from the Ampere generation. Two independent teams demonstrated attacks—GDDRHammer and GeForge—that exploit bit flips in GDDR6 memory to achieve arbitrary read/write access to GPU memory, and ultimately full compromise of the host CPU’s memory. A third attack even works with IOMMU enabled. This guide walks you through the step‑by‑step methodology used by researchers to reproduce these attacks in a controlled, ethical environment.

Demonstrating Rowhammer Attacks on NVIDIA GPUs: A Step-by-Step Guide for Security Researchers
Source: www.schneier.com

What You Need

Step‑by‑Step Procedure

Step 1: Prepare the System and Disable IOMMU

Ensure your test system has the vulnerable GPU installed. By default, IOMMU is disabled in BIOS—this is required for GDDRHammer and GeForge to trigger the necessary bit flips. Verify this setting and, if you plan to test the third attack, leave IOMMU enabled. Boot into your operating system and install the latest NVIDIA drivers and CUDA toolkit.

Step 2: Perform Memory Massaging to Align Data

Memory massaging is critical to position sensitive data (e.g., page table entries) in DRAM rows that are adjacent to attacker‑controlled rows. Use custom CUDA kernels to allocate and release memory in a pattern that forces the GPU’s memory controller to place your data next to the target page tables. This step requires careful tuning of allocation sizes and order to achieve the desired row adjacency.

Step 3: Apply Specialized Hammering Patterns

Traditional rowhammer patterns (repeatedly accessing two rows) are insufficient for GDDR6 because of its different timing characteristics. The researchers developed novel patterns that rapidly toggle between rows at high frequencies while respecting GDDR6’s refresh and timing constraints. Use the provided exploit code to issue a sequence of memory reads/writes that cause electromagnetic disturbances, leading to bit flips in adjacent rows.

Step 4: Induce Controlled Bit Flips in GPU Page Tables

The goal is to flip specific bits in the GPU’s last‑level page table (GDDRHammer) or last‑level page directory (GeForge). By monitoring which bits flip and adjusting the hammering pattern, you can corrupt entries that control physical address mappings. GDDRHammer reported 1,171 bitflips on the RTX 3060 and 202 on the RTX 6000; GeForge achieved similar numbers.

Demonstrating Rowhammer Attacks on NVIDIA GPUs: A Step-by-Step Guide for Security Researchers
Source: www.schneier.com

Step 5: Escalate to Arbitrary Read/Write Access

Once page table entries are corrupted, the GPU can be tricked into mapping arbitrary physical memory into its address space. This grants the attacker’s code full read and write capabilities over the GPU’s memory region. From here, you can access caches, registers, and any data residing in GPU RAM.

Step 6: Compromise Host CPU Memory

Because the GPU is a PCIe device, exploiting its memory access rights often allows you to reach the host CPU’s DDR memory (if IOMMU is off). By crafting malicious DMA requests, you can read and write kernel structures, user‑space data, or even overwrite page table entries of the CPU. This leads to full system compromise of the host machine.

Step 7: Achieve Privilege Escalation and Execute Commands

In the GeForge proof‑of‑concept, the final step involves opening a root shell on the host. Using the arbitrary memory access obtained, the attacker overwrites kernel code or modifies permission bits to spawn a shell with elevated privileges. Similar results were demonstrated against the RTX A6000, even with IOMMU enabled in the third attack.

Tips and Considerations

Tags:

Related Articles

Recommended

Discover More

Wingtech's $1.3 Billion Loss and Delisting Risk: What Happened and What It MeansAI and Energy Synergy: How the Genesis Mission Is Forging American LeadershipAWS Advances Autonomous Operations with General Availability of DevOps and Security Agents, Plus Key Service Lifecycle ChangesHow to Evaluate the Impact of Removing Open-Source Code for AI Security in HealthcareActive Cooling Unlocks Sustained 80Gbps Speeds in the Satechi DotDisk SSD Enclosure