arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.05398cs.PL
收藏

使用三态数的声音、精确和快速的抽象解释

Sound, Precise, and Fast Abstract Interpretation with Tristate Numbers

Harishankar Vishwanathan, Matan Shachnai, Srinivas Narayana, Santosh Nagarakatte

摘要:

扩展伯克利包过滤器(BPF)是一种语言和运行时系统,允许非超级用户通过将用户代码下载到内核中来扩展Linux和Windows操作系统。为了确保用户代码在内核上下文中安全运行,BPF依赖于一个静态分析器来证明代码的属性,例如有界内存访问和不存在崩溃的操作。BPF静态分析器使用具有多个抽象域的抽象解释来检查安全性。其中,tnums(三态数)域是用于推理程序值中的按位不确定性的关键域。本文对tnum抽象域及其算术运算符进行了形式化的定义。我们首次证明了BPF分析器中使用的tnum加法和减法抽象算术运算符的合理性和最优性。此外,我们还描述了一种新的tnum乘法算法,它比Linux内核的算法更精确、更高效(平均运行速度快33%)。我们的tnum乘法现在合并到Linux内核中。

英文摘要:

Extended Berkeley Packet Filter (BPF) is a language and run-time system that allows non-superusers to extend the Linux and Windows operating systems by downloading user code into the kernel. To ensure that user code is safe to run in kernel context, BPF relies on a static analyzer that proves properties about the code, such as bounded memory access and the absence of operations that crash. The BPF static analyzer checks safety using abstract interpretation with several abstract domains. Among these, the domain of tnums (tristate numbers) is a key domain used to reason about the bitwise uncertainty in program values. This paper formally specifies the tnum abstract domain and its arithmetic operators. We provide the first proofs of soundness and optimality of the abstract arithmetic operators for tnum addition and subtraction used in the BPF analyzer. Further, we describe a novel sound algorithm for multiplication of tnums that is more precise and efficient (runs 33% faster on average) than the Linux kernel's algorithm. Our tnum multiplication is now merged in the Linux kernel.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