# 行锤

**行锤**（Row hammer，也写作 **Rowhammer**）是[动态随机存取存储器](https://www.edgepedia.org/zh/dynamic-random-access-memory)（DRAM）中的一种安全漏洞与干扰现象：反复激活或“锤击”一行存储单元，会诱使物理上相邻、攻击者从未访问过的行发生位翻转。这一效应的根源在于，随着制造商不断缩小芯片特征尺寸，DRAM 单元被做得越来越小、彼此越来越近，因此激活一行会在电气上干扰其邻居，并可能向相邻单元注入电荷或从中泄漏电荷，直到存储的 1 变成 0，或反之。<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup> 这一现象最初只是可靠性问题，后被研究人员发展为跨个人电脑、云服务器、移动设备和 GPU 的提权、沙箱逃逸与远程利用技术。<sup>[2](https://comsec-files.ethz.ch/papers/eccploit_sp19.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 机制 | 反复激活“攻击行”会干扰相邻“受害行”中的电荷，在未访问这些行的情况下翻转位<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup> |
| 首篇论文 | 金永九（Yoongu Kim）等人，《不访问内存而翻转位》，2014 年，研究对象为当时主流的 DDR3<sup>[3](https://security.googleblog.com/2021/05/introducing-half-double-new-hammering.html)</sup> |
| 首个利用 | 谷歌零号项目（Google Project Zero），2015 年：在 x86-64 Linux 上由非特权进程通过页表项中的位翻转实现内核提权<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup> |
| 刷新窗口 | 相邻行通常约每 64 毫秒自动刷新一次；锤击必须在两次刷新之间累积足够多的激活次数<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup> |
| DDR4 状况 | TRRespass（2020）显示，三大厂商的 42 个 DDR4 模组中有 13 个仍然存在漏洞，最多使用 19 个攻击行绕过目标行刷新<sup>[4](https://arxiv.org/abs/2004.01807)</sup> |
| DDR5 状况 | Phoenix（2025）在 SK 海力士（SK Hynix）DIMM 上，于量产 DDR5 台式机上仅用 109 秒即实现首个行锤提权；编号 CVE-2025-6202<sup>[5](https://comsec.ethz.ch/research/dram/phoenix/)</sup><sup> • </sup><sup>[6](https://www.techradar.com/pro/security/new-phoenix-rowhammer-attack-cracks-open-ddr5-memory-defenses-in-minutes)</sup> |
| GPU | GPUHammer（2025）在独立 GPU（配备 GDDR6 的英伟达 A6000）上展示了首个行锤攻击，跨 4 个 bank 翻转最多 8 位，单次翻转就使一个 AI 模型的准确率从 80% 降至 0.1%<sup>[7](https://arxiv.org/abs/2507.08166)</sup><sup> • </sup><sup>[8](https://www.tomshardware.com/pc-components/gpus/new-rowhammer-attack-silently-corrupts-ai-models-on-gddr6-nvidia-cards-gpuhammer-attack-drops-ai-accuracy-from-80-percent-to-0-1-percent-on-rtx-a6000)</sup> |
| 前向防御 | 逐行激活计数（PRAC）被纳入 JEDEC DDR5 规范 2024 年 4 月更新，当某行的激活计数超限时，DRAM 芯片会向内存控制器发出信号<sup>[9](https://arxiv.org/abs/2406.19094)</sup> |

## 干扰是如何发生的

访问 DRAM 中的一个字节，需要将该行的数据传入芯片的行缓冲，这会使该行的单元放电，然后再将行缓冲的内容复制回去为单元重新充电。正是这一激活过程干扰了相邻行。如果一行在其邻居的自动刷新之间（通常每 64 毫秒一次）被激活足够多次，相邻单元的电荷就可能越过阈值，其值随之翻转。<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup>

**两个要素**使这一效应可以从软件层面触及。第一，地址选择：被锤击的地址必须映射到同一 DRAM bank 的不同行，因为每个 bank 都有自己当前激活的行；同一行内的地址由行缓冲提供，而不同 bank 中的地址激活的是各自 bank 中的行。第二，绕过 [CPU 缓存](https://www.edgepedia.org/zh/cpu-cache)：在最初的 x86-64 利用中，这是通过 `CLFLUSH` 指令完成的，该指令强制后续读取直接访问 DRAM 而非从缓存提供。<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup> 零号项目的作者还发现，同时锤击受害行的两个邻居——他们称之为双面锤击——比锤击一个邻居加一个更远的行产生翻转的可靠性高得多；在一台脆弱的机器上，他们观察到单行内超过 25 位被翻转。<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup>

能够在自己通常无法写入的内存中翻转位的攻击者，随后可以将这种破坏引向安全敏感数据。经典技术是迫使操作系统将页表项（PTE）放入一个易受攻击的页面，并翻转其中的一位，从而获得对页表的写权限，进而获得对所有物理内存的读写权限。零号项目 2015 年的利用正是在 x86-64 Linux 上由非特权用户态进程做到了这一点，第二个利用则通过破坏已验证代码逃逸了 Native Client 沙箱。<sup>[1](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)</sup> 后续工作将攻击面扩展到浏览器中的 [JavaScript](https://www.edgepedia.org/zh/javascript)、移动设备、加密密钥和云环境。<sup>[2](https://comsec-files.ethz.ch/papers/eccploit_sp19.pdf)</sup>

## 攻击的演进

**从 DDR3 到 DDR4。** 行锤最早在 2014 年一篇针对 DDR3 的论文中被讨论，零号项目于次年发布了可用的提权利用。DRAM 制造商以专有的片内逻辑作为回应，该逻辑跟踪频繁访问的地址并反应性地刷新潜在受害行；随着 DDR4 普及，行锤似乎逐渐消退。2020 年，TRRespass 项目对这些防御进行了逆向工程，表明厂商所宣传的单一机制——目标行刷新（TRR）——实际上是一族不同的解决方案，而多面锤击（将访问分散到多达 19 个攻击行）可以击败它：三大厂商的 42 个 DDR4 模组中有 13 个存在漏洞。<sup>[3](https://security.googleblog.com/2021/05/introducing-half-double-new-hammering.html)</sup><sup> • </sup><sup>[4](https://arxiv.org/abs/2004.01807)</sup>

**更远的距离。** Half-Double 技术（2021）表明，行锤效应可以传播到相邻两行之外，但强度有所降低：给定连续三行 A、B、C，对 A 的大量访问加上对 B 的少量访问（约几十次），即可在 C 中产生翻转。谷歌的研究人员将此解释为证据，表明底层的电耦合与距离有关，随着单元几何尺寸缩小而变得更强、作用范围更远。<sup>[3](https://security.googleblog.com/2021/05/introducing-half-double-new-hammering.html)</sup>

**DDR5。** 2025 年，[苏黎世联邦理工学院](https://www.edgepedia.org/zh/eth-zurich)计算机安全组与谷歌合作提出的 Phoenix 攻击表明，来自当时最大 DRAM 制造商 SK 海力士的全部 15 个受测 DDR5 DIMM 均存在漏洞。基于 FPGA 的逆向工程揭示，增强型 TRR 缓解措施不会对某些刷新间隔进行采样，其采样周期为 128 个 tREFI 间隔，是现有攻击模式所假设的 8 倍。由于由此产生的模式跨越数千个刷新间隔，比早期模式长最多 163 倍，研究人员构建了一种自校正刷新同步方法，在错过刷新时重新对齐锤击。由此，研究人员在配备 AMD Zen 处理器和 SK 海力士 DDR5 内存的工作站上，实现了首个在标准量产台式机默认设置下运行的行锤提权利用，最快仅耗时 109 秒。<sup>[5](https://comsec.ethz.ch/research/dram/phoenix/)</sup><sup> • </sup><sup>[10](https://blog.google/security/supporting-rowhammer-research-to/)</sup> 在测试场景中，该攻击以 100% 的成功率操纵页表项，以 73% 的概率提取虚拟机的 SSH 登录密钥，并以 33% 的概率通过破坏内存中的 sudo 二进制文件获得 root 权限。<sup>[11](https://www.tomshardware.com/tech-industry/cyber-security/modern-memory-is-still-vulnerable-to-rowhammer-vulnerabilities-phoenix-root-privilege-escalation-attack-proves-that-rowhammer-still-smashes-ddr5-security-to-bits)</sup>

**GPU。** GPUHammer（2025）将行锤扩展到独立 GPU 上的 GDDR6 内存——一块英伟达 A6000——克服了专有的 bank 与行映射、更快的刷新率以及未公开的缓解措施。它跨 4 个 DRAM bank 注入最多 8 个位翻转，而模型权重中的单个位翻转就使一个图像分类模型的准确率从 80% 降至 0.1%。<sup>[7](https://arxiv.org/abs/2507.08166)</sup><sup> • </sup><sup>[8](https://www.tomshardware.com/pc-components/gpus/new-rowhammer-attack-silently-corrupts-ai-models-on-gddr6-nvidia-cards-gpuhammer-attack-drops-ai-accuracy-from-80-percent-to-0-1-percent-on-rtx-a6000)</sup> 2026 年报道的后续攻击 GDDRHammer 和 GeForge 表明，翻转 GPU 内存中的位可以修改 GPU 的页表使其指向 CPU 内存，从而获得对主机全部内存的读写权限。<sup>[12](https://www.tomshardware.com/pc-components/gpus/new-geforge-and-gddrhammer-attacks-can-fully-infiltrate-your-system-through-nvidias-gpu-memory-rowhammer-attacks-in-gpus-force-bit-flips-in-protected-vram-regions-to-gain-read-write-access)</sup>

## 缓解措施

主要的缓解方法是检测被高频访问的行，并在翻转发生前刷新附近的行。TRR 是常见例子：计数器跟踪与潜在受害行相邻的少量行的访问次数，达到阈值时系统刷新受害行。TRR 可以位于 DRAM 芯片内部，也可以位于主机 CPU 的内存控制器中。TRRespass 表明，同时锤击多个不相邻的行可以绕过它，而 Half-Double 和 [Blacksmith](https://www.edgepedia.org/zh/blacksmith) 等后续攻击引入了更高效的模式。<sup>[10](https://blog.google/security/supporting-rowhammer-research-to/)</sup>

**ECC 内存**为每个数据字添加冗余校验位，以便在读取时纠正少量翻转位。人们曾普遍希望它能成为少数实用防御手段之一，但 ECCploit 项目（2019）对商用 AMD 和英特尔芯片组的 ECC 功能进行了逆向工程，并展示了针对 [ECC 内存](https://www.edgepedia.org/zh/ecc-memory)的可靠行锤攻击，利用的是访问正确码字与访问被控制器检测并纠正的码字之间的时序差异。ECC 缩小了攻击面，但并非独立防御手段。<sup>[2](https://comsec-files.ethz.ch/papers/eccploit_sp19.pdf)</sup><sup> • </sup><sup>[13](https://theses.lib.sfu.ca/file/thesis/etd23230-mahmoud-abumandour-msc_thesis___mahmoud_abumandour.pdf)</sup>

**PRAC** 是确定性的后继方案。逐行激活计数定义于 JEDEC DDR5 规范 2024 年 4 月更新中，它精确记录每行的连续激活次数，当超过限制时发出退避信号，强制内存控制器停止处理请求，并按需而非定期发出刷新管理（RFM）命令。在支持 PRAC 之前出货的系统依赖 ECC 和增强型 TRR 等概率性措施。<sup>[9](https://arxiv.org/abs/2406.19094)</sup><sup> • </sup><sup>[10](https://blog.google/security/supporting-rowhammer-research-to/)</sup> 英特尔将行锤定性为风险管理问题，需要在内存、硬件、固件和软件层面实施分层纵深防御，因为没有任何单一控制措施能在所有配置中消除风险。<sup>[14](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/reducing-exposure-to-rowhammer.html)</sup>

## References

1. [Mark Seaborn and Thomas Dullien (2015). Exploiting the DRAM rowhammer bug to gain kernel privileges. Google Project Zero.](https://projectzero.google/2015/03/exploiting-dram-rowhammer-bug-to-gain.html?m=1)
2. [Lucian Cojocar, Kaveh Razavi, Cristiano Giuffrida, Herbert Bos (2019). Exploiting Correcting Codes: On the Effectiveness of ECC Memory Against Rowhammer Attacks. IEEE S&P / VU Amsterdam.](https://comsec-files.ethz.ch/papers/eccploit_sp19.pdf)
3. [Google Online Security Blog (2021). Introducing Half-Double: New hammering technique for DRAM Rowhammer bug.](https://security.googleblog.com/2021/05/introducing-half-double-new-hammering.html)
4. [TRRespass: Exploiting the Many Sides of Target Row Refresh. arXiv.](https://arxiv.org/abs/2004.01807)
5. [Phoenix: Rowhammer Attacks on DDR5 with Self-Correcting Synchronization. ETH Zurich Computer Security Group.](https://comsec.ethz.ch/research/dram/phoenix/)
6. [New Phoenix RowHammer attack cracks open DDR5 memory defenses in minutes. TechRadar.](https://www.techradar.com/pro/security/new-phoenix-rowhammer-attack-cracks-open-ddr5-memory-defenses-in-minutes)
7. [Chris S. Lin, Joyce Qu, Gururaj Saileshwar (2025). GPUHammer: Rowhammer Attacks on GPU Memories are Practical. USENIX Security / arXiv.](https://arxiv.org/abs/2507.08166)
8. [New Rowhammer attack silently corrupts AI models on GDDR6 Nvidia cards. Tom's Hardware.](https://www.tomshardware.com/pc-components/gpus/new-rowhammer-attack-silently-corrupts-ai-models-on-gddr6-nvidia-cards-gpuhammer-attack-drops-ai-accuracy-from-80-percent-to-0-1-percent-on-rtx-a6000)
9. [Understanding the Security Benefits and Overheads of Emerging Industry Solutions to DRAM Read Disturbance. arXiv.](https://arxiv.org/abs/2406.19094)
10. [Supporting Rowhammer research to protect the DRAM ecosystem. Google Security Blog.](https://blog.google/security/supporting-rowhammer-research-to/)
11. [Modern memory is still vulnerable to Rowhammer vulnerabilities. Tom's Hardware.](https://www.tomshardware.com/tech-industry/cyber-security/modern-memory-is-still-vulnerable-to-rowhammer-vulnerabilities-phoenix-root-privilege-escalation-attack-proves-that-rowhammer-still-smashes-ddr5-security-to-bits)
12. [New 'GeForge' and 'GDDRHammer' attacks can fully infiltrate your system through Nvidia's GPU memory. Tom's Hardware.](https://www.tomshardware.com/pc-components/gpus/new-geforge-and-gddrhammer-attacks-can-fully-infiltrate-your-system-through-nvidias-gpu-memory-rowhammer-attacks-in-gpus-force-bit-flips-in-protected-vram-regions-to-gain-read-write-access)
13. [ECC insufficiency against Rowhammer, SFU MSc thesis.](https://theses.lib.sfu.ca/file/thesis/etd23230-mahmoud-abumandour-msc_thesis___mahmoud_abumandour.pdf)
14. [Reducing Exposure to Rowhammer. Intel Software Security Guidance.](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/reducing-exposure-to-rowhammer.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Semiconductor devices & fabrication › Semiconductor memory devices

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/row-hammer

English original: https://www.edgepedia.org/row-hammer
