华东师范大学学报(自然科学版) ›› 2024, Vol. 2024 ›› Issue (4): 1-17.doi: 10.3969/j.issn.1000-5641.2024.04.001

• 计算机科学 •    

一种面向嵌入式操作系统的形式化验证方法

王阳1, 方竟成2, 蔡雄3, 张志鹏3, 蔡喁2, 缪炜恺2,*()   

  1. 1. 中国航发控制系统研究所, 江苏 无锡 214063
    2. 华东师范大学 软件工程学院, 上海 200062
    3. 上海工业控制安全创新科技有限公司 可信软件创新研究院, 上海 200333
  • 收稿日期:2023-04-20 出版日期:2024-07-25 发布日期:2024-07-23
  • 通讯作者: 缪炜恺 E-mail:wkmiao@sei.ecnu.edu.cn
  • 基金资助:
    国家自然科学基金 (62372181)

A formal verification method for embedded operating systems

Yang WANG1, Jingcheng FANG2, Xiong CAI3, Zhipeng ZHANG3, Yong CAI2, Weikai MIAO2,*()   

  1. 1. Aero-Engine Control System Institute, Aero-Engine Corporation of China, Wuxi, Jiangsu 214063, China
    2. Software Engineering Institute, East China Normal University, Shanghai 200062, China
    3. Functional Safety Research Institute, Shanghai Industrial Control Safety Innovation Technology Co. Ltd., Shanghai 200333, China
  • Received:2023-04-20 Online:2024-07-25 Published:2024-07-23
  • Contact: Weikai MIAO E-mail:wkmiao@sei.ecnu.edu.cn

摘要:

操作系统是整个计算机系统的核心与基石, 其可靠性与安全性至关重要. 操作系统的故障或漏洞可能会导致系统崩溃、数据丢失、隐私泄露和安全攻击等问题, 特别是在安全攸关系统中, 一旦操作系统发生错误, 就可能会造成重大人员伤亡或财产损失. 一直以来, 如何保障操作系统的安全性和可靠性对学术界和工业界都是一个重大挑战. 目前验证操作系统安全性的方法有软件测试、程序静态分析、形式化方法等. 其中, 形式化方法是最有潜力确保操作系统安全可信的方法, 通过使用形式化方法, 建立数学模型并进行系统的形式化分析和验证, 从而发现潜在的错误和漏洞. 在操作系统中, 形式化方法可以用于验证操作系统的功能正确性、完整性以及系统安全性等. 在已有的针对操作系统形式化验证的成果基础上, 提出了一个面向嵌入式操作系统的形式化验证方案, 采用VCC (verified C compiler)、CBMC (C bounded model checker)以及PAT (process analysis toolkit)工具分别对操作系统单元层面、模块层面和系统层面进行验证. 该方法已成功应用到某操作系统的任务调度架构案例中, 对于嵌入式操作系统的分析验证具有一定的通用性.

关键词: 嵌入式操作系统, 形式化验证, VCC, CBMC, PAT

Abstract:

The operating system is the core and foundation of the entire computer system. Its reliability and safety are vital because faults or vulnerabilities in the operating system can lead to system crashes, data loss, privacy breaches, and security attacks. In safety-critical systems, any errors in the operating system can result in significant loss of life and property. Ensuring the safety and reliability of the operating system has always been a major challenge in industry and academia. Currently, methods for verifying the operating system’s safety include software testing, static analysis, and formal methods. Formal methods are the most promising in ensuring the operating system’s safety and trustworthiness. Mathematical models can be established using formal methods, and the system can be formally analyzed and verified to discover potential errors and vulnerabilities. In the operating system, formal methods can be used to verify the correctness and completeness of the operating system’s functions and system safety. A formal scheme for embedded operating systems is proposed herein on the basis of existing formal verification achievements for operating systems. This scheme uses VCC (verified C compiler), CBMC (C bounded model checker), and PAT (process analysis toolkit) tools to verify the operating system at the unit, module, and system levels, respectively. The schema, upon being successfully applied to a task scheduling architecture case of a certain operating system, exhibits a certain universality for analyzing and verifying embedded operating systems.

Key words: embedded operating system, formal verification, VCC, CBMC, PAT

中图分类号: