arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.08848cs.PLcs.CRcs.LO
收藏

向前符号执行用于二进制代码验证的可信自动化

Forward Symbolic Execution for Trustworthy Automation of Binary Code Verification

Uppsala University(乌普萨拉大学);KTH Royal Institute of Technology(皇家理工学院);Intel Labs(英特尔实验室)

Andreas Lindner, Karl Palmskog, Scott Constable, Mads Dam, Roberto Guanciale, Hamed Nemati

AI总结:

本文提出了一种面向符号执行的理论,用于在可信系统中自动验证二进制代码的功能和非功能属性,通过HOL4定理证明器实现了该理论,并展示了其在RISC-V和ARM Cortex-M0上的应用效果。

摘要:

无结构程序中的控制流可以是复杂且动态的,这使得静态分析困难。然而,在可信系统中验证二进制(机器)代码的属性时,对无结构控制流进行自动推理是重要的,例如加密例程。我们提出了一种适用于定理证明器的向前符号执行理论,用于无结构程序,使能够自动验证功能和非功能程序属性。该理论的基础是一组推理规则,每个成员对应于符号执行引擎中的一个操作。这些规则设计用于在精度保持和引入上界之间取得平衡。我们为BIR(之前提出的二进制分析中间语言)实例化了该理论。我们展示了如何使用常见的优化技术如剪枝不可行的符号状态来构建符号执行器。我们使用HOL4定理证明器和HolBA二进制分析库实现了该理论,获得了关于BIR符号执行的机器验证证明。我们实际评估了该理论的两个应用:验证RISC-V二进制的功能属性和验证在ARM Cortex-M0处理器上运行的程序的执行时间界限。评估显示,对于中等大小的程序,此类验证可以通过适度的开销实现自动化。

英文摘要:

Control flow in unstructured programs can be complex and dynamic, which makes static analysis difficult. Yet, automated reasoning about unstructured control flow is important when certifying properties of binary (machine) code in trustworthy systems, e.g., cryptographic routines. We present a theory of forward symbolic execution for unstructured programs suitable for use in theorem provers that enables automated verification of both functional and non-functional program properties. The theory's foundation is a set of inference rules where each member corresponds to an operation in a symbolic execution engine. The rules are designed to give control over the tradeoff between the preservation of precision and introduction of overapproximation. We instantiate our theory for BIR, a previously proposed intermediate language for binary analysis. We demonstrate how symbolic executors can be constructed for BIR with common optimizations such as pruning of infeasible symbolic states. We implemented our theory in the HOL4 theorem prover using the HolBA binary analysis library, obtaining machine-checked proofs of soundness of symbolic execution for BIR. We practically evaluated two applications of our theory: verification of functional properties of RISC-V binaries and verification of execution time bounds of programs running on the ARM Cortex-M0 processor. The evaluation shows that such verification can be automated with moderate overhead on medium-sized programs.

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

↑