TL;DR
This paper introduces PThammer, a novel "implicit hammer" rowhammer attack that bypasses existing software-only defenses by exploiting the CPU's address translation mechanism. By tricking the processor into accessing protected memory locations, PThammer can achieve kernel privilege escalation, demonstrating a significant threat to system security.
What Problem Does This Paper Address?
Rowhammer is a well-known hardware vulnerability in DRAM where repeatedly accessing certain memory rows can cause bit flips in adjacent rows. This can lead to data corruption and security breaches, including privilege escalation. Many proposed defenses focus on preventing attackers from directly accessing "hammer rows" – the memory locations used to trigger the bit flips. These defenses assume that an attacker must have explicit access to these hammer rows to launch an attack. This paper challenges that assumption, investigating whether rowhammer attacks are still feasible even when an attacker is denied direct access to exploitable hammer rows.
Methods
The core innovation of PThammer is the concept of "implicit hammer." Instead of directly accessing the hammer rows, PThammer exploits the processor's address translation process as a "confused deputy." When a program needs to access memory, the CPU translates virtual addresses to physical addresses. This process involves looking up entries in page tables, which are themselves stored in DRAM.
PThammer leverages this page-table walk mechanism. By carefully crafting memory accesses and using cache eviction techniques, the attacker can force the CPU to perform page-table walks that implicitly access specific Level-1 Page Table Entries (L1PTEs). If these L1PTEs reside in rows vulnerable to rowhammer, the repeated implicit accesses can induce bit flips. The attack specifically targets L1PTEs, which are crucial for mapping user memory to physical frames. By flipping a bit in an L1PTE, an attacker can gain control over a user page, which can then be used to map to any physical memory frame, thus achieving kernel privilege escalation.
Key techniques employed include:
- Cache Eviction: Using carefully constructed "eviction sets" to flush specific entries from the Translation Lookaside Buffer (TLB) and Last-Level Cache (LLC). This ensures that the CPU must perform a page-table walk to retrieve the required L1PTE from DRAM.
- Page Table Walk Exploitation: Targeting the path within the address translation process that results in a DRAM access for L1PTEs.
- Double-Sided Hammering: Applying the rowhammer technique to two L1PTEs that are likely to be in adjacent rows to increase the attack's efficiency.
- Memory Spraying: Allocating a large number of L1PT pages to increase the probability of finding a victim L1PTE in a vulnerable row.
Datasets
Not discussed in the paper. The evaluation is performed on real hardware configurations.
Key Insights and Ideas
- Implicit Access is a Powerful Attack Vector: The most significant insight is that attackers don't need direct access to hammer rows. By exploiting fundamental hardware mechanisms like address translation, they can indirectly trigger rowhammer, bypassing defenses that rely on explicit access control.
- Address Translation is a Vulnerable Component: The paper highlights that the very mechanism designed to protect memory (address translation) can be subverted to attack it. The page-table walk, a routine operation, becomes an attack primitive.
- Software-Only Defenses are Insufficient: PThammer demonstrates that existing software-only defenses, which focus on isolating hammer rows, are vulnerable because they don't account for implicit accesses.
- Timing and Cache Management are Crucial: The success of PThammer hinges on precise timing and effective cache eviction to ensure DRAM accesses occur frequently enough to induce bit flips without being too slow to be practical.
Key Results
- Successful Kernel Privilege Escalation: PThammer was successfully implemented and demonstrated to achieve kernel privilege escalation on multiple hardware configurations.
- Bypasses Existing Defenses: The attack was shown to overcome three prominent software-only rowhammer defenses: CATT, RIP-RH, and CTA. Notably, it was the first attack to compromise the CTA defense.
- Fast Attack Times: The first bit flip was observed within 15 minutes of double-sided hammering in most test scenarios.
- Efficiency: The attack's performance was evaluated across different machines and system settings (with and without superpages), showing consistent effectiveness. The time cost per hammering round was well below the maximum allowed to induce bit flips.
Limitations and Future Work
- DRAM Vulnerability: The attack relies on the underlying DRAM being vulnerable to rowhammer. While modern DRAM is generally susceptible, specific modules might have built-in mitigations.
- ZebRAM Defense: The paper acknowledges that PThammer does not overcome the ZebRAM defense, though it notes ZebRAM's high performance overhead and reliance on unproven assumptions.
- Hardware Variations: While tested on multiple Intel architectures, the specific effectiveness might vary across different CPU architectures and DRAM generations. The paper mentions applicability to DDR4.
- Future Work: The authors suggest exploring other instances of implicit hammer by leveraging other hardware (e.g., out-of-order execution, speculative execution) and software (e.g., system call handlers, network I/O) features. They also point out that cache designs that randomize TLB/cache indexing or prevent eviction set creation could mitigate PThammer. The paper also notes that while PThammer can be slowed down by longer eviction times, it remains effective.
Summary updated