Skip to main navigation Skip to search Skip to main content

Fine-grained formal specification and analysis of buddy memory allocation in zephyr RTOS

  • Zhang Feng
  • , Zhao Yongwang*
  • , Ma Dianfu
  • , Niu Wensheng
  • *Corresponding author for this work
  • Beihang University
  • Aeronautical Computing Technique Research Institute

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Bugs in memory management of Operating Systems may lead to crashing. This paper presents a case study of formal verification on the buddy memory allocation component of the Zephyr RTOS kernel. The algorithm of the component allows memory blocks of 4-power sizes to be dynamically allocated by efficiently partitioning larger blocks into smaller ones, and then be released supporting immediate and automatic combining of smaller blocks. The execution of memory allocation is preemptive, which means that the allocation may invoke rescheduling when there is no block available for memory requests. In this paper, we provide a fine-grained formal specification of buddy memory allocation and formally verify its safety via invariants and functional correctness. The specification covers all the elements of the data structure as well as all statements of memory initialization, allocation, and release presented in the C source code. During the formal verification, we found a functional flaw in the C code. To the best of our knowledge, this paper is the first effort of formal verification at a fine-grained level on buddy memory allocation in Operating Systems.

Original languageEnglish
Title of host publicationProceedings - 2019 IEEE 22nd International Symposium on Real-Time Distributed Computing, ISORC 2019
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages10-17
Number of pages8
ISBN (Electronic)9781728101507
DOIs
StatePublished - May 2019
Event22nd IEEE International Symposium on Real-Time Distributed Computing, ISORC 2019 - Valencia, Spain
Duration: 7 May 20199 May 2019

Publication series

NameProceedings - 2019 IEEE 22nd International Symposium on Real-Time Distributed Computing, ISORC 2019

Conference

Conference22nd IEEE International Symposium on Real-Time Distributed Computing, ISORC 2019
Country/TerritorySpain
CityValencia
Period7/05/199/05/19

Keywords

  • Buddy memory allocation
  • Fine-grained formal specification and analysis
  • Functional correctness
  • Zephyr

Fingerprint

Dive into the research topics of 'Fine-grained formal specification and analysis of buddy memory allocation in zephyr RTOS'. Together they form a unique fingerprint.

Cite this