World Library  
Flag as Inappropriate
Email this Article

Row hammer

Article Id: WHEBN0045634177
Reproduction Date:

Title: Row hammer  
Author: World Heritage Encyclopedia
Language: English
Subject: WikiProject Electronics/Assessment, Did you know nominations/Row hammer, Vector (malware), Mac, Project Zero (Google)
Publisher: World Heritage Encyclopedia

Row hammer

Row hammer (also written as rowhammer) is an unintended side effect in dynamic random-access memory (DRAM) that causes memory cells to leak their charges and interact electrically between themselves, possibly altering the contents of nearby memory rows that were not addressed in the original memory access. This circumvention of the isolation between DRAM memory cells results from the high cell density in modern DRAM, and can be triggered by specially crafted memory access patterns that rapidly activate the same memory rows numerous times.[1][2][3]

The row hammer effect has been used in some privilege escalation computer security exploits.[2][4] Different hardware-based techniques exist to prevent the row hammer effect from occurring, including required support in some processors and types of DRAM memory modules.[5][6]


  • Background 1
  • Overview 2
    • Mitigation 2.1
  • Implications 3
    • Exploits 3.1
  • See also 4
  • Notes 5
  • References 6
  • External links 7


A high-level illustration of DRAM organization (further described in the article)

In refreshing the data.[7][8]

Memory cells (blue squares in the illustration provided in this section) are further organized into matrices and addressed through rows and columns. A memory address applied to a matrix is broken into the row address and column address, which are processed by the row and column address decoders (in the illustration, vertical and horizontal green rectangles, respectively). After a row address selects the row for a read operation (the selection is also known as row activation), bits from all cells in the row are transferred into the sense amplifiers that form the row buffer (red squares in the illustration), from which the exact bit is selected using the column address. Read operations are of a destructive nature because the design of DRAM requires memory cells to be rewritten after their values have been read. Write operations decode the addresses in a similar way, but as a result of the design entire rows must be rewritten for the value of a single bit to be changed.[1]:2–3[7][8][9]

As a result of storing data bits using capacitors that have a natural discharge rate, DRAM memory cells lose their state over time and require periodic rewriting of all memory cells, which is a process known as refreshing.[1]:3[7] As another result of the design, DRAM memory is susceptible to random changes in stored data, which are known as soft memory errors and attributed to cosmic rays and other causes. There are different techniques that counteract soft memory errors and improve the reliability of DRAM, of which error-correcting code (ECC) memory and its advanced variants (such as lockstep memory) are most commonly used.[10]


Rapid row activations (purple row) may change the values of bits stored in victim rows (yellow rows).[11]:2

Increased densities of DRAM integrated circuits (ICs) have led to physically smaller memory cells capable of storing smaller charges, resulting in lower operational noise margins, increased rates of electromagnetic interactions between memory cells, and greater possibility of data loss. As a result, disturbance errors have been observed, being caused by cells interfering with each other's operation and manifesting as random changes in the values of bits stored in affected memory cells. The awareness of disturbance errors dates back to the early 1970s and Intel 1103 as the first commercially available DRAM IC; since then, DRAM manufacturers have employed various mitigation techniques to counteract disturbance errors, such as improving the isolation between cells and performing production testing. However, researchers proved in a 2014 analysis that commercially available DDR3 DRAM chips manufactured in 2012 and 2013 are susceptible to disturbance errors, while using the term row hammer to name the associated side effect that led to observed bit flips.[1][3][11]

The opportunity for the row hammer effect to occur in DDR3 memory[12] is primarily attributed to DDR3's high density of memory cells and the results of associated interactions between the cells, while rapid DRAM row activations have been determined as the primary cause. Frequent row activations cause voltage fluctuations on the associated row selection lines, which have been observed to induce higher-than-natural discharge rates in capacitors belonging to nearby (adjacent, in most cases) memory rows, which are called victim rows; if the affected memory cells are not refreshed before they lose too much charge, disturbance errors occur. Tests show that a disturbance error may be observed after performing around 139,000 subsequent memory row accesses (with cache flushes), and that up to one memory cell in every 1,700 cells may be susceptible. Those tests also show that the rate of disturbance errors is not substantially affected by increased environment temperature, while it depends on the actual contents of DRAM because certain bit patterns result in significantly higher disturbance error rates.[1][2][11][13]

