Capabilities in seL4 Types of Authority Resource Management - - PowerPoint PPT Presentation

capabilities in sel4
SMART_READER_LITE
LIVE PREVIEW

Capabilities in seL4 Types of Authority Resource Management - - PowerPoint PPT Presentation

Capabilities in seL4 David Cock Background Microkernel Systems seL4 & Barrelfish Authorisation and Delegation Capabilities in seL4 Types of Authority Resource Management Implementation Model Representation David Cock Operations


slide-1
SLIDE 1

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Capabilities in seL4

David Cock May 13, 2015

1 / 32

slide-2
SLIDE 2

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Microkernels

App

write

  • App
  • recv
  • FS

IO Net

Kernel AS

  • Partition an OS into servers.
  • Small, trusted kernel.
  • Core primitives:

2 / 32

slide-3
SLIDE 3

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Microkernels

App

write

  • App
  • recv
  • FS

IO Net

Kernel AS

  • Partition an OS into servers.
  • Small, trusted kernel.
  • Core primitives:
  • Threads

2 / 32

slide-4
SLIDE 4

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Microkernels

App

write

  • App
  • recv
  • FS

IO Net

Kernel AS

  • Partition an OS into servers.
  • Small, trusted kernel.
  • Core primitives:
  • Threads
  • Address spaces

2 / 32

slide-5
SLIDE 5

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Microkernels

App

write

  • App
  • recv
  • FS

IO Net

Kernel AS

  • Partition an OS into servers.
  • Small, trusted kernel.
  • Core primitives:
  • Threads
  • Address spaces
  • IPC

2 / 32

slide-6
SLIDE 6

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

seL4 & Barrelfish

  • Classical µkernel.
  • 1 CPU performance.
  • Embedded systems.
  • High assurance/verified.
  • Multikernel.
  • Scalability.
  • Large systems.
  • The seL4 capability system was adapted to Barrelfish.
  • Concurrency means real challenges.

3 / 32

slide-7
SLIDE 7

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Systems on a Microkernel

An seL4/Barrelfish system is a set of processes, built from: Kernel Objects

  • Execution contexts (Barrelfish) / Threads (seL4).
  • Communication endpoints.

Hardware Objects

  • Memory regions (frames).
  • Address translations (page tables).
  • Interrupt routing tables.

4 / 32

slide-8
SLIDE 8

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Access Control in seL4/Barrelfish

Subjects are user-level processes. Object access is kernel (seL4) / CPU driver (BF) -enforced. Kernel Objects are only accessed during system calls, where the kernel checks permissions. Hardware Objects are accessed through hardware security mechanisms (e.g. MMU), which are configured by the kernel via system calls. The kernel and MMU form a reference monitor.

5 / 32

slide-9
SLIDE 9

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Capabilities

subject

invokes

  • Capability

Object

Authority is granted by capabilities (caps):

  • Unforgeable (kernel/CPU driver checked).
  • Transferrable.
  • Extensible.

6 / 32

slide-10
SLIDE 10

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The Capability System

Framecap

  • Page Tablecap
  • VSpacecap
  • Frame

Page Table VSpace − − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • All objects referred to by caps.
  • All system calls are cap invocations.
  • Hardware structures mirrored in cap structure.
  • Kernel ops are (mostly) atomic, also local on Barrelfish.

7 / 32

slide-11
SLIDE 11

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The Capability System

map Framecap

  • Page Tablecap
  • VSpacecap
  • Frame

Page Table VSpace − − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • All objects referred to by caps.
  • All system calls are cap invocations.
  • Hardware structures mirrored in cap structure.
  • Kernel ops are (mostly) atomic, also local on Barrelfish.

7 / 32

slide-12
SLIDE 12

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The Capability System

map Framecap

  • Page Tablecap
  • VSpacecap
  • Frame

Page Table

  • VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • All objects referred to by caps.
  • All system calls are cap invocations.
  • Hardware structures mirrored in cap structure.
  • Kernel ops are (mostly) atomic, also local on Barrelfish.

7 / 32

slide-13
SLIDE 13

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The Capability System

map Framecap

  • Page Tablecap
  • VSpacecap
  • Frame

Page Table

  • VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • All objects referred to by caps.
  • All system calls are cap invocations.
  • Hardware structures mirrored in cap structure.
  • Kernel ops are (mostly) atomic, also local on Barrelfish.

7 / 32

slide-14
SLIDE 14

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The Capability System

map Framecap

  • Page Tablecap
  • VSpacecap
  • Frame

Page Table

  • VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • All objects referred to by caps.
  • All system calls are cap invocations.
  • Hardware structures mirrored in cap structure.
  • Kernel ops are (mostly) atomic, also local on Barrelfish.

7 / 32

slide-15
SLIDE 15

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The Capability System

Framecap

  • Page Tablecap
  • VSpacecap
  • Frame

Page Table

  • VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • All objects referred to by caps.
  • All system calls are cap invocations.
  • Hardware structures mirrored in cap structure.
  • Kernel ops are (mostly) atomic, also local on Barrelfish.

7 / 32

slide-16
SLIDE 16

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1 Framecap

  • Page Tablecap
  • VSpacecap
  • Frame

Page Table

  • VSpace
  • thread2

− − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • CSpaces hold caps: explicit authority.

8 / 32

slide-17
SLIDE 17

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1

CSpace

  • CSpace
  • CSpace
  • Framecap
  • Page Tablecap
  • VSpacecap
  • Frame

Page Table

  • VSpace
  • thread2

− − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • CSpaces hold caps: explicit authority.

8 / 32

slide-18
SLIDE 18

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1

CSpace

  • CSpace
  • CSpace
  • Framecap
  • KOP
  • Page Tablecap
  • KOP
  • VSpacecap

KOP

  • Frame

Page Table

  • VSpace
  • thread2

− − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

  • CSpaces hold caps: explicit authority.

8 / 32

slide-19
SLIDE 19

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1

CSpace

  • CSpace
  • CSpace
  • Framecap
  • KOP
  • Page Tablecap
  • KOP
  • VSpacecap

KOP

  • Frame

Page Table

  • VSpace
  • thread2

− − − − − − − − − − − − − − − − − − − − − − − − − − − − − −

1 1 1

  • CSpaces hold caps: explicit authority.

8 / 32

slide-20
SLIDE 20

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1

CSpace

  • CSpace
  • CSpace
  • Framecap
  • KOP
  • Page Tablecap
  • KOP
  • VSpacecap

KOP

  • Frame

Page Table

  • VSpace
  • thread2

VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − −

1 1 1

  • CSpaces hold caps: explicit authority.

8 / 32

slide-21
SLIDE 21

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1

CSpace

  • CSpace
  • CSpace
  • Framecap
  • KOP
  • Page Tablecap
  • KOP
  • VSpacecap

KOP

  • Frame

Page Table

  • HW
  • VSpace
  • HW
  • thread2

VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − −

1 1 1

  • CSpaces hold caps: explicit authority.

8 / 32

slide-22
SLIDE 22

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1

CSpace

  • CSpace
  • CSpace
  • Framecap
  • KOP
  • Page Tablecap
  • KOP
  • VSpacecap

KOP

  • Frame

Page Table

  • HW
  • VSpace
  • HW
  • thread2

R/W

  • VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − −

1 ,2 1 1

  • CSpaces hold caps: explicit authority.
  • HW gives implicit authority e.g. read/write.

8 / 32

slide-23
SLIDE 23

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CSpaces and Authority

thread1

CSpace

  • CSpace
  • CSpace
  • Framecap
  • KOP
  • Page Tablecap
  • KOP
  • VSpacecap

KOP

  • Frame

Page Table

  • HW
  • VSpace
  • HW
  • thread2

R/W

  • VSpace

− − − − − − − − − − − − − − − − − − − − − − − − − − − − −

1 ,2 1 1

  • CSpaces hold caps: explicit authority.
  • HW gives implicit authority e.g. read/write.
  • implicit authority explicit authority.

8 / 32

slide-24
SLIDE 24

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Kernel Resource Allocation

Traditional kernels, including L4, allocate resources for clients: Scheduling queues, IPC queues, ....

9 / 32

slide-25
SLIDE 25

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Kernel Resource Allocation

Traditional kernels, including L4, allocate resources for clients: Scheduling queues, IPC queues, ....

  • Threads compete for shared resources.
  • Hard to account to threads.
  • Allocation policy in the kernel.

9 / 32

slide-26
SLIDE 26

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retyping

RAM0–127

A

grant B grant C

RAM0–63

B

RAM64–127

C

Frame

B

EP

B

Thread

C

  • Resource manager A retypes (splits) a RAM object.

10 / 32

slide-27
SLIDE 27

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retyping

RAM0–127

A

grant B grant C

RAM0–63

B

RAM64–127

C

Frame

B

EP

B

Thread

C

  • Resource manager A retypes (splits) a RAM object.
  • A grants new caps to mutually untrusting B & C.

10 / 32

slide-28
SLIDE 28

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retyping

RAM0–127

A

grant B grant C

RAM0–63

B

RAM64–127

C

Frame

B

EP

B

Thread

C

  • Resource manager A retypes (splits) a RAM object.
  • A grants new caps to mutually untrusting B & C.
  • B & C now have partioned resources.

10 / 32

slide-29
SLIDE 29

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retyping

RAM0–127

A

grant B grant C

RAM0–63

B

RAM64–127

C

Frame

B

EP

B

Thread

C

  • Resource manager A retypes (splits) a RAM object.
  • A grants new caps to mutually untrusting B & C.
  • B & C now have partioned resources.
  • They can perform further retyping themselves.

10 / 32

slide-30
SLIDE 30

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retyping

RAM0–127

A

grant B grant C

RAM0–63

B

RAM64–127

C

Frame

B

EP

B

Thread

C

  • Resource manager A retypes (splits) a RAM object.
  • A grants new caps to mutually untrusting B & C.
  • B & C now have partioned resources.
  • They can perform further retyping themselves.
  • All kernel & user resources are allocated thusly.

10 / 32

slide-31
SLIDE 31

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The Authority Database Model

The kernel maintains a database of valid capabilities, with requirements: Atomicity Users (subjects) always see a consistent state. Performance Cap lookup is on the critical path. No Allocation Bookkeeping must be stored somewhere. I will describe the seL4/sequential case. Simon will discuss the Barrelfish/concurrent case.

11 / 32

slide-32
SLIDE 32

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

.

  • CNodes objects store caps and bookkeeping.

12 / 32

slide-33
SLIDE 33

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot .

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.

12 / 32

slide-34
SLIDE 34

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . RAM

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.

12 / 32

slide-35
SLIDE 35

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode RAM CNode

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.

12 / 32

slide-36
SLIDE 36

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode RAM CNode

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.

12 / 32

slide-37
SLIDE 37

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode RAM CNode EP RAM Frame Thread

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.

12 / 32

slide-38
SLIDE 38

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode

00

RAM

01

CNode

10

EP

00

RAM

01

Frame

00

Thread

10

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.
  • What’s at 1000?

12 / 32

slide-39
SLIDE 39

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode

00

RAM

01

CNode

10

EP

00

RAM

01

Frame

00

Thread

10

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.
  • What’s at 1000?

12 / 32

slide-40
SLIDE 40

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode

00

RAM

01

CNode

10

EP

00

RAM

01

Frame

00

Thread

10

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.
  • What’s at 1000? An endpoint.

12 / 32

slide-41
SLIDE 41

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode

00

RAM

01

CNode

10

EP

00

RAM

01

CNode

11

Frame

00

Thread

10

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.
  • What’s at 1000? An endpoint.
  • CSpaces may have cycles, but finite effective depth.

12 / 32

slide-42
SLIDE 42

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

CNodes

CRoot . CNode

00

RAM

01

CNode

10

EP

00

RAM

01

CNode

11

Frame

00

Thread

10

  • CNodes objects store caps and bookkeeping.
  • A CSpace is all caps reachable from a CRoot.
  • CNodes are themselves managed with caps.
  • What’s at 1000? An endpoint.
  • CSpaces may have cycles, but finite effective depth.
  • Every invocation is an authority DB query.

12 / 32

slide-43
SLIDE 43

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB:

13 / 32

slide-44
SLIDE 44

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB: Mint/Retype Derive new sub-objects, and caps to them.

13 / 32

slide-45
SLIDE 45

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB: Mint/Retype Derive new sub-objects, and caps to them. Copy Create a new cap to an object. The old and new caps are (mostly) indistinguishable.

13 / 32

slide-46
SLIDE 46

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB: Mint/Retype Derive new sub-objects, and caps to them. Copy Create a new cap to an object. The old and new caps are (mostly) indistinguishable. Move Move caps within or between CNodes.

13 / 32

slide-47
SLIDE 47

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB: Mint/Retype Derive new sub-objects, and caps to them. Copy Create a new cap to an object. The old and new caps are (mostly) indistinguishable. Move Move caps within or between CNodes. Delete Remove the cap. Destroy the object once the last cap is gone.

13 / 32

slide-48
SLIDE 48

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB: Mint/Retype Derive new sub-objects, and caps to them. Copy Create a new cap to an object. The old and new caps are (mostly) indistinguishable. Move Move caps within or between CNodes. Delete Remove the cap. Destroy the object once the last cap is gone. Revoke Destroy all objects derived (via retype) from this one.

13 / 32

slide-49
SLIDE 49

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB: Mint/Retype Derive new sub-objects, and caps to them. Copy Create a new cap to an object. The old and new caps are (mostly) indistinguishable. Move Move caps within or between CNodes. Delete Remove the cap. Destroy the object once the last cap is gone. Revoke Destroy all objects derived (via retype) from this one. Delete and Revoke call each other, and are long-running.

13 / 32

slide-50
SLIDE 50

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cap Operations

These mutate the authority DB: Mint/Retype Derive new sub-objects, and caps to them. Copy Create a new cap to an object. The old and new caps are (mostly) indistinguishable. Move Move caps within or between CNodes. Delete Remove the cap. Destroy the object once the last cap is gone. Revoke Destroy all objects derived (via retype) from this one. Delete and Revoke call each other, and are long-running. The recursion is not atomic — Preemptible on seL4, done in a user-level monitor on Barrelfish.

13 / 32

slide-51
SLIDE 51

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retype

CRoot . RAM1 CRoot

  • RAM1

RAM1

14 / 32

slide-52
SLIDE 52

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retype

CRoot . RAM1

  • RAM2

RAM3 CRoot

  • RAM1

RAM2 RAM3 RAM1

  • RAM2

RAM3

RAM caps may be split.

14 / 32

slide-53
SLIDE 53

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retype

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

CRoot

  • CNode1

RAM1 RAM2 RAM3 RAM1

  • RAM2
  • RAM3

CNode1

CNodes are created like other objects.

14 / 32

slide-54
SLIDE 54

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Retype

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

Frame1

  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM2 RAM3 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

RAM must become Frames before being mapped.

14 / 32

slide-55
SLIDE 55

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Move

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

Frame1

  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM2 RAM3 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

15 / 32

slide-56
SLIDE 56

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Move

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

Frame1

  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM2 RAM3 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

Moving within CNode doesn’t affect trees.

15 / 32

slide-57
SLIDE 57

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Move

CRoot . CNode1 RAM1

  • RAM3

RAM2

  • Frame1
  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

Moving between affects CSpace but not ancestry.

15 / 32

slide-58
SLIDE 58

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Copy

CRoot . CNode1 RAM1

  • RAM3

RAM2

  • Frame1
  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

16 / 32

slide-59
SLIDE 59

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Copy

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame1
  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

16 / 32

slide-60
SLIDE 60

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Copy

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame1
  • Frame2
  • Frame2
  • CRoot
  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

Copies make the CSpace a proper DAG.

16 / 32

slide-61
SLIDE 61

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Delete

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame1
  • Frame2
  • Frame2
  • CRoot
  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

17 / 32

slide-62
SLIDE 62

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Delete

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame1
  • Frame2
  • Frame2
  • CRoot
  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

Deleting non-final leaf caps is easy.

17 / 32

slide-63
SLIDE 63

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Delete

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame1
  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

Deleting non-final leaf caps is easy.

17 / 32

slide-64
SLIDE 64

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Delete

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame1
  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1 Frame1

Frame2

Deleting the last cap deletes the object.

17 / 32

slide-65
SLIDE 65

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Delete

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame2

