Charon:一个用于 Rust 的分析框架
Charon: An Analysis Framework for Rust
AI总结:
针对 Rust 生态系统中分析工具需重复实现底层编译器交互机制的问题,提出了分析框架 Charon,提供稳定的 AST 作为基础,并通过多个案例验证了其实用性。
摘要:
随着 Rust 编程语言人气的爆发式增长,最近开发了大量的工具来分析、验证和测试 Rust 程序。遗憾的是,Rust 生态系统仍然相对年轻,这意味着所有这些工具都必须重新实现困难且耗时的机制,以便与 Rust 编译器及其 cargo 构建系统交互,接入 Rust 编译器的内部表示,并暴露出适合分析而非针对效率优化的抽象语法树(AST)。我们解决了 Rust 生态系统中这一缺失的基础构件,并提出了 Charon,一个用于 Rust 的分析框架。Charon 充当分析 Rust 程序的瑞士军刀,处理上述所有繁琐工作,为客户端提供一个干净、稳定的 AST,可以作为许多分析的基础。我们通过一系列案例研究展示了 Charon 的实用性,包括 Rust 验证框架(Aeneas)、从 Rust 到 C 的编译器(Eurydice),以及一个用于密码学代码的新型污点检查器。为了进一步证明这一点,我们还重新实现了一个流行的现有分析(Rudra),并表明它可以通过利用 Charon 框架来复制。
英文摘要:
With the explosion in popularity of the Rust programming language, a wealth of tools have recently been developed to analyze, verify, and test Rust programs. Alas, the Rust ecosystem remains relatively young, meaning that every one of these tools has had to re-implement difficult, time-consuming machinery to interface with the Rust compiler and its cargo build system, to hook into the Rust compiler's internal representation, and to expose an abstract syntax tree (AST) that is suitable for analysis rather than optimized for efficiency. We address this missing building block of the Rust ecosystem, and propose Charon, an analysis framework for Rust. Charon acts as a swiss-army knife for analyzing Rust programs, and deals with all of the tedium above, providing clients with a clean, stable AST that can serve as the foundation of many analyses. We demonstrate the usefulness of Charon through a series of case studies, ranging from a Rust verification framework (Aeneas), a compiler from Rust to C (Eurydice), and a novel taint-checker for cryptographic code. To drive the point home, we also re-implement a popular existing analysis (Rudra), and show that it can be replicated by leveraging the Charon framework.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。