Formal Modelling of Separation Kernels
Total Page:16
File Type:pdf, Size:1020Kb
The University of York Department of Computer Science Submitted in part fulfilment for the degree of MSc in Software Engineering. Formal Modelling of Separation Kernels Andrius Velykis 18th September 20091 Supervised by Dr Leo Freitas Number of words = 45327, as counted by detex <report.tex> j wc -w. This report consists of 98 pages in total. This includes the body of the report (without blank pages) and Appendix A, but not Appendices B, C, D, E and F. 1Updated transactional operation proofs, 21st September 2009. Abstract A separation kernel is an architecture for secure applications, which benefits from inherent security of distributed systems. Due to its small size and usage in high-integrity environments, it makes a good target for formal modelling and verification. This project presents results from mechanisation and modelling of separation kernel components: a process table, a process queue and a scheduler. The results have been developed as a part of the pilot project within the international Grand Challenge in Verified Software. This thesis covers full development life-cycle from project initiation through design and evaluation to successful completion. Important findings about kernel properties, formal modelling and design decisions are discussed. The developed formal specification is fully verified and contributes to the pilot project aim of creating a formal kernel model and refining it down to implementation code. Other reusable artefacts, such as general lemmas and a new technique of ensuring transactional properties of operations are defined. The results will be curated within the Verified Software Repository. i Robertai. Aˇci¯u. Acknowledgements I would like to thank Dr Leo Freitas for his supervision, encouragement and getting me hooked on formal methods. I am also grateful to Iain Craig for the original formal specification of separation kernels. Most importantly, I would like to thank everyone who made this happen. ii Contents 1 Introduction 1 1.1 Background & motivation . 1 1.2 Objectives . 2 1.3 Outline of the thesis . 2 1.4 Statement of ethics . 2 2 Literature Review 3 2.1 Grand Challenge in Verified Software . 3 2.2 Separation kernel . 4 2.3 Verification of OS kernels . 5 2.4 Formal modelling of OS kernels . 7 2.5 Z formal specifications . 8 2.6 Summary . 9 3 Project Aims & Problem Analysis 10 3.1 Separation kernel requirements . 10 3.2 Formal model requirements . 12 3.3 Existing research . 12 3.4 Research goals and scope . 13 3.5 Summary . 15 4 Design & Methodology 16 4.1 Intended approach . 16 4.2 Structuring the specification . 18 4.3 Verification of the model . 19 4.4 Naming and style conventions . 22 4.5 Transactional operations . 23 4.6 Z/Eves theorem prover . 28 4.7 Separation kernel architecture . 29 4.8 Summary . 32 5 Basic Types, Hardware & Supporting Types 34 5.1 General lemmas . 34 5.2 Process identifiers . 35 5.3 Process type & external identifiers . 35 5.4 Process state . 36 5.5 Memory address . 36 5.6 Task state segments . 36 5.7 Interrupts . 37 5.8 Hardware . 37 5.9 Context switch . 38 5.10 Error handling . 38 5.11 Operation preconditions . 40 5.12 Messaging . 40 5.13 Segment descriptor . 41 5.14 Summary . 41 6 Process Table 42 6.1 State . 42 6.2 State evolution . 43 6.3 Interesting properties . 48 6.4 Initial state . 48 6.5 Error cases . 49 6.6 Query operations . 49 6.7 Simple process alocation operations . 50 iii 6.8 User process identifier allocation . 52 6.9 User process information allocation . 53 6.10 User process allocation . 55 6.11 Idle process allocation . 56 6.12 Process deletion . 57 6.13 Process state change . 59 6.14 Operation preconditions . 60 6.15 Automation . 62 6.16 Summary . 63 7 Process Queue 64 7.1 State . 64 7.2 Initial state . 65 7.3 Error cases . 65 7.4 Query operations . 65 7.5 Enqueue operations . 66 7.6 Dequeue operations . 67 7.7 Operation preconditions . 67 7.8 Automation . 68 7.9 Device queue . 68 7.10 Summary . 69 8 Scheduler 70 8.1 State . ..