Deleting the last cap deletes the object.

17 / 32

slide-66
SLIDE 66

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Revoke

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame2

Revoke walks the ancestry tree.

18 / 32

slide-67
SLIDE 67

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Revoke

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame2

Mark RAM3 for revocation.

18 / 32

slide-68
SLIDE 68

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Revoke

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • Frame2
  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame2

Mark its descendents for deletion.

18 / 32

slide-69
SLIDE 69

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Revoke

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 RAM1

  • RAM2
  • RAM3

CNode1

Delete them.

18 / 32

slide-70
SLIDE 70

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Revoke

CRoot . CNode1 RAM1

  • RAM2
  • RAM3

RAM2

  • CRoot
  • CNode1
  • RAM1

RAM3 RAM2 RAM1

  • RAM2
  • RAM3

CNode1

The root can now be deleted, if required.

18 / 32

slide-71
SLIDE 71

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Revoke

CRoot . CNode1 RAM1

  • RAM2
  • RAM2
  • CRoot
  • CNode1
  • RAM1

RAM2 RAM1

  • RAM2
  • CNode1

18 / 32

slide-72
SLIDE 72

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM1

  • RAM2
  • RAM2
  • CRoot
  • CNode1
  • RAM1

RAM2 RAM1

  • RAM2
  • CNode1

Move RAM1.

19 / 32

slide-73
SLIDE 73

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM2

  • RAM2
  • RAM1
  • CRoot
  • CNode1
  • RAM2

RAM1 RAM1

  • RAM2
  • CNode1

There’s now a loop, with links in both trees.

19 / 32

slide-74
SLIDE 74

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM2

  • RAM2
  • RAM1
  • CRoot
  • CNode1
  • RAM2

RAM1 RAM1

  • RAM2
  • CNode1

Let’s revoke RAM2, a child.

19 / 32

slide-75
SLIDE 75

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM2

  • RAM2
  • RAM1
  • CRoot
  • CNode1
  • RAM2

RAM1 RAM1

  • RAM2
  • CNode1

Mark its descendents for deletion.

19 / 32

slide-76
SLIDE 76

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM2

  • RAM2
  • RAM1
  • CRoot
  • CNode1
  • RAM2

RAM1 RAM1

  • RAM2
  • CNode1

Deleting a CNode first deletes (revokes) its contents.

19 / 32

slide-77
SLIDE 77

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM2

  • RAM2
  • RAM1
  • CRoot
  • CNode1
  • RAM2

RAM1 RAM1

  • RAM2
  • CNode1

Revoking RAM2 deletes RAM1.

19 / 32

slide-78
SLIDE 78

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM2

  • RAM1
  • CRoot
  • CNode1
  • RAM2

RAM1 RAM1

  • RAM2
  • CNode1

Delete starts bottom up. This RAM2 cap is safe to delete.

19 / 32

slide-79
SLIDE 79

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM2

  • RAM1
  • CRoot
  • CNode1
  • RAM2

RAM1 RAM1

  • RAM2
  • CNode1

19 / 32

slide-80
SLIDE 80

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM1

  • CRoot
  • CNode1
  • RAM1

RAM1

  • CNode1

When RAM2 is destroyed, RAM1 adopts children. Now we’ve got an irreducible cycle.

19 / 32

slide-81
SLIDE 81

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM1

  • CRoot
  • CNode1
  • RAM1

RAM1

  • CNode1

RAM1’s revoke is finished, now delete it, but how?

19 / 32

slide-82
SLIDE 82

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CNode1 RAM1

  • swap
  • CRoot
  • CNode1
  • RAM1

RAM1

  • CNode1

In seL4, we swap the last two caps.

19 / 32

slide-83
SLIDE 83

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . RAM1 CNode1

  • CRoot
  • RAM1
  • CNode1

RAM1

  • CNode1

CNode1 can now safely be deleted.

19 / 32

slide-84
SLIDE 84

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . RAM1 CRoot

  • RAM1

RAM1

Finally, RAM1 goes too.

19 / 32

slide-85
SLIDE 85

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Recursive Revoke & Delete

CRoot . CRoot

This process accidentally destroyed its whole world.

19 / 32

slide-86
SLIDE 86

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Invariants

