A Verified Information-Flow Architecture Arthur Azevedo de Amorim, - - PowerPoint PPT Presentation

a verified information flow architecture
SMART_READER_LITE
LIVE PREVIEW

A Verified Information-Flow Architecture Arthur Azevedo de Amorim, - - PowerPoint PPT Presentation

A Verified Information-Flow Architecture Arthur Azevedo de Amorim, Nathan Collins, Andr DeHon, Delphine Demange, C at alin Hri tcu, David Pichardie, Benjamin Pierce, Randy Pollack, Andrew T olmach January 2014 1 What if we could


slide-1
SLIDE 1

A Verified Information-Flow Architecture

Arthur Azevedo de Amorim, Nathan Collins, André DeHon, Delphine Demange, C˘ at˘ alin Hri¸ tcu, David Pichardie, Benjamin Pierce, Randy Pollack, Andrew T

  • lmach

January 2014

1

slide-2
SLIDE 2

What if we could redesign computers for security?

2

slide-3
SLIDE 3

Clean-slate redesign of entire system stack

http://www.crash-safe.org

3

slide-4
SLIDE 4

The SAFE Project

❼ Support for critical security primitives from hardware

to application levels

❼ Memory safety ❼ Strong dynamic typing ❼ Dynamic information flow and access control

❼ Design of key components informed by verification

4

slide-5
SLIDE 5

SAFE Architecture

❼ Integrate well-known mechanisms for security (e.g.

fat-pointers, type tags, . . . )

❼ Focus of this paper: flexible mechanism for

supporting information-flow control (IFC) using a hardware cache and tags

tag payload 5

slide-6
SLIDE 6

Our Goal

Formalize and verify the core IFC mechanism proposed by SAFE using the Coq proof assistant

6

slide-7
SLIDE 7

Information-Flow Control (IFC)

Track and limit information dependency in computations Noninterference (NI): Varying secret inputs does not affect public observations

7

slide-8
SLIDE 8

1@L 0@H

8

slide-9
SLIDE 9

H L 1@L 0@H

8

slide-10
SLIDE 10

H L 1@L 0@H 1@L 0@H

8

slide-11
SLIDE 11

H L 1@L 0@H 1@L 0@H 1,0 1

8

slide-12
SLIDE 12

H L 1@L 42@H

8

slide-13
SLIDE 13

H L 1@L 42@H 1@L 42@H

8

slide-14
SLIDE 14

H L 1@L 42@H 1@L 42@H 1,42 1

8

slide-15
SLIDE 15

Concrete Machine

Core model of SAFE

9

slide-16
SLIDE 16

Concrete Machine NI

9

slide-17
SLIDE 17

Concrete Machine NI

How can we prove it?

9

slide-18
SLIDE 18

Abstract Machine Concrete Machine NI

IFC baked into semantics Refined by

9

slide-19
SLIDE 19

Abstract Machine NI

Easier to show

Concrete Machine NI

Refined by

9

slide-20
SLIDE 20

Abstract Machine NI Concrete Machine NI

Preserved

NI

Refined by

9

slide-21
SLIDE 21

Abstract Machine NI Concrete Machine NI

Preserved

NI

Refined by Relies on determinism

9

slide-22
SLIDE 22

Our Contributions

Using Coq, we

❼ Model the core mechanism for supporting IFC in

SAFE (our so-called “concrete machine”)

❼ Develop a proof methodology (by refinement) for

proving this mechanism correct

10

slide-23
SLIDE 23

Information-Flow Model

11

slide-24
SLIDE 24

Abstract Machine NI Concrete Machine NI

Refined by

12

slide-25
SLIDE 25

Simple Abstract Machine

Stack machine with

  • utput channel, operating
  • n integers

❼ ❼

1 5 8

  • utput

stack

13

slide-26
SLIDE 26

Simple Abstract Machine

Input/output model:

❼ The input of a program

is its initial stack

❼ The result of executing

a program is the sequence of its

  • utputs

1 5 8

13

slide-27
SLIDE 27

IFC Abstract Machine

Label data with security levels H = high security L = low security (or, more generally, any IFC lattice) 1@L 5@L 8@H

14

slide-28
SLIDE 28

IFC Abstract Machine

Machine has semantics with standard dynamic IFC baked-in Mechanizing proof of NI is relatively straightforward 1@L 5@L 8@H

14

slide-29
SLIDE 29

IFC Abstract Machine

When low-security

  • perands are combined,

the result is low-security · · · Add Add Output · · · PC 1@L 5@L 8@H

14

slide-30
SLIDE 30

IFC Abstract Machine

When low-security

  • perands are combined,

the result is low-security · · · Add Add Output · · · PC 1@L 5@L 8@H

14

slide-31
SLIDE 31

IFC Abstract Machine

When low-security

  • perands are combined,

the result is low-security · · · Add Add Output · · · PC 6@L 8@H

14

slide-32
SLIDE 32

IFC Abstract Machine

When one operand is high- security, result is high- security · · · Add Add Output · · · PC 6@L 8@H

14

slide-33
SLIDE 33

IFC Abstract Machine

When one operand is high- security, result is high- security · · · Add Add Output · · · PC 6@L 8@H

14

slide-34
SLIDE 34

IFC Abstract Machine

When one operand is high- security, result is high- security · · · Add Add Output · · · PC 14@H

14

slide-35
SLIDE 35

IFC Abstract Machine

Labels on outputs mark who is able to see them · · · Add Add Output · · · PC 14@H

14

slide-36
SLIDE 36

IFC Abstract Machine

Labels on outputs mark who is able to see them · · · Add Add Output · · · PC 14@H

14

slide-37
SLIDE 37

IFC Abstract Machine

Labels on outputs mark who is able to see them · · · Add Add Output · · · PC 14@H

14

slide-38
SLIDE 38

IFC Abstract Machine

Labels on outputs mark who is able to see them · · · Add Add Output · · · PC 14@H

14

slide-39
SLIDE 39

IFC in Hardware

15

slide-40
SLIDE 40

Abstract Machine NI Concrete Machine NI

Refined by

16

slide-41
SLIDE 41

Concrete Machine

Similar to previous one, but with hardware mechanisms for supporting IFC 1@0 5@0 8@1

17

slide-42
SLIDE 42

Concrete Machine

Plain integer tags instead

  • f high-level IFC labels

Uninterpreted in hardware 1@0 5@0 8@1

17

slide-43
SLIDE 43

Concrete Machine

Hardware cache governs tag propagation Cache 1@0 5@0 8@1

17

slide-44
SLIDE 44

Concrete Machine

Cache line relates combination of instruction and operand tags to result tag Add 0 0 0

  • pcode
  • p1 op2

result

1@0 5@0 8@1

17

slide-45
SLIDE 45

Cache Operation

1@0 5@0 8@1 Cache Add 0 0 ?

18

slide-46
SLIDE 46

Cache Operation

1@0 5@0 8@1 Cache Add 0 0 ? Add 0 0 0

18

slide-47
SLIDE 47

Cache Operation

1@0 5@0 8@1 Cache Add 0 0 ? Add 0 0 0 Result is 0

18

slide-48
SLIDE 48

Cache Operation

6@0 8@1 Cache

18

slide-49
SLIDE 49

Cache Operation

6@0 8@1 Cache

18

slide-50
SLIDE 50

Cache Operation

6@0 8@1 Cache Add 0 1 ?

18

slide-51
SLIDE 51

Cache Operation

6@0 8@1 Cache Add 0 1 ?

??

18

slide-52
SLIDE 52

Cache Operation

6@0 8@1 Cache Add 0 1 ?

miss!

18

slide-53
SLIDE 53

Cache Operation

6@0 8@1 Cache Add 0 1 ?

miss!

Control is transferred to fault handler

18

slide-54
SLIDE 54

Fault-Handler Operation

Fault Handler Handler is a piece of machine code running in privileged mode Add 0 1 ?

19

slide-55
SLIDE 55

Fault-Handler Operation

Fault Handler It can modify the cache, as well as bypass it Add 0 1 ?

19

slide-56
SLIDE 56

Fault-Handler Operation

Fault Handler It analyzes the fault context

.

Add 0 1 ?

19

slide-57
SLIDE 57

Fault-Handler Operation

Fault Handler It analyzes the fault context

..

