data61.csiro.au
Provably Trustworthy Systems
seL4 and beyond
Gerwin Klein Royal Society Meeting on Verified trustworthy software systems April 2016
Provably Trustworthy Systems seL4 and beyond Gerwin Klein Royal - - PowerPoint PPT Presentation
Provably Trustworthy Systems seL4 and beyond Gerwin Klein Royal Society Meeting on Verified trustworthy software systems April 2016 data61.csiro.au Formal verification of real systems is happening! Formal verification of real systems
data61.csiro.au
Gerwin Klein Royal Society Meeting on Verified trustworthy software systems April 2016
Proof Engineering | Gerwin Klein 3
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
– verified interactive HOL theorem prover implementation
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
– verified interactive HOL theorem prover implementation
– verified SSL implementation
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
– verified interactive HOL theorem prover implementation
– verified SSL implementation
– verified conference system
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
– verified interactive HOL theorem prover implementation
– verified SSL implementation
– verified conference system
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
– verified interactive HOL theorem prover implementation
– verified SSL implementation
– verified conference system
– verified crypto implementation
Proof Engineering | Gerwin Klein 3
– verified OS kernel implementation
– verified compiler implementation
– verified distributed system
– verified interactive HOL theorem prover implementation
– verified SSL implementation
– verified conference system
– verified crypto implementation
– verified crash resistance file system
Proof Engineering | Gerwin Klein 5
Proof Engineering | Gerwin Klein 5
– cheaper than traditional high-assurance dev – factor 2-3 over high-quality traditional embedded systems dev
Proof Engineering | Gerwin Klein 7
Proof Engineering | Gerwin Klein 7
– more automation, deeper automation, built for scale
– predictability, estimation, scale
– design for verification, increase verification productivity
Proof Engineering | Gerwin Klein 8
Proof Engineering | Gerwin Klein 10
Trustworthy Computing Base
Applications
Trusted next to Untrusted
Hardware Linux Server
Legacy App. Legacy App.
Legacy Apps
Trusted Service Sensitive App
Trusted Untrusted
Proof Engineering | Gerwin Klein 10
Trustworthy Computing Base
Applications
Trusted next to Untrusted
Hardware
seL4
Linux Server
Legacy App. Legacy App.
Legacy Apps
Trusted Service Sensitive App
Trusted Untrusted
Proof Engineering | Gerwin Klein
Specification Code
11
Proof Engineering | Gerwin Klein
Specification Code
11
definition schedule :: unit s_monad where schedule do threads ⇥ allActiveTCBs; thread ⇥ select threads; switch_to_thread thread
OR switch_to_idle_thread
Proof Engineering | Gerwin Klein
Specification Code
11
definition schedule :: unit s_monad where schedule do threads ⇥ allActiveTCBs; thread ⇥ select threads; switch_to_thread thread
OR switch_to_idle_thread
Proof Engineering | Gerwin Klein 12
Proof Specification Code
Proof Engineering | Gerwin Klein 12
Proof Expectation Assumptions Specification Code
Proof Engineering | Gerwin Klein 12
Proof Expectation Assumptions Specification Code
Assume correct:
Proof Engineering | Gerwin Klein
Isabelle
13
C Code Semantics Design Specification Binary Code Semantics Availability
Isabelle/SMT/HOL4 Isabelle Isabelle Isabelle
Confidentiality Integrity WCET Analysis Haskell Prototype Binary Code C Code
Proof Engineering | Gerwin Klein
Isabelle
13
C Code Semantics Design Specification Binary Code Semantics Availability
Isabelle/SMT/HOL4 Isabelle Isabelle Isabelle
Confidentiality Integrity WCET Analysis
High-level properties:
(by static analysis) Roadmap:
Haskell Prototype Binary Code C Code
Proof Engineering | Gerwin Klein
Isabelle
13
C Code Semantics Design Specification Binary Code Semantics Availability
Isabelle/SMT/HOL4 Isabelle Isabelle Isabelle
Confidentiality Integrity WCET Analysis
High-level properties:
(by static analysis) Roadmap:
Haskell Prototype Binary Code C Code
http://seL4.systems https://github.com/seL4/
Proof Engineering | Gerwin Klein 14
Proof Engineering | Gerwin Klein 14
3, 2, 1..
Proof Engineering | Gerwin Klein 16
size of AFP entries by submission date
Archive of Formal Proofs
Proof Engineering | Gerwin Klein 17
size of AFP entries by submission date with Four-Colour theorem, Odd-Order theorem, Verisoft, seL4
Proof Engineering | Gerwin Klein 18
Proof Engineering | Gerwin Klein 18
Raf’s Observation
The introspection of proof and theories is an essential part of working on a large-scale verification development.
Proof Engineering | Gerwin Klein 20
– “software engineering” 1,430,000 results
Proof Engineering | Gerwin Klein 20
– “software engineering” 1,430,000 results
– “proof engineering” 564 results
Proof Engineering | Gerwin Klein 20
– “software engineering” 1,430,000 results
Includes ”The Fireproof Building” and “Influence of water permeation and analysis
– “proof engineering” 564 results
Proof Engineering | Gerwin Klein 21
refactoring and IDEs apply
Proof Engineering | Gerwin Klein 21
refactoring and IDEs apply
Proof Engineering | Gerwin Klein 22
Proof Engineering | Gerwin Klein 23
– decomposition of proofs over people, – custom proof calculus, – automating mechanical tasks, custom tactics – proof craft
Proof Engineering | Gerwin Klein 23
– decomposition of proofs over people, – custom proof calculus, – automating mechanical tasks, custom tactics – proof craft
Tim’s Statement
Automating “donkey work” allows attention and effort to be focussed where most needed – but it must be done judiciously.
Proof Engineering | Gerwin Klein 23
– decomposition of proofs over people, – custom proof calculus, – automating mechanical tasks, custom tactics – proof craft
– non-local change, – speculative change, – distributed development
Tim’s Statement
Automating “donkey work” allows attention and effort to be focussed where most needed – but it must be done judiciously.
Proof Engineering | Gerwin Klein 23
– decomposition of proofs over people, – custom proof calculus, – automating mechanical tasks, custom tactics – proof craft
– non-local change, – speculative change, – distributed development
Matthias’ Conjecture
Over the years, I must have waited weeks for
check cycle; for that, I am even willing to (temporarily) sacrifice soundness.
Tim’s Statement
Automating “donkey work” allows attention and effort to be focussed where most needed – but it must be done judiciously.
Proof Engineering | Gerwin Klein 24
– changes, updates, new proofs, new features – automated regression, keep code in sync – refactoring – simplification
Proof Engineering | Gerwin Klein 24
– changes, updates, new proofs, new features – automated regression, keep code in sync – refactoring – simplification
Dan’s Conclusion
Verification is fast, maintenance is forever.
Proof Engineering | Gerwin Klein 25
powerful than code IDEs?
Proof Engineering | Gerwin Klein 25
powerful than code IDEs?
new kinds of refactoring possible, e.g.
– move to best position in library – generalise lemma – recognise proof patterns
Proof Engineering | Gerwin Klein 26
– layers, modules, components, abstractions, genericity
Proof Engineering | Gerwin Klein 26
– layers, modules, components, abstractions, genericity
Proof Engineering | Gerwin Klein 28
Can we predict for proofs:
Proof Engineering | Gerwin Klein 28
Can we predict for proofs:
Of course not. Many hard problems look deceptively easy.
Proof Engineering | Gerwin Klein 28
Can we predict for proofs:
Of course not. Many hard problems look deceptively easy. But maybe for program verification? At least statistically, some of the time?
Proof Engineering | Gerwin Klein 28
Can we predict for proofs:
Of course not. Many hard problems look deceptively easy. But maybe for program verification? At least statistically, some of the time? We have large proofs. Let’s crunch some data!
Proof Engineering | Gerwin Klein 29
Code Size is correlated with Spec Size
Proof Engineering | Gerwin Klein 29
AInvs Idealised Statement Size vs. Proof Size Idealised Statement Size Proof Size
R 2 = 0.937Spec Size is correlated with Proof Size Code Size is correlated with Spec Size
Proof Engineering | Gerwin Klein 29
AInvs Idealised Statement Size vs. Proof Size Idealised Statement Size Proof Size
R 2 = 0.937Spec Size is correlated with Proof Size Code Size is correlated with Spec Size Proof Size is correlated with Effort
Proof Engineering | Gerwin Klein 29
AInvs Idealised Statement Size vs. Proof Size Idealised Statement Size Proof Size
R 2 = 0.937Spec Size is correlated with Proof Size Code Size is correlated with Spec Size Proof Size is correlated with Effort There may be hope for a prediction model. Probably applies to verification of non-modular code. Unlikely to work for other kinds of proofs, but likely to transfer to other interactive provers.
Proof Engineering | Gerwin Klein 31
Hardware
Proof Engineering | Gerwin Klein 31
Hardware
seL4
Unverified Linux Server Legacy App
Cogent File System Guardol Network Filter Ivory Driver Synthesised Driver CakeML native Application CakeML extracted Application Cryptol Crypto Library
Proof Engineering | Gerwin Klein 31
Hardware
seL4
Unverified Linux Server Legacy App
Cogent File System Guardol Network Filter Ivory Driver Synthesised Driver CakeML native Application CakeML extracted Application Cryptol Crypto Library
Will need formal interfaces
Proof Engineering | Gerwin Klein 32
Proof Engineering | Gerwin Klein 32
Proof Engineering | Gerwin Klein 32
Proof Engineering | Gerwin Klein 32
Proof Engineering | Gerwin Klein 32
data61.csiro.au
Trustworthy Systems Gerwin Klein t +61 2 8306 0578 e gerwin.klein@nicta.com.au w http://trustworthy.systems