In seL4 CRoot

  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame1 Frame2

20 / 32

slide-87
SLIDE 87

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Invariants

In seL4 CRoot

  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame1 Frame2

  • Ancestry is a tree (forest).

20 / 32

slide-88
SLIDE 88

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Invariants

In seL4 CRoot

  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame1 Frame2

  • Ancestry is a tree (forest).
  • ∃Object → ∃Cap.

20 / 32

slide-89
SLIDE 89

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Invariants

In seL4 CRoot

  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame1 Frame2

  • Ancestry is a tree (forest).
  • ∃Object → ∃Cap.
  • Barrelfish is not identical.

20 / 32

slide-90
SLIDE 90

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Invariants

In seL4 CRoot

  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame1 Frame2

  • Ancestry is a tree (forest).
  • ∃Object → ∃Cap.
  • Barrelfish is not identical.

We’re not sure exactly how yet.

20 / 32

slide-91
SLIDE 91

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Invariants

In seL4 CRoot

  • CNode1
  • 2
  • RAM1

RAM3 RAM2 Frame1 Frame2 RAM1

  • RAM2
  • RAM3
  • CNode1

Frame1 Frame2

  • Ancestry is a tree (forest).
  • ∃Object → ∃Cap.
  • Barrelfish is not identical.

We’re not sure exactly how yet. We’d really like to.

20 / 32

slide-92
SLIDE 92

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Results

We know quite a bit already (in the context of seL4).

  • Implementation proof.
  • Integrity proof.
  • Confidentiality proof.
  • Applications of user-level

allocation.

21 / 32

slide-93
SLIDE 93

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The System is Correctly Implemented

C Code Design Specification Haskell Prototype Access Control Spec Access Control Spec Confinement 22 / 32

slide-94
SLIDE 94

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

The System is Correctly Implemented The abstract spec is all that matters now!

23 / 32

slide-95
SLIDE 95

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Authority Confinement

EP CTR RM R A B D C AEP1 AEP2 AEP3 T

Read, Write Read, Write Read, Write Send Recv Send Send Send Recv Recv UNIV UNIV UNIV UNIV Recv

Figure: The Secure Access Controller

seL4 implements the take-grant model:

24 / 32

slide-96
SLIDE 96

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Authority Confinement

EP CTR RM R A B D C AEP1 AEP2 AEP3 T

Read, Write Read, Write Read, Write Send Recv Send Send Send Recv Recv UNIV UNIV UNIV UNIV Recv

Figure: The Secure Access Controller

seL4 implements the take-grant model: Confinement Authority (caps) only flows along edges.

24 / 32

slide-97
SLIDE 97

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Authority Confinement

EP CTR RM R A B D C AEP1 AEP2 AEP3 T

Read, Write Read, Write Read, Write Send Recv Send Send Send Recv Recv UNIV UNIV UNIV UNIV Recv

Figure: The Secure Access Controller

seL4 implements the take-grant model: Confinement Authority (caps) only flows along edges. Integrity Objects only modified via (transient) authority.

24 / 32

slide-98
SLIDE 98

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Information Flow

Thread Thread PD CNode PT Page SPage Thread PD PT CNode AEP AsyncSend RW R Partition 1 Partition 2 Recv

seL4 enforces information flow policy:

25 / 32

slide-99
SLIDE 99

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Information Flow

Thread Thread PD CNode PT Page SPage Thread PD PT CNode AEP AsyncSend RW R Partition 1 Partition 2 Recv

seL4 enforces information flow policy:

  • Builds on integrity proof.

25 / 32

slide-100
SLIDE 100

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Information Flow

Thread Thread PD CNode PT Page SPage Thread PD PT CNode AEP AsyncSend RW R Partition 1 Partition 2 Recv

seL4 enforces information flow policy:

  • Builds on integrity proof.
  • No flow via kernel mechanisms e.g. scheduler.

25 / 32

slide-101
SLIDE 101

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Information Flow

Thread Thread PD CNode PT Page SPage Thread PD PT CNode AEP AsyncSend RW R Partition 1 Partition 2 Recv

seL4 enforces information flow policy:

  • Builds on integrity proof.
  • No flow via kernel mechanisms e.g. scheduler.
  • No IPC back channel (data diode).

