CMU-SAFARI / rowhammer

Source code for testing the Row Hammer error mechanism in DRAM devices. Described in the ISCA 2014 paper by Kim et al. at http://users.ece.cmu.edu/~omutlu/pub/dram-row-hammer_isca14.pdf.
GNU General Public License v2.0
214 stars 42 forks source link

rowhammer

Memory tester for RowHammer. (Built on top of Memtest86+ v5.01.)

RowHammer is a new type of memory failure that is found only in recent generations of DRAM chips [1]. Just by reading from the same address >100K times, it is possible to corrupt data in nearby addresses. More technically, repeated "activations" to the same DRAM row corrupts data in adjacent DRAM rows.

RowHammer is a security threat since it allows a malicious program to breach memory protection. This is because different DRAM rows are mapped to different software pages. As of mid-2014, the problem is not well publicized.

[1] Kim et al. Flipping Bits in Memory Without Accessing Them. ISCA 2014.

Getting Started

There are two ways of starting the test: from a bootloader or from a disk.

Running the Test

After the Memtest86+ screen appears, the RowHammer test will start to run automatically after several seconds of delay. The test will continue to run until the progress bar on the upper-right corner of the screen reaches 100%. At this time (or any other time), you can press 'ESC' to reboot the system.

At a high level, the test consists of six steps. (For more details, please refer to Section 4 of our paper [1].)

  1. Populate entire DRAM with all '0's.
  2. Repeatedly read from a pair of DRAM rows in an interleaved manner.
    • This ensures that both DRAM rows are repeatedly activated.
  3. Repeat Step 2 for different pairs of DRAM rows.
  4. Check DRAM for errors (i.e., '1's).
  5. Print errors on screen in bright red.
  6. Repeat Steps 1-5 for all '1's.

Caveats

The RowHammer test is not comprehensive. Passing the test does not guarantee that your DRAM is free from errors. This is because of three reasons.

By overcoming all of the above, it is possible to increase the number of errors by many orders of magnitude. As an example, we were able to increase the number of errors from 1,000 to 10,000,000 for the exceptionally problematic DRAM module. The latter number was obtained using custom-built hardware equipment that allows us to test every row in the DRAM module (within a relatively short amount of time) using the best access-pattern and the best data-pattern. (For more details, please refer to Section 5 of our paper [1].)

Contributors