A variant called double-sided hammering involves targeted activations of two DRAM rows surrounding a victim row: in the illustration provided in this section, this variant would be activating both yellow rows with the aim of inducing bit flips in the purple row, which in this case would be the victim row. Tests show that this approach may result in a significantly higher rate of disturbance errors, compared to the variant that activates only one of the victim row's neighbouring DRAM rows.[4][14]:19–20[15]


Different methods exist for more or less successful detection, prevention, correction or mitigation of the row hammer effect. Tests show that simple ECC solutions, providing single-error correction and double-error detection (SECDED) capabilities, are not able to correct or detect all observed disturbance errors because some of them include more than two flipped bits per memory word.[1]:8[11]:32 A less effective solution is to introduce more frequent memory refreshing, with the refresh intervals shorter than the usual 64 ms,[1] but this technique results in higher power consumption and increased processing overhead; some vendors provide firmware updates that implement this type of mitigation.[16] One of the more complex prevention measures performs counter-based identification of frequently accessed memory rows and proactively refreshes their neighboring rows; another method issues additional infrequent random refreshes of memory rows neighboring the accessed rows regardless of their access frequency. Research shows that these two prevention measures cause negligible performance impacts.[1]:10–11[17]

Since the release of Ivy Bridge microarchitecture, Intel Xeon processors support the so-called pseudo target row refresh (pTRR) that can be used in combination with pTRR-compliant DDR3 dual in-line memory modules (DIMMs) to mitigate the row hammer effect by automatically refreshing possible victim rows, with no negative impacts on performance or power consumption. When used with DIMMs that are not pTRR-compliant, these Xeon processors by default fall back on performing DRAM refreshes at twice the usual frequency, which results in slightly higher memory access latency and may reduce the memory bandwidth by up to 2–4%.[5]

DDR4 memory employs hardware support for the so-called target row refresh (TRR) that prevents the row hammer effect without negatively impacting performance or power consumption.[6][18] Internally, TRR identifies possible victim rows, by counting the number of row activations and comparing it against predefined chip-specific maximum activate count (MAC) and maximum activate window (tMAW) values, and refreshes these rows to prevent bit flips. The MAC value is the maximum total number of row activations that may be encountered on a particular DRAM row within a time interval that is equal or shorter than the tMAW amount of time before its neighbouring rows are identified as victim rows; TRR may also flag a row as a victim row if the sum of row activations for its two neighboring rows reaches the MAC limit within the tMAW time window.[19]

Due to their necessity of huge numbers of rapidly performed DRAM row activations, row hammer exploits issue large numbers of uncached memory accesses that cause cache misses, which can be detected by monitoring the rate of cache misses for unusual peaks using hardware performance counters.[4] Version 6.0.0 of the memtest86 memory diagnostic software, released on February 13, 2015, includes a so-called hammer test that checks whether computer hardware is susceptible to disturbance errors.[20]


Memory protection, as a way of preventing processes from accessing memory that has not been assigned to each of them, is one of the concepts behind most modern operating systems. By using memory protection in combination with other security-related mechanisms such as protection rings, it is possible to achieve privilege separation between processes, in which programs and computer systems in general are divided into parts limited to the specific privileges they require to perform a particular task. Using privilege separation can also reduce the extent of potential damage caused by computer security attacks by restricting their effects to specific parts of the system.[21][22]

Disturbance errors (explained in the section above) effectively defeat various layers of memory protection by "short circuiting" them at a very low hardware level, practically creating a unique attack vector type that allows processes to alter the contents of arbitrary parts of the main memory by directly manipulating the underlying memory hardware.[2][4][14][23] In comparison, "conventional" attack vectors such as buffer overflows aim at circumventing the protection mechanisms at the software level, by exploiting various programming mistakes to achieve alterations of otherwise inaccessible main memory contents.[24]


  mov (X), %eax  // read from address X
  mov (Y), %ebx  // read from address Y
  clflush (X)    // flush cache for address X
  clflush (Y)    // flush cache for address Y
  jmp code1a
A snippet of x86 assembly code that induces the row hammer effect (memory addresses X and Y must map to different DRAM rows in the same memory bank)[1]:3[4][14]:13–15

The initial research into the row hammer effect, publicized by a group of authors in June 2014, described the nature of disturbance errors and indicated the potential for constructing an attack, but did not provide any examples of a working security exploit.[1] Another research paper, created by a group of authors and published in October 2014, did not imply the existence any security-related issues arising from the row hammer effect.[12]