25 / 32

slide-102
SLIDE 102

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Lessons

  • Caps aren’t slow.
  • Strong security results are possible.
  • Interposability has seldom been used.

26 / 32

slide-103
SLIDE 103

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Questions?

27 / 32

slide-104
SLIDE 104

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Address Spaces in L4

L4 used hierarchical virtual address spaces, and regions were granted to descendents. σ0

  • σ1
  • σ3

σ3

28 / 32

slide-105
SLIDE 105

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Address Spaces in L4

L4 used hierarchical virtual address spaces, and regions were granted to descendents. σ0

  • grant X,Y
  • σ1
  • σ3

σ3

28 / 32

slide-106
SLIDE 106

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Address Spaces in L4

L4 used hierarchical virtual address spaces, and regions were granted to descendents. σ0

  • grant X,Y
  • σ1
  • grant X
  • σ3

σ3

28 / 32

slide-107
SLIDE 107

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Address Spaces in L4

L4 used hierarchical virtual address spaces, and regions were granted to descendents. σ0

  • grant X,Y
  • σ1
  • grant X
  • σ3

σ3 + Allowed user paging & delegation.

28 / 32

slide-108
SLIDE 108

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Address Spaces in L4

L4 used hierarchical virtual address spaces, and regions were granted to descendents. σ0

  • grant X,Y
  • σ1
  • grant X
  • σ3

σ3 + Allowed user paging & delegation. − Only exposed virtual addresses. − Kernel memory not covered.

28 / 32

slide-109
SLIDE 109

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Clans and Chiefs

Threads belong to clans. Messages between clans go via chiefs. chief0

  • chief1
  • thread0

thread1 thread2

29 / 32

slide-110
SLIDE 110

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Clans and Chiefs

Threads belong to clans. Messages between clans go via chiefs. chief0

  • chief1
  • thread0

thread1 thread2

  • 29 / 32
slide-111
SLIDE 111

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Clans and Chiefs

Threads belong to clans. Messages between clans go via chiefs. chief0

  • chief1
  • thread0

thread1 thread2

  • 29 / 32
slide-112
SLIDE 112

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Clans and Chiefs

Threads belong to clans. Messages between clans go via chiefs. chief0

  • chief1
  • thread0

thread1 thread2

  • + Allows communication control.

29 / 32

slide-113
SLIDE 113

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Clans and Chiefs

Threads belong to clans. Messages between clans go via chiefs. chief0

  • chief1
  • thread0

thread1 thread2

  • + Allows communication control.

− Static and inflexible. − Introduces latency. − Addresses still global.

29 / 32

slide-114
SLIDE 114

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Interposability

client

invoke c

TCB

EP server Extend system w/o modifying kernel:

  • Syscalls are messages to objects.
  • Send messages by invoking caps.

30 / 32

slide-115
SLIDE 115

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Interposability

client

invoke c

  • TCB

EP server Extend system w/o modifying kernel:

  • Syscalls are messages to objects.
  • Send messages by invoking caps.
  • Transparently replace object cap with endpoint cap.

30 / 32

slide-116
SLIDE 116

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Interposability

client

invoke c

  • TCB

EP

recv

server

Extend system w/o modifying kernel:

  • Syscalls are messages to objects.
  • Send messages by invoking caps.
  • Transparently replace object cap with endpoint cap.
  • Server implements object semantics.

30 / 32

slide-117
SLIDE 117

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Design for Verification

The cost of verification is high, so avoid kernel changes.

  • Mechanisms as general as

possible.

  • Only one primitive to reason

about: cap invocation.

  • Amenable to analysis:

take-grant model.

  • Highly flexible

resolution/sharing model: GPT.

31 / 32

slide-118
SLIDE 118

Capabilities in seL4 David Cock Background

Microkernel Systems seL4 & Barrelfish

Authorisation and Delegation

Types of Authority Resource Management

Implementation

Model Representation Operations

Usage & Results

The seL4 Proofs Applications

Questions

Cache Colouring

Example of delegated allocation:

  • Isolate subsystems in cache for performance or security.
  • Requires control of physical allocation.
  • Also partitions kernel memory, with no kernel changes!

32 / 32