[论文解读] Deciding Memory Safety for Forest Datastructures
本文提出了一种可判定的决策过程,用于验证操作森林数据结构(即树和列表的集合)的程序中的内存安全问题,其重点在于缓存程序这一类别,此类程序的内存安全问题可判定。该方法能有效证明安全性或检测常见单遍遍历库例程中的漏洞,展现出强大的实际适用性。
Memory safety is the problem of determining if a heap manipulating program that allocates/frees memory locations and manipulates heap pointers, does not dereference a memory location that is not allocated. Memory safety errors are serious security vulnerabilities that can be exploited systematically to attack systems. In this paper we consider the problem of checking if a program, whose initial allocated heap forms a forest structure (i.e., a disjoint set of trees and lists), is memory safe. While the problem of checking memory safety of programs whose initial heap is a forest structure is undecidable, we identify a class of caching programs for which the problem of checking memory safety is decidable. Our experimental evaluation demonstrates that common library routines that manipulate forest data-structures using a single pass are almost always caching. We show that our decision procedure for such programs is effective in both proving memory safety and in identifying memory safety vulnerabilities.
研究动机与目标
- 为解决在操作森林结构堆内存的程序中验证内存安全的挑战。
- 识别出一个程序子类——具体而言是缓存程序——在此类程序中,尽管该问题在一般情况下不可判定,但内存安全问题可判定。
- 开发一种实用的决策过程,能够验证真实世界库例程中内存安全或暴露其中的漏洞,这些例程操作森林数据结构。
提出的方法
- 该方法针对在森林数据结构上执行单遍操作且表现出缓存行为的程序,例如存储指向节点的指针以供后续重用。
- 它利用静态分析来建模在假设缓存模式下的指针流动与堆内存操作。
- 该方法构建了堆状态演化的有限状态抽象,利用森林的结构约束与缓存特性以确保可判定性。
- 它使用堆配置的符号化表示来追踪有效的指针关系并检测无效内存访问。
- 该决策过程整合了控制流分析与指针分析,以在程序路径间推理内存安全。
- 该方法被实现为一个验证框架,可应用于真实库代码,并通过在常见数据结构例程上的实验评估进行了验证。
实验结果
研究问题
- RQ1尽管该问题在一般情况下不可判定,是否可以为操作森林数据结构的程序决定其内存安全?
- RQ2在该上下文中,哪些结构或行为约束使得内存安全问题可判定?
- RQ3缓存模式在真实世界中单遍操作森林的例程中有多普遍?
- RQ4所提出的决策过程在多大程度上能够验证此类例程的安全性或检测其中的漏洞?
- RQ5该方法在真实库代码上的实际应用中效果如何?
主要发现
- 对于操作森林数据结构的程序,内存安全问题在一般情况下是不可判定的,但对于缓存程序,该问题可判定。
- 几乎所有的常见单遍操作森林的库例程都表现出缓存行为,使得所提出的方法具有广泛适用性。
- 该决策过程成功证明了此类例程中一大类程序的内存安全性。
- 该方法能有效识别出在无法证明安全性的程序中潜在的内存安全漏洞。
- 实验评估证实了该方法在真实示例中进行验证与漏洞检测方面的有效性。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。