TrABin:二进制文件的可信分析
TrABin: Trustworthy Analyses of Binaries
摘要:
微内核、设备驱动程序和加密例程的验证需要在二进制级别进行分析。为了使这些分析自动化,在过去的几年中,已经引入了几个二进制分析平台。这些平台共享一个共同的设计:采用独立于硬件的中间表示,一种机制,将架构相关的代码转换为这种表示,以及一组架构独立的分析,处理中间表示。使用这些平台来验证软件引入了信任从二进制代码到中间语言的翻译(称为转译)的正确性和分析的正确性的需要。实现高度信任是具有挑战性的,因为转译必须处理(i)指令的所有副作用,(ii)多个指令编码(例如ARM Thumb),以及(iii)可变指令长度(例如Intel)。类似地,分析可以使用工件的复杂转换(例如循环展开)和简化(例如部分评估),其错误可能会危及结果的正确性。我们克服了这些问题,通过开发一个二进制分析平台上的交互式定理证明HOL4。首先,我们正式建模的二进制中间语言,我们证明了几个支持工具(即类型检查器)的正确性。然后,我们实现了两个证明生成转换器,分别将ARMv8和CortexM0程序转换为中间语言并生成证书。此证书是HOL4证明,证明翻译的正确性。作为演示分析,我们实现了一个证明生成最弱前提生成器,它可以用来验证给定的无循环程序片段满足合同。最后,我们使用一个AES加密实现基准测试我们的平台。
英文摘要:
Verification of microkernels, device drivers, and crypto routines requires analyses at the binary level. In order to automate these analyses, in the last years several binary analysis platforms have been introduced. These platforms share a common design: the adoption of hardware-independent intermediate representations, a mechanism to translate architecture dependent code to this representation, and a set of architecture independent analyses that process the intermediate representation. The usage of these platforms to verify software introduces the need for trusting both the correctness of the translation from binary code to intermediate language (called transpilation) and the correctness of the analyses. Achieving a high degree of trust is challenging since the transpilation must handle (i) all the side effects of the instructions, (ii) multiple instruction encodings (e.g. ARM Thumb), and (iii) variable instruction length (e.g. Intel). Similarly, analyses can use complex transformations (e.g. loop unrolling) and simplifications (e.g. partial evaluation) of the artifacts, whose bugs can jeopardize correctness of the results. We overcome these problems by developing a binary analysis platform on top of the interactive theorem prover HOL4. First, we formally model a binary intermediate language and we prove correctness of several supporting tools (i.e. a type checker). Then, we implement two proof-producing transpilers, which respectively translate ARMv8 and CortexM0 programs to the intermediate language and generate a certificate. This certificate is a HOL4 proof demonstrating correctness of the translation. As demonstrating analysis, we implement a proof-producing weakest precondition generator, which can be used to verify that a given loop-free program fragment satisfies a contract. Finally, we use an AES encryption implementation to benchmark our platform.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。