Rowhammer and RowPress: Implementation and Evaluation on AMD Zynq SoCs
Rowhammer and RowPress: Implementation and Evaluation on AMD Zynq SoCs
Introduction
The rapid increase in memory density over the last few decades has led to the discovery of the Rowhammer vulnerability in 2014 and the RowPress vulnerability in 2023. These vulnerabilities arise from insufficient electrical isolation between DRAM memory cells, potentially causing bit flip errors when DRAM rows are accessed in specific patterns.
While much research has focused on x86 architectures, this bachelor thesis explores the feasibility and impact of implementing Rowhammer attacks on ARM-based systems, specifically the AMD Zynq SoCs. The thesis examines the architecture, memory management, and caching policies of ARM systems to evaluate their resilience or susceptibility to Rowhammer. Although the Rowhammer attack is already well-documented and extensively researched, there is limited literature available on RowPress.
Research Objectives
The primary objective of this research is to evaluate the viability of Rowhammer and RowPress vulnerabilities on AMD Zynq SoCs. Key objectives include:
- Understanding the architectural differences between x86 and ARM in the context of DRAM vulnerabilities.
- Implementing Rowhammer on ARM-based SoCs and evaluating its effectiveness.
- Investigating the viability of RowPress on the Zynq SoC platform.
- Comparing the ARM-based findings with existing x86-based research.
Theoretical Background
DRAM Architecture
Dynamic Random Access Memory (DRAM) is a form of volatile memory that stores data in capacitors, which require periodic refreshing due to charge leakage, usually within 64 ms intervals. A typical DRAM module consists of multiple banks, each containing rows and columns of memory cells. Memory access in DRAM occurs when rows are opened (activated) and their contents read or modified in the row buffer. The vulnerability of DRAM to disturbances caused by repeated row activations leads to attacks such as Rowhammer and RowPress.
Rowhammer Attack
Rowhammer is a vulnerability that exploits the electrical interference between DRAM cells. By rapidly and repeatedly activating specific rows (aggressor rows), nearby rows (victim rows) encounter electrical interference, potentially causing bit flips. Rowhammer attacks can be classified into different patterns:
- **Single-sided Rowhammer:** Repeated access to one row adjacent to the target row.
- **Double-sided Rowhammer:** Accessing two rows on either side of the target row, increasing the likelihood of bit flips.
Double-sided Rowhammer is the most common variant.
Rowhammer has been widely studied on x86 systems, and advanced exploits have been developed.
RowPress Attack
RowPress is a more recent attack method discovered in 2023. Unlike Rowhammer, which relies on high-frequency row activations, RowPress induces bit flips by keeping a memory row open for extended periods (referred to as tAggON). The prolonged activation of an aggressor row can destabilize adjacent rows and cause data corruption. There is currently very little research on RowPress, and existing studies have only been done on highly specialized testing hardware.
ARM Architecture and Memory Access
ARM architectures, such as those used in the Zynq SoCs, differ from x86 in several key areas, particularly in memory access and cache management. ARM processors typically use a different set of instructions for cache maintenance, and direct memory access is handled differently. Furthermore, ARM-based systems often have more constrained memory controllers and may employ different policies for handling row activations, which affects the feasibility of attacks like Rowhammer and RowPress.
Methodology
AMD Zynq SoC Overview
The AMD Zynq-7000 SoC is an embedded development platform with a dual-core ARM Cortex-A9 processor with programmable logic (FPGA). The specific model used in this thesis, the Digilent Zybo Z7-20, includes 1 GB of DDR3L DRAM.
Development Environment
The development environment used for this research consists of AMD’s Vivado for hardware design and Vitis for program development. The hardware design created using Vivado includes the Zynq Processing System (Zynq PS) and the default DRAM memory configuration. Altering the DRAM parameters would not have aided in the experiments. The program, written in C, controls the memory access patterns and performs the Rowhammer tests.
DRAM Address Mapping
Understanding the specific DRAM address mapping functions is important for successfully targeting specific rows in a Rowhammer or RowPress attack. The address mapping functions translate a physical address to the exact location of the associated data on the DRAM module. By analyzing the Technical Reference Manual and configuration files, the exact address bits used for row, bank, and column mapping were identified. This allows for the precise selection of aggressor and victim rows in the memory tests.
Cache Management
One of the primary challenges in implementing Rowhammer on ARM systems is ensuring that memory accesses bypass the CPU caches and directly reach DRAM. Unlike x86 systems, ARM does not have a universal instruction like `clflush` for cache flushing. In this study, cache flushing was achieved using the Xilinx SDK's cache maintenance functions, and in some of the experiments, the data cache was completely disabled to ensure uncached memory access during the attacks.
Test Setup for Rowhammer
The Rowhammer test on the Zynq-7000 was designed to simulate a double-sided hammering pattern. First, specific memory locations were initialized with a known data pattern. Then, the aggressor rows surrounding a target row were repeatedly accessed for a large number of iterations, while cache flushes ensured that accesses were handled by DRAM, not the CPU cache. After hammering, the target and adjacent rows were checked for bit flips by comparing their data to the original pattern.
Test Setup for RowPress
Implementing RowPress on the Zynq-7000 presented significant challenges due to the limitations of the memory controller, which does not allow fine-grained control over row-open time (tAggON). The thesis highlights the possibility of using specific memory access patterns to cause the memory controller to prolong the row-open time without explicitly changing the timing configuration parameters. However, the viability of this approach depends on the row buffer management policy of the memory controller. It was concluded that RowPress is not viable on the selected hardware. Precise configurability of the memory controller is of utmost importance for RowPress.
Results
Rowhammer Results
Despite implementing double-sided hammering and flushing the CPU caches, no bit flips were observed during the Rowhammer tests on the Zynq-7000 platform. The potential reasons are manifold, and they are outlined in the thesis.
RowPress Results
The RowPress implementation faced even more significant challenges. The limited configurability of the memory controller on the Zynq-7000 meant that row-open time could not be extended as needed for RowPress. Further testing with hardware that provides more control over memory timing is required to evaluate RowPress effectively.
Conclusion
Rowhammer and RowPress represent critical vulnerabilities in DRAM that have been primarily explored on x86 systems. This research aimed to implement these vulnerabilities on ARM-based systems using the AMD Zynq SoC platform. While the Rowhammer and RowPress implementations on the Zynq-7000 did not result in observable bit flips, the research highlights the difficulty of replicating these attacks on ARM architectures. The findings suggest that further research is needed, particularly with more flexible hardware setups that allow better control over memory access patterns and timing.
Future Work
Future research should focus on testing Rowhammer and RowPress on a wider variety of ARM-based platforms and exploring more sophisticated methods for managing memory access and timing. Additionally, hardware that allows for finer control over memory controllers, such as FPGAs with more advanced DRAM interfaces, would be beneficial for testing these vulnerabilities.
References
H. Luo, A. Olgun et al., "RowPress: Amplifying Read Disturbance in Modern DRAM Chips," in *Proceedings of the 50th Annual International Symposium on Computer Architecture (ISCA)*, 2023.
Y. Kim, R. Daly et al., "Flipping bits in memory without accessing them: An experimental study of DRAM disturbance errors," in *Proc. 41st Int. Symp. Comput. Archit. (ISCA)*, 2014, pp. 361–372, doi: 10.1109/ISCA.2014.6853210.
D. Gruss and C. Maurice, "Rowhammer Attacks: A Walkthrough Guide," in *Proc. RuhrSec 2017*, Graz University of Technology, 2017. [Online]. Available: https://www.tugraz.at. [Accessed: Sept. 16, 2024].
Z. Zhang, Z. Zhan, D. Balasubramanian, X. Koutsoukos, and G. Karsai, "Triggering Rowhammer Hardware Faults on ARM: A Revisit," in *Proceedings of the 2018 Workshop on Attacks and Solutions in Hardware Security (ASHES '18)*, Toronto, Canada, 2018, pp. 24-33. doi: 10.1145/3266444.3266454.