Skip to main content
QUICK REVIEW

[论文解读] Verifying RISC-V Physical Memory Protection

Kevin Cheang, Cameron Rasmussen|arXiv (Cornell University)|Nov 3, 2022
Security and Verification in Computing被引用 6
一句话总结

本论文使用 LIME 工具链和 Uclid5 验证框架,对 Rocket Chip 核心中的 RISC-V 物理内存保护(PMP)硬件模块进行了形式化验证。在默认配置下,验证了 PMPChecker 模块的功能正确性,为验证 Keystone 可信执行环境的安全保证奠定了基础,确保 PMP 按照 RISC-V ISA 规范强制执行内存访问权限。

ABSTRACT

We formally verify an open-source hardware implementation of physical memory protection (PMP) in RISC-V, which is a standard feature used for memory isolation in security critical systems such as the Keystone trusted execution environment. PMP provides per-hardware-thread machine-mode control registers that specify the access privileges for physical memory regions. We first formalize the functional property of the PMP rules based on the RISC-V ISA manual. Then, we use the LIME tool to translate an open-source implementation of the PMP hardware module written in Chisel to the UCLID5 formal verification language. We encode the formal specification in UCLID5 and verify the functional correctness of the hardware. This is an initial effort towards verifying the Keystone framework, where the trusted computing base (TCB) relies on PMP to provide security guarantees such as integrity and confidentiality.

研究动机与目标

  • 对 RISC-V Rocket Chip 核心中的 PMP 硬件模块进行形式化验证,该模块对安全关键系统中的内存隔离至关重要。
  • 通过基于 RISC-V ISA 手册的规范和验证,填补低层级 PMP 硬件形式化验证的空白。
  • 为验证 Keystone 可信执行环境的可信计算基(TCB)奠定基础,其中 PMP 是强制实施完整性与机密性的核心。
  • 展示使用自动化工具链(LIME、Uclid5)将 Chisel/FIRRTL 硬件描述转换为可形式化验证模型的可行性。

提出的方法

  • 基于 RISC-V ISA 手册的形式化指定 PMP 行为,定义基于地址匹配和优先级排序的读、写、执行权限访问规则。
  • 通过 LIME 工具链将 Rocket Chip 的 PMPChecker 模块从 Chisel 自动转换为 FIRRTL,再转换为 Uclid5,用于形式化验证。
  • 在 Uclid5 中编码 PMP 访问控制逻辑,包括三种异常情况的处理:无匹配区域、高权限模式以及 PMP 条目优先级匹配。
  • 使用 Z3 求解器进行 1 步归纳验证,确认 PMPChecker 在所有有效地址和配置输入下均正确强制执行权限。
  • 限制为默认配置,以降低验证复杂度,同时保持对实际应用的功能正确性。
  • 仅针对 PMPChecker 模块进行模型提取和模块化验证,将其与 TLB 和 PTW 等其他系统组件隔离。

实验结果

研究问题

  • RQ1Rocket Chip 中的 PMPChecker 模块是否正确实现了 RISC-V ISA 手册中规定的 PMP 访问规则?
  • RQ2像 LIME 和 Uclid5 这类自动化工具链是否能够有效转换并验证安全关键属性的 RTL 级硬件设计?
  • RQ3PMP 的功能正确性是否足以保证类似 Keystone 这类系统中的内存隔离,还是需要额外组件?
  • RQ4使用该工具链对真实世界 RISC-V 硬件模块进行形式化验证的性能和可扩展性如何?

主要发现

  • 在默认配置下,PMPChecker 模块的功能正确性已通过 Uclid5 使用 1 步归纳验证确认。
  • 验证过程在标准 2.6 GHz Intel Core i7 机器(16 GB RAM)上耗时 41.331 秒,证明了其实际可行性。
  • 48 行代码的 Chisel 实现被转换为 1,125 行的 Uclid5 模型,展示了 LIME-Uclid5 工具链的可扩展性。
  • 形式化规范正确地建模了所有三种异常情况:无匹配区域、高权限模式以及 PMP 条目的优先级匹配。
  • 结果确认,PMPChecker 正确地基于最低编号匹配的 PMP 条目及其配置,计算出读、写和执行权限。
  • 本工作为验证 Keystone 可信执行环境的完整 TCB 奠定了关键的第一步,但未来工作仍需纳入 TLB、PTW 和软件组件。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。