paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Semi-Automated Verification of Interior Unsafe Code Encapsulation in Real-World Rust Systems

真实世界 Rust 系统中 interior unsafe 代码封装的半自动验证
ASE Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering2024匹配度 3/10 · 论文属于Rust unsafe代码封装的形式化验证与程序分析,关注真实系统审计,与用户对静态分析/形式化验证的一般兴趣相邻;但未涉及LLM/Agent、机器学习系统、浮点程序分析或贝叶斯程序分析等核心交叉方向。引用 0 inbox
Zihao Rao
crossref: 2026-09-12

AI 速览

一句话:提出 unsafety isolation graph 与隔离类型/结构模式,将 Rust 的 interior unsafe 封装拆为自包含审计单元并做半自动验证。

Rust 社区倡导用 interior unsafe 封装 unsafe 代码,但缺乏官方指南与最佳实践,如何保证封装 soundness 仍是难题。本文研究真实 Rust 项目中 interior unsafe 的实践,提出 unsafety isolation graph 来建模 unsafe 代码的基本使用与封装关系。基于该图,作者定义四种隔离类型和九种结构模式,把图划分为若干小型自包含子图,作为审计 unsafe 封装 soundness 的单元。方法应用于四个真实 Rust 项目,结果显示能有效刻画其封装代码,并识别出三种封装模式与两个常见问题,这些问题可能使 soundness 验证复杂化或导致不健全。工作为 Rust unsafe 代码封装设计提供了半自动验证思路与实践指导。

问题
Rust 中 interior unsafe 的封装缺乏官方指南和最佳实践,如何刻画并验证真实系统中 unsafe 代码封装的 soundness 是本文关注的问题。
方法
提出 unsafety isolation graph 建模 unsafe 代码使用与封装,基于图定义四种隔离类型和九种结构模式,将图切分为自包含子图作为审计单元。
评估
将方法应用于四个真实 Rust 项目,表明能有效刻画封装代码,并识别出三种封装模式和两个常见问题。
原文摘要(Abstract)

Interior unsafe is an essential design paradigm advocated by the Rust community in system software development. However, there is little official guidance or few best practices regarding how to encapsulate unsafe code and achieve interior unsafe. To address this issue, this paper studies how interior unsafe is achieved in practice, aiming to identify best practices to guide Rust code design concerning unsafe code encapsulation. Specifically, we propose a novel unsafety isolation graph to model the essential usage and encapsulation of unsafe code. Based on the graph, we further propose four major isolation types and nine structural patterns to split a graph into several small self-contained subgraphs. These subgraphs can serve as useful audit units for examining the soundness of unsafe code encapsulation. We applied our approach to four real-world Rust projects. The experimental results demonstrate that our method is effective in characterizing their encapsulation code. Additionally, we identified three encapsulation patterns and two common issues in these projects that could complicate soundness verification or incur unsoundness issues.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8369,
  title = {Semi-Automated Verification of Interior Unsafe Code Encapsulation in Real-World Rust Systems},
  author = {Zihao Rao},
  booktitle = {ASE},
  year = {2024},
  doi = {10.1145/3691620.3695373}
}