On March 9, 2015, Google's Project Zero revealed two working privilege escalation exploits based on the row hammer effect, establishing its exploitable nature on the x86-64 architecture. One of the revealed exploits targets the Google Native Client (NaCl) mechanism for running a limited subset of x86-64 machine instructions within a sandbox,[14]:27 exploiting the row hammer effect to escape from the sandbox and gain the ability to issue system calls directly. This NaCl vulnerability, tracked as CVE-2015-0565, has been mitigated by modifying the NaCl so it does not allow execution of the clflush (cache line flush[25]) machine instruction, which has been found to be required for constructing an effective row hammer attack.[2][4][23]

The second exploit revealed by Project Zero runs as an unprivileged Linux process on the x86-64 architecture, exploiting the row hammer effect to gain unrestricted access to all physical memory installed in a computer. By combining the disturbance errors with memory spraying, this exploit is capable of altering page table entries (PTEs)[14]:35 used by the virtual memory system for mapping virtual addresses to physical addresses, which results in the exploit gaining unrestricted memory access.[14]:34,36–57 Due to its nature and the inability of the x86-64 architecture to make clflush a privileged machine instruction, this exploit can hardly be mitigated on computers that do not use hardware with built-in row hammer prevention mechanisms. While testing the viability of exploits, Project Zero found that about half of the 29 tested laptops experienced disturbance errors, with some of them occuring on vulnerable laptops in less than five minutes of running row-hammer-inducing code; the tested laptops were manufactured between 2010 and 2014 and used non-ECC DDR3 memory.[2][4][23]

In July 2015, a group of security researchers published a paper that describes an architecture- and instruction-set-independent way for exploiting the row hammer effect. Instead of relying on the clflush instruction to perform cache flushes, this approach achieves uncached memory accesses by causing a very high rate of cache eviction using carefully selected memory access patterns. Although the cache replacement policies differ between processors, this approach overcomes the architectural differences by employing an adaptive cache eviction strategy algorithm.[14]:64–68 The proof of concept for this approach is provided both as a native code implementation, and as a pure JavaScript implementation that runs on Firefox 39. The JavaScript implementation, called Rowhammer.js,[26] uses large typed arrays and relies on their internal allocation using large pages; as a result, it demonstrates a very high-level exploit of a very low-level vulnerability.[27][28]