Add 0 1 ?

19

slide-58
SLIDE 58

Fault-Handler Operation

Fault Handler It analyzes the fault context

...

Add 0 1 ?

19

slide-59
SLIDE 59

Fault-Handler Operation

Fault Handler It analyzes the fault context

!

Add 0 1 ?

19

slide-60
SLIDE 60

Fault-Handler Operation

Fault Handler . . . and computes corresponding result tag Add 0 1 1

19

slide-61
SLIDE 61

Fault-Handler Operation

Fault Handler The handler then installs that line in the cache, returning to faulting instruction Add 0 1 1 Cache

19

slide-62
SLIDE 62

Fault-Handler Operation

Cache look-up will then succeed, allowing code to continue Cache 6@0 8@1

19

slide-63
SLIDE 63

Fault-Handler Operation

Cache look-up will then succeed, allowing code to continue Cache 6@0 8@1 Result is 1

19

slide-64
SLIDE 64

Fault-Handler Operation

Cache look-up will then succeed, allowing code to continue Cache Result is 1 14@1

19

slide-65
SLIDE 65

Proving the Refinement

20

slide-66
SLIDE 66

Abstract Machine NI Concrete Machine NI

Refined by

21

slide-67
SLIDE 67

Refinement Structure

a1 c1 Concrete Abstract

labels correctly rep- resented, cache com- patible with IFC rules, machine in user mode

22

slide-68
SLIDE 68

Refinement Structure

a1 c1 Concrete Abstract . . . tc

machine runs, producing output trace

22

slide-69
SLIDE 69

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . .

want corresponding abstract trace combine two execution lemmas

ta

22

slide-70
SLIDE 70

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . . ta c2

  • c

cache hit step

22

slide-71
SLIDE 71

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . . ta c2

  • c

a2

  • a

hit case simulation lemma

22

slide-72
SLIDE 72

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . . ta c2

  • c

a2

  • a

p1 pk c3 . . .

cache miss step

22

slide-73
SLIDE 73

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . . ta c2

  • c

a2

  • a

p1 pk c3 . . .

handler executes . . .

22

slide-74
SLIDE 74

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . . ta c2

  • c

a2

  • a

p1 pk c3 . . .

. . . and returns to user code

22

slide-75
SLIDE 75

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . . ta c2

  • c

a2

  • a

p1 pk c3 . . .

handler correctness lemma

22

slide-76
SLIDE 76

Refinement Structure

a1 c1 Concrete Abstract . . . tc . . . ta c2

  • c

a2

  • a

p1 pk c3 . . .

proceed inductively

22

slide-77
SLIDE 77

Challenges

Interesting issues involved in these proofs

❼ Verification of machine code is difficult ❼ Need to formalize notion of compatibility between

cache and IFC rules

❼ How to make it work for any IFC lattice?

23

slide-78
SLIDE 78

Idea: Structure proof and implementation with another refinement

24

slide-79
SLIDE 79

Abstract Machine Concrete Machine Fault Handler

Refined by

25

slide-80
SLIDE 80

Abstract Machine Symbolic-Rule Machine Concrete Machine Fault Handler

Refined by Refined by

25

slide-81
SLIDE 81

Abstract Machine Symbolic-Rule Machine IFC Rules

IFC side-conditions symbolically represented by

Concrete Machine Fault Handler

Refined by Refined by

25

slide-82
SLIDE 82

Abstract Machine Symbolic-Rule Machine IFC Rules

IFC side-conditions symbolically represented by

Concrete Machine Fault Handler

Refined by Refined by Easy to show

25

slide-83
SLIDE 83

Abstract Machine Symbolic-Rule Machine IFC Rules

IFC side-conditions symbolically represented by

Concrete Machine Fault Handler

Refined by Refined by Provide formulation of cache compatibility

25

slide-84
SLIDE 84

Abstract Machine Symbolic-Rule Machine IFC Rules

IFC side-conditions symbolically represented by

Concrete Machine

Refined by Refined by

Fault Handler

Correctly compiled to

25

slide-85
SLIDE 85

Abstract Machine Symbolic-Rule Machine IFC Rules

IFC side-conditions symbolically represented by

Concrete Machine

Refined by

