Automatic Verification of Embedded System Code Manipulating Dynamic Structures Stored in Contiguous Regions

作者:Liu, Jiangchao*; Chen, Liqian; Rival, Xavier
来源:IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 2018, 37(11): 2311-2322.
DOI:10.1109/TCAD.2018.2858462

摘要

User-space programs rely on memory allocation primitives when they need to construct dynamic structures such as lists or trees. However, low-level OS kernel services and embedded device drivers typically avoid resorting to an external memory allocator in such cases, and store structure elements in contiguous arrays instead. This programming pattern leads to very complex code, based on data-structures that can be viewed and accessed either as arrays or as chained dynamic structures. The code correctness then depends on intricate invariants mixing both aspects. We propose a static analysis that is able to verify such programs. It relies on the combination of abstractions of the allocator array and of the dynamic structures built inside it. This approach allows to integrate program reasoning steps inherent in the array and in the chained structure into a single abstract interpretation. We report on the successful verification of several embedded OS kernel services and drivers.