See also

  • Memory scrambling – memory controller feature that turns user data written to the memory into pseudo-random patterns
  • Radiation hardening – the act of making electronic components resistant to damage or malfunctions caused by ionizing radiation
  • Single event upset (SEU) – a change of state caused by ions or electromagnetic radiation striking a sensitive node in an electronic device
  • Soft error – a type of error involving erroneous changes to signals or data but no changes to the underlying device or circuit


  1. ^ Research shows that the rate of disturbance errors in a selection of DDR3 memory modules closes to zero when the memory refresh interval becomes roughly seven times shorter than the default of 64 ms.[11]:17,26


  1. ^ a b c d e f g h i Yoongu Kim; Ross Daly; Jeremie Kim; Chris Fallin; Ji Hye Lee; Donghyuk Lee; Chris Wilkerson; Konrad Lai; Onur Mutlu (June 24, 2014). "Flipping Bits in Memory Without Accessing Them: An Experimental Study of DRAM Disturbance Errors" (PDF).  
  2. ^ a b c d e f Dan Goodin (March 10, 2015). "Cutting-edge hack gives super user status by exploiting DRAM weakness".  
  3. ^ a b Paul Ducklin (March 12, 2015). Row hammering' – how to exploit a computer by overworking its memory"'".  
  4. ^ a b c d e f g Mark Seaborn; Thomas Dullien (March 9, 2015). "Exploiting the DRAM rowhammer bug to gain kernel privileges".  
  5. ^ a b Marcin Kaczmarski (August 2014). "Thoughts on Intel Xeon E5-2600 v2 Product Family Performance Optimisation – Component selection guidelines" (PDF).  
  6. ^ a b Marc Greenberg (October 15, 2014). "Reliability, Availability, and Serviceability (RAS) for DDR DRAM interfaces" (PDF). pp. 2, 7, 10, 20, 27. Retrieved March 11, 2015. 
  7. ^ a b c "Lecture 12: DRAM Basics" (PDF). February 17, 2011. pp. 2–7. Retrieved March 10, 2015. 
  8. ^ a b "Understanding DRAM Operation" (PDF).  
  9. ^ David August (November 23, 2004). "Lecture 20: Memory Technology" (PDF). pp. 3–5. Archived from the original (PDF) on May 19, 2005. Retrieved March 10, 2015. 
  10. ^ Bianca Schroeder; Eduardo Pinheiro; Wolf-Dietrich Weber (June 25, 2009). "DRAM Errors in the Wild: A Large-Scale Field Study" (PDF).  
  11. ^ a b c d e Yoongu Kim; Ross Daly; Jeremie Kim; Chris Fallin; Ji Hye Lee; Donghyuk Lee; Chris Wilkerson; Konrad Lai; Onur Mutlu (June 24, 2014). "Flipping Bits in Memory Without Accessing Them: DRAM Disturbance Errors" (PDF). Retrieved March 10, 2015. 
  12. ^ a b Kyungbae Park; Sanghyeon Baeg; ShiJie Wen; Richard Wong (October 2014). "Active-Precharge Hammering on a Row Induced Failure in DDR3 SDRAMs under 3x nm Technology" (PDF).  
  13. ^ Yoongu Kim; Ross Daly; Jeremie Kim; Chris Fallin; Ji Hye Lee; Donghyuk Lee; Chris Wilkerson; Konrad Lai; Onur Mutlu (July 30, 2015). "RowHammer: Reliability Analysis and Security Implications" (PDF). Retrieved August 7, 2015. 
  14. ^ a b c d e f g Mark Seaborn; Thomas Dullien (August 6, 2015). "Exploiting the DRAM rowhammer bug to gain kernel privileges: How to cause and exploit single bit errors" (PDF).  
  15. ^ Andy Greenberg (March 10, 2015). "Googlers' Epic Hack Exploits How Memory Leaks Electricity".  
  16. ^ "Row Hammer Privilege Escalation (Lenovo Security Advisory LEN-2015-009)".  
  17. ^ Dae-Hyun Kim; Prashant J. Nair; Moinuddin K. Qureshi (October 9, 2014). "Architectural Support for Mitigating Row Hammering in DRAM Memories" (PDF).  
  18. ^ Omar Santos (March 9, 2015). "Mitigations Available for the DRAM Row Hammer Vulnerability". Retrieved March 11, 2015. 
  19. ^ "DDR4 SDRAM Data Sheet: 4 Gb ×4, ×8 and ×16 Features" (PDF).  
  20. ^ "PassMark MemTest86 – Version History". February 13, 2015. Retrieved March 11, 2015. 
  21. ^ Pehr Söderman (2011). "Memory Protection" (PDF). Retrieved March 11, 2015. 
  22. ^ Niels Provos; Markus Friedl; Peter Honeyman (August 10, 2003). "Preventing Privilege Escalation" (PDF). Retrieved March 11, 2015. 
  23. ^ a b c Liam Tung (March 10, 2015). Rowhammer" DRAM flaw could be widespread, says Google""".  
  24. ^ Murat Balaban (June 6, 2009). "Buffer Overflows Demystified" (TXT). Retrieved March 11, 2015. 
  25. ^ "CLFLUSH: Flush Cache Line (x86 Instruction Set Reference)". March 3, 2013. Retrieved August 6, 2015. 
  26. ^ Daniel Gruss; Clémentine Maurice (July 27, 2015). "IAIK/rowhammerjs: rowhammerjs/rowhammer.js at master". Retrieved July 29, 2015. 
  27. ^ Daniel Gruss; Clémentine Maurice; Stefan Mangard (July 27, 2015). "Rowhammer.js: A Remote Software-Induced Fault Attack in JavaScript" (PDF). Retrieved July 29, 2015. 
  28. ^ David Auerbach (July 28, 2015). "Rowhammer security exploit: Why a new security attack is truly terrifying". Retrieved July 29, 2015. 

External links

  • Some notes on DRAM (#rowhammer), March 9, 2015, by Robert Graham
  • Rowhammer hardware bug threatens to smash notebook security, InfoWorld, March 9, 2015, by Serdar Yegulalp
  • DDR3 Memory Known Failure Mechanism called "Row Hammer" on YouTube, July 17, 2014, by Barbara Aichinger
  • Patent US 20140059287 A1: Row hammer refresh command, February 27, 2014, by Kuljit Bains et al.
  • Row Hammer Privilege Escalation Vulnerability, Cisco Systems security advisory, March 11, 2015
  • ARMOR: A run-time memory hot-row detector, The University of Manchester, by Mohsen Ghasempour et al.
  • Using Memory Errors to Attack a Virtual Machine, March 6, 2003, by Sudhakar Govindavajhala and Andrew W. Appel
  • A program for testing for the DRAM "rowhammer" problem, source code on GitHub
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.