Fault Handler

Correctly compiled to Refined by Combine hit and miss simulation lemmas

25

slide-86
SLIDE 86

Symbolic Rule T able

Instruction Result Label Add LAB1⊔LAB2 Output LAB1 . . . . . .

if the current instruction is

26

slide-87
SLIDE 87

Symbolic Rule T able

Instruction Result Label Add LAB1⊔LAB2 Output LAB1 . . . . . .

label the result with

26

slide-88
SLIDE 88

Symbolic Rule T able

Instruction Result Label Add LAB1⊔LAB2 Output LAB1 . . . . . .

for Add, result is as secret as operands

26

slide-89
SLIDE 89

Symbolic Rule T able

Instruction Result Label Add LAB1⊔LAB2 Output LAB1 . . . . . .

for Output, use same label

26

slide-90
SLIDE 90

Handler Implementation and Verification

27

slide-91
SLIDE 91

Structured-Code Generators

Structured programming instead of assembly programming

❼ Define structured-code generators as Coq functions ❼ Generators provide a structured language for the

machine (if, case, and, or, while, . . . )

❼ Prove Hoare-logic rules for each generator

28

slide-92
SLIDE 92

Compiling IFC Rules

Write a rule table compiler in Coq

❼ Use generators as a backend ❼ Parameterized over correct implementation of lattice

primitives

❼ Compose Hoare triples to show compiler correctness

29

slide-93
SLIDE 93

Algorithm

❼ Fetch instruction and operand tags from faulting

context

❼ Compute the result tag from this data using

compiled rule table

❼ Install computed line into the cache

Proven correct by composing compiler lemma with triples for the glue code

30

slide-94
SLIDE 94

Abstract Machine NI Symbolic-Rule Machine IFC Rules

IFC side- conditions symbolically represented by

Concrete Machine Fault Handler NI

Refined by Refined by Correctly compiled to

31

slide-95
SLIDE 95

Abstract Machine NI Symbolic-Rule Machine IFC Rules

IFC side- conditions symbolically represented by

Concrete Machine Fault Handler

Refined by Refined by Correctly compiled to

NI

Preserved

31

slide-96
SLIDE 96

What Else?

32

slide-97
SLIDE 97

More in the Paper

Complete model includes more features

❼ Control flow and user-level procedures ❼ Block-structured memory with dynamic allocation ❼ System calls for implementing new IFC primitives ❼ Richer IFC labels (sets of principals represented as

pointers to memory arrays)

33

slide-98
SLIDE 98

Addressed Challenges

❼ Track implicit flows ❼

❼ ❼

34

slide-99
SLIDE 99

Addressed Challenges

❼ Track implicit flows ❼ Allocation and noninterference

❼ ❼

34

slide-100
SLIDE 100

Addressed Challenges

❼ Track implicit flows ❼ Allocation and noninterference

❼ Pointer values could leak secrets

❼ ❼

34

slide-101
SLIDE 101

Addressed Challenges

❼ Track implicit flows ❼ Allocation and noninterference

❼ Pointer values could leak secrets

❼ Label representation depending on machine state ❼

34

slide-102
SLIDE 102

Addressed Challenges

❼ Track implicit flows ❼ Allocation and noninterference

❼ Pointer values could leak secrets

❼ Label representation depending on machine state ❼ Low-level code for array manipulation and

corresponding proofs

34

slide-103
SLIDE 103

Wrapping Up

35

slide-104
SLIDE 104

Conclusions

❼ Described a hardware mechanism for dynamic

tag-checking and propagation

❼ Proof architecture for connecting it to high-level

property

❼ Refinement provides structure to proof

❼ Everything formalized in Coq

36

slide-105
SLIDE 105

Coq Development

Entire formalization available at www.crash-safe.org Complete machine and corresponding proofs in approximately 15k LOC

37

slide-106
SLIDE 106

Future Work

❼ More interesting IFC features (concurrency,

declassification, dynamic principal generation, . . . )

❼ Make model more realistic

❼ Incorporate more features of SAFE ❼ Study tag cache in the context of conventional

architectures ❼ Mechanism is not IFC-specific, investigate other

applications.

38

slide-107
SLIDE 107

Thank You!

Questions?

39