一句话:提出渐进分配器独立性,用信息流非干扰与降级语义刻画分配器相关的内存安全。
传统内存安全通常以“不会发生哪些坏事”的负面性质来定义,形式化文献多沿用此视角,但缺少能蕴含这些性质的通用语义原则。本文聚焦分配器相关方面,包括空指针解引用、释放后使用、双重释放和堆溢出,提出“渐进分配器独立性”概念。其直觉来自非干扰,即分配器不应影响程序执行;并针对分配器内存耗尽和指针到整数转换两类情形精化定义,把它们视为 downgrading,借助信息流机制处理。作者在含 malloc/free、平坦内存且指针即整数的低级语言中形式化该语义,从而更准确地刻画依赖分配器的内存安全。
Memory safety is traditionally characterized in terms of bad things that cannot happen. This approach is currently embraced in the literature on formal methods for memory safety. However, a general semantic principle for memory safety, that implies the negative items, remains elusive. This paper focuses on the allocator-specific aspects of memory safety, such as null-pointer dereference, use after free, double free, and heap overflow. To that extent, we propose a notion of gradual allocator independence that accurately captures the allocator-dependent aspects of memory safety. Our approach is inspired by the previously suggested connection between memory safety and noninterference, but extends that connection in a fundamentally important direction towards downgrading. We consider a low-level language with access to an allocator that provides malloc and free primitives in a flat memory model. Pointers are just integers, and as such it is trivial to write memory-unsafe programs. The basic intuition of gradual allocator independence is that of noninterference, namely that allocators must not influence program execution. This intuition is refined in two important ways that account for the allocators running out-of-memory and for programs to have pointer-to-integer casts. The key insight of the definition is to treat these extensions as forms of downgrading and give them satisfactory technical treatment using the state-of-the-art information flow machinery.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{HansenLA26,
title = {The Downgrading Semantics of Memory Safety},
author = {René Rydhof Hansen and Andreas Stenbæk Larsen and Aslan Askarov},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {PLDI},
year = {2026},
doi = {10.1145/3808260}
}