This white paper demonstrates how the assurance, reliability, and security of an existing professional-grade, open-source embedded TCP/IP stack implementation written in the C programming language is significantly enhanced by adopting the SPARK technology. A multifaceted approach achieves this. Firstly, the TCP layer's C code is being replaced with formally verified SPARK, a subset of the Ada programming language supported by formal verification tools. Then the lower layers, still written in C and on which the TCP layer depends, are modeled using SPARK contracts and validated using symbolic execution with KLEE. Finally, formal contracts for the upper layers are defined to call the TCP layer. The work allowed the detection and correction of two bugs in the TCP layer. In an increasingly connected world, where Cyber Security is of paramount importance, the powerful approach detailed in this work can be applied to any existing critical C library to harden their reliability and security significantly.
翻译:本白皮书通过采用SPARK技术,展示了如何通过采用SPARK技术大大加强以C编程语言书写的现有专业级别、开放源码嵌入的TCP/IP堆的保证、可靠性和安全性。首先,TCP层的C代码正在由正式核查的SPARK取代,SPARK是Ada编程语言的子集,并辅以正式核查工具。然后,仍然以C书写的TCP层所依赖的低层,以SPARK合同为模型,用KLEE的象征性执行加以验证。最后,对上层的正式合同作了界定,将TCP层称为TCP层。这项工作使得能够发现和纠正TCP层的两个错误。在一个日益相互联系的世界中,网络安全至关重要,这项工作中详细阐述的有力方法可以适用于任何现有的关键C图书馆,以大大加强它们的可靠性和安全性。