arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2211.07511cs.LOcs.ARcs.PL
收藏

用于验证的 CHERI-C 形式语义

A Formal CHERI-C Semantics for Verification

Seung Hoon Park, Rekha Pai, Tom Melham

AI总结:

本文提出 CHERI-C 的形式化内存模型与 Isabelle/HOL 理论,并生成 OCaml 实例接入 Gillian,以具体执行测试并发现硬件遗漏的安全违规。

摘要:

CHERI-C 通过添加硬件能力(hardware capabilities)扩展了 C 编程语言,在保持高效的同时确保一定程度的内存安全。能力还可用于软件隔离等更高层次的安全措施,而这些措施必须被正确使用,才能实现预期的安全保证。由于该扩展改变了 C 的语义,因此需要新的理论和工具来推理 CHERI-C 代码并验证其正确性。在本工作中,我们提出了一个形式化内存模型,为 CHERI-C 程序提供内存语义。我们给出了一种泛化理论,具有丰富的性质,适用于验证以及潜在的其他类型分析。我们的理论由 Isabelle/HOL 形式化提供支持,该形式化还会生成内存模型的一个 OCaml 可执行实例。随后,经过验证并提取的代码被用于实例化参数化的 Gillian 程序分析框架,借助该框架我们可以对 CHERI-C 程序执行具体执行。该工具能够运行一个 CHERI-C 测试套件,证明我们工具的正确性,并捕获 CHERI 硬件可能遗漏的一大类安全违规。

英文摘要:

CHERI-C extends the C programming language by adding hardware capabilities, ensuring a certain degree of memory safety while remaining efficient. Capabilities can also be employed for higher-level security measures, such as software compartmentalization, that have to be used correctly to achieve the desired security guarantees. As the extension changes the semantics of C, new theories and tooling are required to reason about CHERI-C code and verify correctness. In this work, we present a formal memory model that provides a memory semantics for CHERI-C programs. We present a generalised theory with rich properties suitable for verification and potentially other types of analyses. Our theory is backed by an Isabelle/HOL formalisation that also generates an OCaml executable instance of the memory model. The verified and extracted code is then used to instantiate the parametric Gillian program analysis framework, with which we can perform concrete execution of CHERI-C programs. The tool can run a CHERI-C test suite, demonstrating the correctness of our tool, and catch a good class of safety violations that the CHERI hardware might miss.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