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

模型检验C++程序

Model Checking C++ Programs

Felipe R. Monteiro, Mikhail R. Gadelha, Lucas C. Cordeiro

摘要:

在过去的三十年中,系统程序设计语言(如C或C++)中的内存安全问题一直是安全漏洞的重要来源之一。然而,只有少数尝试有限的成功,以应付C++程序验证的复杂性。在这里,我们描述和评估一种新的验证方法的基础上有界模型检验(BMC)和可满足性模理论(SMT),以验证C++程序的形式。我们的验证方法分析有界C++程序的SMT编码到各种复杂的功能,C++程序设计语言提供,如模板,继承,多态性,异常处理,和标准C++库。我们正式这些功能在我们的形式化验证框架内使用一阶逻辑的可判定片段,然后显示如何国家的最先进的SMT求解器可以有效地处理。我们在ESBMC之上实现了我们的验证方法。我们将ESBMC与LLBMC和DIVINE进行比较,它们是直接从LLVM位代码检查C++程序的最先进的验证器。实验结果表明,ESBMC能够处理大范围的C++程序,具有较高的验证正确率。与此同时,与LLBMC和DIVINE工具相比,它减少了验证时间。此外,ESBMC已被应用于电信领域的商业C++应用程序,并成功地检测到算术溢出错误,可能导致安全漏洞。

英文摘要:

In the last three decades, memory safety issues in system programming languages such as C or C++ have been one of the significant sources of security vulnerabilities. However, there exist only a few attempts with limited success to cope with the complexity of C++ program verification. Here we describe and evaluate a novel verification approach based on bounded model checking (BMC) and satisfiability modulo theories (SMT) to verify C++ programs formally. Our verification approach analyzes bounded C++ programs by encoding into SMT various sophisticated features that the C++ programming language offers, such as templates, inheritance, polymorphism, exception handling, and the Standard C++ Libraries. We formalize these features within our formal verification framework using a decidable fragment of first-order logic and then show how state-of-the-art SMT solvers can efficiently handle that. We implemented our verification approach on top of ESBMC. We compare ESBMC to LLBMC and DIVINE, which are state-of-the-art verifiers to check C++ programs directly from the LLVM bitcode. Experimental results show that ESBMC can handle a wide range of C++ programs, presenting a higher number of correct verification results. At the same time, it reduces the verification time if compared to LLBMC and DIVINE tools. Additionally, ESBMC has been applied to a commercial C++ application in the telecommunication domain and successfully detected arithmetic overflow errors, potentially leading to security vulnerabilities.

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

↑