There’s a new way to flip bits in DRAM, and it works against the latest defenses
Full article2,113 words · extracted from arstechnica.com · click to collapse
SON OF ROWHAMMER
New technique produces lots of bitflips and could one day help form an attack.
In 2015, researchers reported a surprising discovery that stoked industry-wide security concerns—an attack called RowHammer that could corrupt, modify, or steal sensitive data when a simple user-level application repeatedly accessed certain regions of DDR memory chips. In the coming years, memory chipmakers scrambled to develop defenses that prevented the attack, mainly by limiting the number of times programs could open and close the targeted chip regions in a given time.
Recently, researchers devised a new method for creating the same types of RowHammer-induced bitflips even on a newer generation of chips, known as DDR4, that have the RowHammer mitigations built into them. Known as RowPress, the new attack works not by “hammering” carefully selected regions repeatedly, but instead by leaving them open for longer periods than normal. Bitflips refer to the phenomenon of bits represented as ones change to zeros and vice versa.
Further amplifying the vulnerability of DDR4 chips to read-disturbance attacks—the generic term for inducing bitflips through abnormal accesses (i.e., activations) to memory chips—RowPress bitflips can be enhanced by combining them with RowHammer accesses. Curiously, raising the temperature of the chip also intensifies the effect.
“We demonstrate a proof of concept RowPress program that can cause bitflips in a real system that already employs protections against RowHammer,” Onur Mutlu, a professor at ETH Zürich and a co-author of a recently published paper titled RowPress: Amplifying Read Disturbance in Modern DRAM Chips, wrote in an email. “Note that this is not in itself an attack. It simply shows that bitflips are possible and plenty, which can easily form the basis of an attack. As many prior works in security have shown, once you can induce a bitflip, you can use that bitflip for various attacks.”
DIMMs, bits, and cosmic rays
The basic building block of DRAM (dynamic random access memory) is a storage cell. Each cell comprises a capacitor and a transistor and stores a single bit of data. When a bit is put into a memory cell, the transistor is used to charge or discharge the capacitor. A charged capacitor is represented with a 1, while a discharged capacitor is represented with a 0. Most often, DRAM cells are organized into a rectangular array of rows and columns.
Diagram illustrating the heirarchical organization of a DRAM chip.
Diagram illustrating the heirarchical organization of a DRAM chip.
These rows and columns are arranged into ranks and banks to form what’s known as the dual in-line memory module. Better known as a DIMM, this rectangular stick plugs into the computer motherboard. When a computer accesses a chunk of memory, it opens the rows to the cells storing the desired data and transfers it to the CPU.
Photo of a DIMM.
Photo of a DIMM. Credit: PantheraLeo1359531
Bitflips have long been known as a rare, naturally occurring phenomenon. They occur when an unexpected flow of electrons within a transistor’s gates changes the voltage between the source, or the part of the circuit where flow originates, and the sink, where the flow is received. During a 2003 election in Belgium, cosmic rays from outer space are widely believed to have caused bitflips that gave a political candidate an additional 4,096 votes before being corrected. (The number 4,096, which can also be expressed as 212, suggests there was a bitflip in the 12th bit.)
Then, in 2014, discovered a previously unknown way to artificially induce bitflips at will. When a computer repeatedly hammered a DRAM row, they found they could induce bitflips in adjacent rows. In RowHammer parlance, the row that gets hammered is known as the aggressor row. The row where bits are flipped is known as the victim row.
A year later, researchers on Google’s Project Zero vulnerability team devised several ways to weaponize the phenomenon. In one instance, their RowHammer app changed memory contents in a way that gave the low-privilege app unfettered administrative control, which would allow the app to install malware, access passwords, and perform similarly sensitive actions. In another instance, the app flipped bits in a way that allowed it to break out of a security sandbox.
In the years since, researchers have developed an array of new RowHammer variations. Double-sided RowHammer offers more fine-grained control of bitflips. It repeatedly hammers two aggressor rows at once to induce bitflips in nearby victim rows. The increased precision led to techniques such as Flip Feng Shui, which, theoretically, could target sensitive data stored in cloud-hosting environments.
RowHammer threatens a critical property for security known as memory isolation. It holds that accessing one address inside a memory table shouldn’t have unintended consequences on data stored in other addresses. RowHammer has the potential to completely undermine this principle and, with it, the integrity of the entire system.
The industry already had one key defense in the form of what’s known as ECC, short for error-correcting code. ECC works by using what are known as memory words to store redundant control bits next to the data bits inside the DIMMs. CPUs use these words to quickly detect and repair flipped bits. ECC has been defeated in RowHammer attacks against older DDR3 memory, and some researchers theorize it may be possible to defeat ECC in DDR4 as well.
As a fallback, modern DDR4 chips equipped with ECC typically provide another form of protection against read disturbance. Known as Target Row Refresh or simply TRR, the defense monitors the number of times a row is accessed, and when a certain threshold is reached, it recharges neighboring rows that may have had their bits flipped as a result. A RowHammer attack devised in 2021 successfully defeated that protection as well.
The researchers who developed RowPress discovered that TRR isn’t well suited to prevent their attack either. RowPress-induced bitflips aren’t merely the result of accessing one or more aggressor rows in rapid succession. Rather, they’re the product of three variables: (1) the amount of time an aggressor row is left open—which they denote as tAggON—(2) the minimum number of accesses required—represented as ACmin—and (3) the temperature of the DIMM.
Significantly amplifying DRAM’s vulnerability
“We show that keeping a DRAM row (i.e., aggressor row) open for a long period of time (i.e., a large aggressor row on time, tAggON) disturbs physically nearby DRAM rows,” the researchers wrote in their paper. “Doing so induces bitflips in the victim row without requiring (tens of) thousands of activations to the aggressor row. We characterize RowPress in 164 off-the-shelf DDR4 DRAM chips from all three major manufacturers and find that RowPress significantly amplifies DRAM’s vulnerability to read-disturb attacks (i.e., greatly reduces the minimum number of total aggressor row activations to cause at least one bitflip, ACmin.
Diagram showing the distributions of conventional RowHammer in three representative cases of RowPress across 164 DDR4 chips from all three major manufacturers.
Diagram showing the distributions of conventional RowHammer in three representative cases of RowPress across 164 DDR4 chips from all three major manufacturers.
As the above figure illustrates, keeping an aggressor row open for optimal amounts of time reduces the number of activations required by one to two orders of magnitude, or roughly 10 to 100 times. In some cases—usually when the tAggON activation period reaches about 30 milliseconds—a single activation was enough to cause a bitflip. Mutlu said his team considers this extreme scenario to be unrealistic because memory controllers aren’t intended to keep rows open for such a long interval. He said that studying the case nonetheless helps in understanding the fundamental properties at play with RowPress.
The drastic reduction in the number of activations required, in turn, allows RowPress to create bitflips even when DIMMs are protected with TRR. The researchers wrote:
We conclude that, with a user-level program on a real DDR4-based Intel system with TRR protection, 1) RowPress induces bitflips when RowHammer cannot, 2) RowPress induces many more bitflips than RowHammer, and 3) increasing tAggON up to a certain value increases RowPress-induced bitflips and number of rows with such bitflips. Thus, read-disturb-based attacks on real systems can leverage RowPress to be more effective despite the existence of periodic auto-refresh and in-DRAM target row refresh mechanisms employed by the manufacturer.
The number of bitflips produced is a function of both the RowPress effect (i.e., the amount of time a row is open) and the RowHammer effect (i.e., the number of activations). The number of bitflips induced involves an intricate interplay between these two variables. The longer a row is kept open, the fewer activations are needed. Keeping rows open for shorter periods increased the number of activations required. The researchers presented experimental results that demonstrate what combination of these two variables produce the most bitflips.
Most of the bitflips produced by RowPress are fundamentally different from RowHammer bitflips. The researchers explained in their paper:
An overwhelming majority of the DRAM cells vulnerable to RowPress are not vulnerable to RowHammer or data retention failures.
For tAggON ≥ 7.8 μs, on average, only less than 0.013% of DRAM cells vulnerable to RowPress overlap with those vulnerable to RowHammer, and less than 0.34% overlap with retention failures. Therefore, an overwhelming majority of RowPress bitflips are different from those caused by RowHammer and retention failures. These results suggest that different failure mechanisms lead to RowPress and RowHammer bitflips.
Chart Overlap ratio of RowPress-vulnerable cells with RowHammer (first row) and retention failures (second row).
Chart Overlap ratio of RowPress-vulnerable cells with RowHammer (first row) and retention failures (second row).
The paper went on to observe:
Our experimental characterization of 164 real DRAM chips reveals that RowPress 1) has a different underlying mechanism from the well-studied RowHammer phenomenon, 2) greatly amplifies DRAM’s vulnerability to read disturbance by reducing the number of activations to induce a bitflip by one to two orders of magnitude (and in extreme cases to only a single activation), and 3) becomes worse as DRAM technology node size reduces. We demonstrate that a user-level program causes RowPress bitflips in a real system, even in the presence of in-DRAM read-disturb mitigation mechanisms, much more so than the bitflips RowHammer can induce.
As noted earlier, the researchers also found that the temperature of a DRAM chip affected the RowPress-induced bitflips as well. Specifically, the hotter the silicon, the more bitflips any combinations of the technique produced.
Assessing and mitigating risk
DRAM from all three major manufacturers—Samsung, Hynix, and Micron—are all vulnerable to RowPress, even when they’re equipped with the latest defenses, such as ECC and TRR. The reason: These protections track the number of activations, but they don’t consider how long a row is left open. The researchers have proposed a defense that can mitigate the RowPress-induced bitflips. The researchers have proposed changes that would track both.
“We also suggest that a row should not be kept open too long (and should be closed based on an empirically determined threshold value),” Mutlu wrote in an email. The research paper outlines other solutions as well. The paper estimates that the decline in performance resulting from the proposed mitigations is 1 to 2 percent on average but that “some workloads suffer more.” He said the proposed changes would likely increase manufacturing costs “because RowPress mitigations require more information about a DRAM chip and slightly more circuitry than the baseline RowHammer solutions.”
In a statement, Samsung officials wrote: “Samsung is aware of industry concerns around the latest DDR4 DRAM RowPress attack scenario and has been implementing measures in tandem with industry partners to counter such schemes. We remain committed to continually improving our mitigation techniques as the industry looks to collaboratively refining them through standards and with other major stakeholders from the component to system levels.”
Hynix and Micron representatives didn’t return an email seeking comment.
Without more research, it’s impossible to gauge the precise threat RowPress poses. One avenue that needs to be investigated is whether the technique can produce bitflips with enough surgical precision to affect the types of real-world attacks possible with RowHammer. Everyday end users face no threat from RowPress for the time being. People designing hardware should stay tuned.
Post updated to change “the newest” to “a newer” in the second paragraph, and to correct who initially discovered the Rowhammer effect.
Dan Goodin is Senior Security Editor at Ars Technica, where he oversees coverage of malware, computer espionage, botnets, hardware hacking, encryption, and passwords. In his spare time, he enjoys gardening, cooking, and following the independent music scene. Dan is based in San Francisco. Follow him at here on Mastodon and here on Bluesky. Contact him on Signal at DanArs.82.
Text extracted automatically; images, tables and formatting may be missing. Original: https://arstechnica.com/security/2023/10/theres-a-new-way-to-flip-bits-in-dram-and-it-works-against-the-latest-defenses/