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

弦与位向量理论的求解器

A Solver for a Theory of Strings and Bit-vectors

Sanu Subramanian, Murphy Berzish, Yunhui Zheng, Omer Tripp, Vijay Ganesh

摘要:

我们提出了一个求解器的一个多排序的一阶量词免费理论$T_{w,bv}$的字符串方程,字符串长度表示为位向量,位向量算法,旨在形式化验证,自动化测试和安全分析的C/C++应用程序。我们构建这样一个求解器的主要动机是观察到现有的字符串求解器在建模字符串/位向量组合时效率不高。当前的方法要么将字符串简化为位向量并使用位向量求解器作为后端,要么将位向量建模为自然数并使用字符串和自然数组合理论的求解器。由于不同的原因,这两种方法都是低效的。将字符串建模为位向量破坏了字符串方程中固有的结构,从而错过了有效地决定这种公式的机会,并且将位向量建模为自然数是低效的。因此,显然需要一个求解器,模型字符串和位向量本机。我们的求解器Z3 strBV是一个决策过程的理论$T_{w,bv}$结合求解器位向量和字符串方程。我们的实验表明,Z3 strBV是显着更有效的减少字符串/位向量的约束字符串/自然数。此外,我们证明了理论$T_{w,bv}$的可判定性。我们还提出了两个优化,可以适应其他情况。第一个加速了字符串长度一致分配的收敛,第二个被称为库感知SMT解决方案,修复了内置字符串函数的摘要(例如,{C/C++中的\tt strlen}),Z3 strBV直接使用它,而不是每次都从头开始分析函数。最后,我们通过实验证明,Z3 strBV能够检测到非平凡的溢出在现实世界中的系统级代码,确认对7个安全漏洞从CVE和Mozilla数据库。

英文摘要:

We present a solver for a many-sorted first-order quantifier-free theory $T_{w,bv}$ of string equations, string length represented as bit-vectors, and bit-vector arithmetic aimed at formal verification, automated testing, and security analysis of C/C++ applications. Our key motivation for building such a solver is the observation that existing string solvers are not efficient at modeling the string/bit-vector combination. Current approaches either reduce strings to bit-vectors and use a bit-vector solver as a backend, or model bit-vectors as natural numbers and use a solver for the combined theory of strings and natural numbers. Both these approaches are inefficient for different reasons. Modeling strings as bit-vectors destroys structure inherent in string equations thus missing opportunities for efficiently deciding such formulas, and modeling bit-vectors as natural numbers is known to be inefficient. Hence, there is a clear need for a solver that models strings and bit-vectors natively. Our solver Z3strBV is a decision procedure for the theory $T_{w,bv}$ combining solvers for bit-vector and string equations. We demonstrate experimentally that Z3strBV is significantly more efficient than reduction of string/bit-vector constraints to strings/natural numbers. Additionally, we prove decidability for the theory $T_{w,bv}$. We also propose two optimizations which can be adapted to other contexts. The first accelerates convergence on a consistent assignment of string lengths, and the second, dubbed library-aware SMT solving, fixes summaries for built-in string functions (e.g., {\tt strlen} in C/C++), which Z3strBV uses directly instead of analyzing the functions from scratch each time. Finally, we demonstrate experimentally that Z3strBV is able to detect nontrivial overflows in real-world system-level code, as confirmed against 7 security vulnerabilities from CVE and Mozilla database.

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

↑