paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Dependent Nominal Physical Type System for Static Analysis of Memory in Low Level Code

面向底层代码内存静态分析的依赖名义物理类型系统
OOPSLA 8(OOPSLA2)2024匹配度 3/10 · 该论文属于静态分析与抽象解释方向,提出低层代码内存安全的类型系统,与用户对静态分析本身的兴趣有一定交集;但它没有涉及 LLM/Agent、ML 系统、浮点程序分析或贝叶斯程序分析,因而与用户核心交叉方向不匹配。引用 2 inbox
Julien Simonnet, Matthieu Lemerre, Mihaela Sighireanu
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出依赖名义物理类型系统,可嵌入抽象解释器,自动证明底层 C 与机器码的类型安全及空间内存安全。

论文研究无证明携带代码的自动验证:在不修改底层 C 代码或其编译所得机器码的情况下,自动证明类型安全,并由此蕴含空间内存安全。这需要精确静态分析来编码指针算术、对齐指针位窃取标签、缓冲区大小与基址分离存储、柔性数组成员等底层惯用法,且能嵌入抽象解释器。作者提出依赖名义物理类型系统,以名义方式组织连续内存区域,支持嵌套、拼接、联合与区域间参数共享,并由类型定义诱导地址集合上的格;它还允许更新内存单元并改变其类型而无需控制别名。论文给出语义模型,通过抽象解释导出可靠类型检查规则,并作为抽象域集成到流敏感静态分析。多个挑战性基准上的实验表明,仅用用户提供的函数原型,该方法通常能证明 C 与机器码程序的类型安全与空间内存安全。

问题
如何在不要求代码携带证明且不修改代码的前提下,自动证明底层 C 代码或其编译所得机器码的类型安全与空间内存安全。
方法
提出依赖名义物理类型系统,以名义方式组织连续内存区域,支持嵌套、拼接、联合和参数共享,并给出语义模型;通过抽象解释导出可靠类型检查规则,再作为抽象域集成到流敏感静态分析中。
评估
在多种挑战性基准上,仅使用用户提供的函数原型,验证该方法通常能成功证明 C 与机器码程序的类型安全和空间内存安全。
原文摘要(Abstract)

We tackle the problem of checking non-proof-carrying code , i.e. automatically proving type-safety (implying in our type system spatial memory safety) of low-level C code or of machine code resulting from its compilation without modification. This requires a precise static analysis that we obtain by having a type system which (i) is expressive enough to encode common low-level idioms, like pointer arithmetic, discriminating variants by bit-stealing on aligned pointers, storing the size and the base address of a buffer in distinct parts of the memory, or records with flexible array members, among others; and (ii) can be embedded in an abstract interpreter. We propose a new type system that meets these criteria. The distinguishing feature of this type system is a nominal organization of contiguous memory regions, which (i) allows nesting, concatenation, union, and sharing parameters between regions; (ii) induces a lattice over sets of addresses from the type definitions; and (iii) permits updates to memory cells that change their type without requiring one to control aliasing. We provide a semantic model for our type system, which enables us to derive sound type checking rules by abstract interpretation, then to integrate these rules as an abstract domain in a standard flow-sensitive static analysis. Our experiments on various challenging benchmarks show that semantic type-checking using this expressive type system generally succeeds in proving type safety and spatial memory safety of C and machine code programs without modification, using only user-provided function prototypes.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{SimonnetLS24,
  title = {A Dependent Nominal Physical Type System for Static Analysis of Memory in Low Level Code},
  author = {Julien Simonnet and Matthieu Lemerre and Mihaela Sighireanu},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689712}
}