Coder Social home page Coder Social logo

coliasgroup / l4v Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sel4/l4v

0.0 0.0 0.0 59.79 MB

seL4 specification and proofs

Home Page: https://sel4.systems

License: Other

Shell 0.05% C++ 0.01% Python 0.46% Perl 0.01% C 0.69% OCaml 0.20% Haskell 1.58% Standard ML 2.77% TeX 0.60% Isabelle 93.44% Makefile 0.07% CMake 0.01% Lex 0.06% Vim Script 0.08%

l4v's Introduction

DOI CI Proofs Weekly Clean External

MCS:
CI RT Proofs

This is the L4.verified git repository with formal specifications and proofs for the seL4 microkernel.

Most proofs in this repository are conducted in the interactive proof assistant Isabelle/HOL. For an introduction to Isabelle, see its official website and documentation.

Setup

This repository is meant to be used as part of a Google repo setup. Instead of cloning it directly, please follow the directions for software dependencies and Isabelle installation in the setup.md file in the docs directory.

Contributing

Contributions to this repository are welcome. Please read CONTRIBUTING.md for details.

Overview

The repository is organised as follows.

  • docs: documentation on conventions, style, etc.

  • spec: a number of different formal specifications of seL4

    • abstract: the functional abstract specification of seL4

    • sep-abstract: an abstract specification for a reduced version of seL4 that is configured as a separation kernel

    • haskell: Haskell model of the seL4 kernel, kept in sync with the C code

    • machine: the machine interface of these two specifications

    • cspec: the entry point for automatically translating the seL4 C code into Isabelle

    • capDL: a specification of seL4 that abstracts from memory content and concrete execution behaviour, modelling the protection state of the system in terms of capabilities. This specification corresponds to the capability distribution language capDL that can be used to initialise user-level systems on top of seL4.

    • take-grant: a formalisation of the classical take-grant security model, applied to seL4, but not connected to the code of seL4.

    • There are additional specifications that are not tracked in this repository, but are generated from other files:

      • design: the design-level specification of seL4, generated from the Haskell model.
      • c: the C code of the seL4 kernel, preprocessed into a form that can be read into Isabelle. This is generated from the seL4 repository.
  • proof: the seL4 proofs

    • invariant-abstract: invariants of the seL4 abstract specification
    • refine: refinement between abstract and design specifications
    • crefine: refinement between design specification and C semantics
    • access-control: integrity and authority confinement proofs
    • infoflow: confidentiality and intransitive non-interference proofs
    • asmrefine: Isabelle/HOL part of the seL4 binary verification
    • drefine: refinement between capDL and abstract specification
    • sep-capDL: a separation logic instance on capDL
    • capDL-api: separation logic specifications of selected seL4 APIs
  • lib: generic proof libraries, proof methods and tools. Among these, further libraries for fixed-size machine words, a formalisation of state monads with nondeterminism and exceptions, a generic verification condition generator for monads, a recursive invariant prover for these (crunch), an abstract separation logic formalisation, a prototype of the Eisbach proof method language, a prototype levity refactoring tool, and others.

  • tools: larger, self-contained proof tools

    • asmrefine: the generic Isabelle/HOL part of the binary verification tool
    • c-parser: a parser from C into the Simpl language in Isabelle/HOL. Includes a C memory model.
    • autocorres: an automated, proof-producing abstraction tool from C into higher-level Isabelle/HOL functions, based on the C parser above
    • haskell-translator: a basic python script for converting the Haskell prototype of seL4 into the executable design specification in Isabelle/HOL.
  • misc: miscellaneous scripts and build tools

  • camkes: an initial formalisation of the CAmkES component platform on seL4. Work in progress.

  • sys-init: specification of a capDL-based, user-level system initialiser for seL4, with proof that the specification leads to correctly initialised systems.

Hardware requirements

Almost all proofs in this repository should work within 4GB of RAM. Proofs involving the C refinement, will usually need the 64bit mode of polyml and about 16GB of RAM.

The proofs distribute reasonably well over multiple cores, up to about 8 cores are useful.

Running the Proofs

If Isabelle is set up correctly, a full test for the proofs in this repository for seL4 on the ARM architecture can be run with the command

L4V_ARCH=ARM ./run_tests

from the directory l4v/.

Set the environment variable L4V_ARCH to one of ARM, ARM_HYP, X64, RISCV64, or AARCH64 to get the proofs for the respective architecture. ARM has the most complete set of proofs, the other architectures tend to support only a subset of the proof sessions defined for ARM.

Not all of the proof sessions can be built directly with the isabelle build command. The seL4 proofs depend on Isabelle specifications that are generated from the C source code and Haskell model. Therefore, it is recommended to always build using the run_tests command or the supplied Makefiles, which will ensure that these generated specs are up to date.

To do this, enter one level under the l4v/ directory and run make <session-name>. For example, to build the abstract specification, do

export L4V_ARCH=ARM
cd l4v/spec
make ASpec

See the HEAPS variable in the corresponding Makefile for available targets. The sessions that directly depend on generated sources are ASpec, ExecSpec, and CKernel. These, and all sessions that depend on them, need to be run using run_tests or make.

Proof sessions that do not depend on generated inputs can be built directly with

./isabelle/bin/isabelle build -d . -v -b <session name>

from the directory l4v/. For available sessions and their dependencies, see the corresponding ROOT files in this repository. There is roughly one session corresponding to each major directory in the repository.

For interactively exploring, say the invariant proof of the abstract specification on ARM, note that in proof/ROOT the parent session for AInvs is ASpec and therefore run:

export L4V_ARCH=ARM
./run_tests ASpec
./isabelle/bin/isabelle jedit -d . -R AInvs

or, if you prefer make:

export L4V_ARCH=ARM
cd spec; make ASpec
../isabelle/bin/isabelle jedit -d . -R AInvs

in l4v/ and open one of the files in proof/invariant-abstract.

l4v's People

Contributors

adriandanis avatar agomezl avatar amrzar avatar corlewis avatar danmatichuk avatar davidgreenaway avatar diekmann avatar emberian avatar fhaftmann avatar ilmarireissumies avatar japhethlim avatar lsf37 avatar mbrcknl avatar michaelmcinerney avatar michaelsproul avatar mitchellbuckley avatar mktnk3 avatar mn200 avatar pierzchalski avatar pingerino avatar ryybrr avatar santiagobautista avatar smattr avatar tobycmurray avatar victorphan avatar whalefur avatar xaphiosis avatar xurtis avatar yanok avatar zaklogician avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.