InkTag: Secure Applications on an Untrusted Operating System Owen - - PowerPoint PPT Presentation

inktag secure applications on an untrusted operating
SMART_READER_LITE
LIVE PREVIEW

InkTag: Secure Applications on an Untrusted Operating System Owen - - PowerPoint PPT Presentation

InkTag: Secure Applications on an Untrusted Operating System Owen Hofmann, Sangman Kim, Alan Dunn, Mike Lee, Emmett Witchel UT Austin You trust your OS... should you? The OS is the software root of trust on most systems The OS is a


slide-1
SLIDE 1

InkTag: Secure Applications on an Untrusted Operating System

Owen Hofmann, Sangman Kim, Alan Dunn, Mike Lee, Emmett Witchel UT Austin

slide-2
SLIDE 2

You trust your OS... should you?

  • The OS is the software root
  • f trust on most systems
  • The OS is a shared

vulnerability

  • OS compromise infects all
  • The OS is a vulnerable

vulnerability

  • Syscall interface a complex

attack surface

  • ioctl()
  • Root often has OS-level

privilege OS

App App App App

2

slide-3
SLIDE 3

You trust your OS... should you?

  • The OS is the software root
  • f trust on most systems
  • The OS is a shared

vulnerability

  • OS compromise infects all
  • The OS is a vulnerable

vulnerability

  • Syscall interface a complex

attack surface

  • ioctl()
  • Root often has OS-level

privilege OS

App App App App

2

App

slide-4
SLIDE 4

You trust your OS... should you?

  • The OS is the software root
  • f trust on most systems
  • The OS is a shared

vulnerability

  • OS compromise infects all
  • The OS is a vulnerable

vulnerability

  • Syscall interface a complex

attack surface

  • ioctl()
  • Root often has OS-level

privilege OS

App App App App

2

App

OS

slide-5
SLIDE 5

You trust your OS... should you?

  • The OS is the software root
  • f trust on most systems
  • The OS is a shared

vulnerability

  • OS compromise infects all
  • The OS is a vulnerable

vulnerability

  • Syscall interface a complex

attack surface

  • ioctl()
  • Root often has OS-level

privilege OS

App App App App

2

App

OS

App App App

slide-6
SLIDE 6

You should trust the hypervisor

  • Hypervisors have become a

common part of the software stack

  • Provide a layer of indirection

under the OS

  • Hypervisors can be more

trustworthy

  • Fewer lines of code
  • Thinner interface
  • Fewer vulnerabilities

3

Hypervisor OS

App App App App

slide-7
SLIDE 7

But the OS is still a problem

  • Users want trustworthy

applications

  • Applications still must trust

the OS

4

Hypervisor OS

App App App App

slide-8
SLIDE 8

But the OS is still a problem

  • Users want trustworthy

applications

  • Applications still must trust

the OS

4

Hypervisor OS

App App App App

OS

slide-9
SLIDE 9

But the OS is still a problem

  • Users want trustworthy

applications

  • Applications still must trust

the OS

4

Hypervisor OS

App App App App App

OS

App App App

slide-10
SLIDE 10

Removing OS trust

  • Why can the kernel

compromise applications?

  • No isolation
  • OS still provides all essential

services

  • File I/O
  • Memory mapping

OS

App App App App

5

Hypervisor

slide-11
SLIDE 11

Isolate and verify

  • Can the hypervisor improve

this situation?

  • Previous systems have

examined this problem

  • Overshadow [ASPLOS ’08]
  • Trusted hypervisor isolates an

application from an untrusted kernel

  • Ensure that the OS follows its

contract with the application OS

App App App App

6

Hypervisor

slide-12
SLIDE 12

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(NULL, ..., F, offset);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

7

OS Hypervisor App

page table

slide-13
SLIDE 13

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(NULL, ..., F, offset);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

7

OS Hypervisor

mmap() 0x7FFCB...

App

page table

slide-14
SLIDE 14

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(file=F, offset=O);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

8

OS Hypervisor

mmap() 0x7FFCB...

App

page table

slide-15
SLIDE 15

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(file=F, offset=O);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

9

OS Hypervisor App

page table

slide-16
SLIDE 16

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(file=F, offset=O);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

9

OS Hypervisor App

page table

page fault

slide-17
SLIDE 17

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(file=F, offset=O);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

9

OS Hypervisor App

page table

page fault set_pte()

slide-18
SLIDE 18

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(file=F, offset=O);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

9

OS Hypervisor App

page table

page fault

slide-19
SLIDE 19

Verifying OS behavior

  • 1. Application asks OS to update

high-level state

  • V = mmap(file=F, offset=O);
  • Application expects pages from file F

at address V

  • 2. OS updates low-level state
  • Immediately
  • On-demand (e.g. paging)
  • 3. Do OS updates match application

requests?

  • Did the OS map a frame containing

data from F at the correct offset?

10

OS Hypervisor App

page table

page fault

slide-20
SLIDE 20

Verifying OS behavior

  • Application and hypervisor

communicate

  • Synchronize on high-level

application state

  • Hypervisor interposes on

low-level updates

  • Validate updates against

expected state

  • Hypervisor requires deep

visibility into OS, application (semantic gap)

11

OS Hypervisor App

page table

slide-21
SLIDE 21

Verifying OS behavior

  • Application and hypervisor

communicate

  • Synchronize on high-level

application state

  • Hypervisor interposes on

low-level updates

  • Validate updates against

expected state

  • Hypervisor requires deep

visibility into OS, application (semantic gap)

11

OS Hypervisor App

page table

set_pte()

slide-22
SLIDE 22
  • InkTag: secure applications on an untrusted OS
  • Paraverification: require active participation

from the untrusted OS for simpler, more efficient hypervisor design

12

slide-23
SLIDE 23

InkTag security guarantees

  • Control flow integrity
  • OS cannot change program counter, registers
  • Address space integrity
  • OS cannot read or modify application data
  • File I/O
  • Applications access the desired files
  • Privacy and integrity for file data
  • Built on address space integrity
  • Process control
  • Applications can fork(), exec()
  • Access control and naming
  • Applications can define access control policies, use string filenames
  • Consistency
  • OS-managed data and hypervisor-managed metadata remain in sync

13

slide-24
SLIDE 24

InkTag security guarantees

  • Control flow integrity
  • OS cannot change program counter, registers
  • Address space integrity
  • OS cannot read or modify application data
  • File I/O
  • Applications access the desired files
  • Privacy and integrity for file data
  • Built on address space integrity
  • Process control
  • Applications can fork(), exec()
  • Access control and naming
  • Applications can define access control policies, use string filenames
  • Consistency
  • OS-managed data and hypervisor-managed metadata remain in sync

14

slide-25
SLIDE 25

InkTag security guarantees

  • Control flow integrity
  • OS cannot change program counter, registers
  • Address space integrity
  • OS cannot read or modify application data
  • File I/O
  • Applications access the desired files
  • Privacy and integrity for file data
  • Built on address space integrity
  • Process control
  • Applications can fork(), exec()
  • Access control and naming
  • Applications can define access control policies, use string filenames
  • Consistency
  • OS-managed data and hypervisor-managed metadata remain in sync

15

slide-26
SLIDE 26

InkTag security guarantees

  • Control flow integrity
  • OS cannot change program counter, registers
  • Address space integrity
  • OS cannot read or modify application data
  • File I/O
  • Applications access the desired files
  • Privacy and integrity for file data
  • Built on address space integrity
  • Process control
  • Applications can fork(), exec()
  • Access control and naming
  • Applications can define access control policies, use string filenames
  • Consistency
  • OS-managed data and hypervisor-managed metadata remain in sync

16

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-27
SLIDE 27
  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?

H

  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity

17

OS Hypervisor App

slide-28
SLIDE 28
  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?

H

  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity

17

OS Hypervisor App

slide-29
SLIDE 29
  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?

H

  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity

17

OS Hypervisor App

slide-30
SLIDE 30
  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?

H

  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity

17

OS Hypervisor App

slide-31
SLIDE 31
  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?

H

  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity

17

OS Hypervisor App

slide-32
SLIDE 32
  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?

H

  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity

17

OS Hypervisor App

slide-33
SLIDE 33

18

OS Hypervisor App

H

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity
slide-34
SLIDE 34

18

OS Hypervisor App

H

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity
slide-35
SLIDE 35

18

OS Hypervisor App

H

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity
slide-36
SLIDE 36

18

OS Hypervisor App

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
  • Common mechanism

used by Overshadow, InkTag, others

  • OS expects to manage

memory

  • Show cleartext to

application

  • Show ciphertext to OS
  • Hash for integrity
slide-37
SLIDE 37
  • Position of data in

address space must match application requests [mmap()]

  • Ensure OS constructs

the correct address space

19

OS Hypervisor App

1 3 2

OS

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-38
SLIDE 38
  • Position of data in

address space must match application requests [mmap()]

  • Ensure OS constructs

the correct address space

19

OS Hypervisor App

1 3 2 1 2 3

OS

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-39
SLIDE 39
  • Position of data in

address space must match application requests [mmap()]

  • Ensure OS constructs

the correct address space

19

OS Hypervisor App

1 3 2 1 2 3

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-40
SLIDE 40
  • Position of data in

address space must match application requests [mmap()]

  • Ensure OS constructs

the correct address space

19

OS Hypervisor App

1 3 2 1 2 3

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-41
SLIDE 41

OS Hypervisor App

page table

  • Ensure OS constructs the correct

address space

  • Application maps file F at addr V
  • Are page faults to V handled

correctly?

  • Decrypted physical frame has

same hash as F

  • Interpose on page table updates
  • Disallow arbitrary OS mapping
  • Determine high-level update implied by

low-level PTE change

  • Match page table updates to

application requests

  • Virtual address V = file F, offset O
  • Result of previous mmap() call

20

slide-42
SLIDE 42

OS Hypervisor

mmap() 0x7FFCB...

App

page table

  • Ensure OS constructs the correct

address space

  • Application maps file F at addr V
  • Are page faults to V handled

correctly?

  • Decrypted physical frame has

same hash as F

  • Interpose on page table updates
  • Disallow arbitrary OS mapping
  • Determine high-level update implied by

low-level PTE change

  • Match page table updates to

application requests

  • Virtual address V = file F, offset O
  • Result of previous mmap() call

20

slide-43
SLIDE 43

OS Hypervisor App

page table

page fault

  • Ensure OS constructs the correct

address space

  • Application maps file F at addr V
  • Are page faults to V handled

correctly?

  • Decrypted physical frame has

same hash as F

  • Interpose on page table updates
  • Disallow arbitrary OS mapping
  • Determine high-level update implied by

low-level PTE change

  • Match page table updates to

application requests

  • Virtual address V = file F, offset O
  • Result of previous mmap() call

20

slide-44
SLIDE 44

OS Hypervisor App

page table

page fault set_pte()

  • Ensure OS constructs the correct

address space

  • Application maps file F at addr V
  • Are page faults to V handled

correctly?

  • Decrypted physical frame has

same hash as F

  • Interpose on page table updates
  • Disallow arbitrary OS mapping
  • Determine high-level update implied by

low-level PTE change

  • Match page table updates to

application requests

  • Virtual address V = file F, offset O
  • Result of previous mmap() call

20

slide-45
SLIDE 45

OS Hypervisor App

page table

page fault

  • Ensure OS constructs the correct

address space

  • Application maps file F at addr V
  • Are page faults to V handled

correctly?

  • Decrypted physical frame has

same hash as F

  • Interpose on page table updates
  • Disallow arbitrary OS mapping
  • Determine high-level update implied by

low-level PTE change

  • Match page table updates to

application requests

  • Virtual address V = file F, offset O
  • Result of previous mmap() call

20

slide-46
SLIDE 46

OS Hypervisor App

page table

page fault

21

  • Ensure OS constructs the correct

address space

  • Application maps file F at addr V
  • Are page faults to V handled

correctly?

  • Decrypted physical frame has

same hash as F

  • Interpose on page table updates
  • Disallow arbitrary OS mapping
  • Determine high-level update implied by

low-level PTE change

  • Match page table updates to

application requests

  • Virtual address V = file F, offset O
  • Result of previous mmap() call
slide-47
SLIDE 47

OS Hypervisor App

page table

page fault

22

  • Ensure OS constructs the correct

address space

  • Application maps file F at addr V
  • Are page faults to V handled

correctly?

  • Decrypted physical frame has

same hash as F

  • Interpose on page table updates
  • Disallow arbitrary OS mapping
  • Determine high-level update implied by

low-level PTE change

  • Match page table updates to

application requests

  • Virtual address V = file F, offset O
  • Result of previous mmap() call
slide-48
SLIDE 48
  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

OS Hypervisor

PT (2)

App

23

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?

PT

slide-49
SLIDE 49
  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

OS Hypervisor

PT (2)

App

23

PT (1)

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-50
SLIDE 50

Hypervisor

PT (2)

App

24

PT (1)

OS

  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-51
SLIDE 51

Hypervisor

PT (2)

App

24

PT (1)

OS

  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-52
SLIDE 52

Hypervisor

PT (2)

App

24

PT (1)

OS

  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-53
SLIDE 53

Hypervisor

PT (2)

App

25

PT (1)

OS

  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-54
SLIDE 54

Hypervisor

PT (2)

App

25

PT (1)

OS

  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-55
SLIDE 55

Hypervisor

PT (2)

App

25

PT (1)

OS

  • Interpreting low-level page

table updates

  • OS can construct valid, but

confusing page tables

  • Order in which updates are seen

matters

  • Matching page table updates to

application requests

  • Application and hypervisor must

communicate complete memory map

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-56
SLIDE 56
  • Application must validate

pointer results returned from kernel

  • Iago attacks [ASPLOS ’13]

Hypervisor App

Stack New region

OS

26

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-57
SLIDE 57
  • Application must validate

pointer results returned from kernel

  • Iago attacks [ASPLOS ’13]

Hypervisor App

mmap() 0x7FFCB...

Stack New region

OS

26

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-58
SLIDE 58
  • The OS updates page tables
  • Can guarantee sanity and
  • rdering
  • The OS maintains memory

maps

  • Can expose that information to

hypervisor and application

Hypervisor App OS

27

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-59
SLIDE 59
  • Paraverification: an untrusted

OS helping to verify its own behavior

  • Take inspiration from

paravirtualization

  • Extensive use of existing

paravirtual interface

  • OS must participate, but

information cannot be trusted Hypervisor App OS

28

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
slide-60
SLIDE 60

Paraverification: validating PTE updates

  • Untrusted OS notifies hypervisor
  • n page table updates
  • Regular structure
  • In update order

App Hypervisor OS

29

slide-61
SLIDE 61

Paraverification: validating PTE updates

  • Untrusted OS notifies hypervisor
  • n page table updates
  • Regular structure
  • In update order

App Hypervisor OS

pte_update( addr=0x7FCB...

29

slide-62
SLIDE 62

Paraverification: validating PTE updates

  • Application maintains memory mappings

in an array of descriptors

  • Interpose on mmap() in libc
  • Generate a token for each mapping
  • Unforgeable identifier describing requested

mapping

  • e.g. HMAC(addr, file, offset)
  • In implementation, integer index

App Hypervisor OS

.file=... .addr=... .offset=...

30

slide-63
SLIDE 63

Paraverification: validating PTE updates

  • Application maintains memory mappings

in an array of descriptors

  • Interpose on mmap() in libc
  • Generate a token for each mapping
  • Unforgeable identifier describing requested

mapping

  • e.g. HMAC(addr, file, offset)
  • In implementation, integer index

App Hypervisor OS

.file=... .addr=... .offset=...

mmap(file=..., token=5 0x7FCB...

30

slide-64
SLIDE 64

Paraverification: validating PTE updates

  • Application maintains memory mappings

in an array of descriptors

  • Interpose on mmap() in libc
  • Generate a token for each mapping
  • Unforgeable identifier describing requested

mapping

  • e.g. HMAC(addr, file, offset)
  • In implementation, integer index

App Hypervisor OS

.file=... .addr=... .offset=...

30

slide-65
SLIDE 65

Paraverification: validating PTE updates

  • Application maintains memory mappings

in an array of descriptors

  • Interpose on mmap() in libc
  • Generate a token for each mapping
  • Unforgeable identifier describing requested

mapping

  • e.g. HMAC(addr, file, offset)
  • In implementation, integer index

App Hypervisor OS

.file=... .addr=... .offset=...

pte_update( addr=0x7FCB... token=5

30

slide-66
SLIDE 66

Paraverification: validating PTE updates

  • Application maintains memory mappings

in an array of descriptors

  • Interpose on mmap() in libc
  • Generate a token for each mapping
  • Unforgeable identifier describing requested

mapping

  • e.g. HMAC(addr, file, offset)
  • In implementation, integer index

App Hypervisor OS

.file=... .addr=... .offset=...

pte_update( addr=0x7FCB... token=5

30

slide-67
SLIDE 67

Paraverification: validating PTE updates

  • Application memory listing protected

from OS

  • Entries always allocated in defined

virtual address range

  • Invalid entries marked

App Hypervisor OS

.file=... .addr=... .offset=...

31

slide-68
SLIDE 68

Paraverification: validating PTE updates

  • Application memory listing protected

from OS

  • Entries always allocated in defined

virtual address range

  • Invalid entries marked

App Hypervisor OS

.file=... .addr=... .offset=...

pte_update( addr=0x7FCB... token=eleventy

31

slide-69
SLIDE 69

Paraverification: validating PTE updates

  • Application memory listing protected

from OS

  • Entries always allocated in defined

virtual address range

  • Invalid entries marked

App Hypervisor OS

.file=... .addr=... .offset=...

pte_update( addr=0x7FCB... token=eleventy

31

slide-70
SLIDE 70

Paraverification: validating PTE updates

  • Application memory listing protected

from OS

  • Entries always allocated in defined

virtual address range

  • Invalid entries marked

App Hypervisor OS

.file=... .addr=... .offset=...

pte_update( addr=0x7FCB... token=eleventy

31

slide-71
SLIDE 71

Paraverification: validating syscall results

  • OS returns tokens to application to assist

validation

  • Application maintains linked list of

mappings

  • OS specifies previous entry
  • Application checks for overlap, updates

list

App Hypervisor OS

.file=... .addr=... .offset=...

32

slide-72
SLIDE 72

Paraverification: validating syscall results

  • OS returns tokens to application to assist

validation

  • Application maintains linked list of

mappings

  • OS specifies previous entry
  • Application checks for overlap, updates

list

App Hypervisor OS

.file=... .addr=... .offset=...

mmap(file=..., token=5 0x7FCB...

32

slide-73
SLIDE 73

Paraverification: validating syscall results

  • OS returns tokens to application to assist

validation

  • Application maintains linked list of

mappings

  • OS specifies previous entry
  • Application checks for overlap, updates

list

App Hypervisor OS

.file=... .addr=... .offset=...

mmap(file=..., token=5 0x7FCB... , prev=2

32

slide-74
SLIDE 74

Paraverification: validating syscall results

  • OS returns tokens to application to assist

validation

  • Application maintains linked list of

mappings

  • OS specifies previous entry
  • Application checks for overlap,

updates list

App Hypervisor OS

.file=... .addr=... .offset=...

mmap(file=..., token=5 0x7FCB... , prev=2

33

  • Basic memory isolation mechanisms
  • Challenges: why is this difficult?
  • Paraverification: how can the untrusted OS help?
  • Guarantee sane address space updates
  • Expose internal OS information to hypervisor

and application

slide-75
SLIDE 75

Implementation & Evaluation

  • Prototype built with KVM, qemu, uClibc
  • ~3500 hypervisor LOC
  • Modify libc to validate syscall results
  • OS microbenchmarks
  • LMBench
  • Applications
  • SPEC
  • Apache
  • DokuWiki

34

slide-76
SLIDE 76

DokuWiki

  • PHP CGI binary with InkTag extensions
  • InkTag authentication module
  • Use InkTag access control on wiki pages
  • Result: hypervisor-enforced security for a

PHP application

  • Integrity for all script files
  • Privacy and integrity for application data

35

slide-77
SLIDE 77

InkTag overheads

  • LMBench
  • Low-level OS microbenchmarks
  • 5x - 55x slowdown (for µs operations)
  • High context switch latency
  • SPEC
  • CPU-bound applications
  • Most applications <= 1.03x
  • gcc - 1.14x; perlbench, h264href - 1.10x
  • Apache
  • Long-lived processes, infrequent MM activity
  • 1.02x throughput slowdown, 1.13x latency
  • DokuWiki
  • Many short-lived processes, frequent memory mapping
  • 1.54x throughput slowdown

36

slide-78
SLIDE 78

Related work

  • Untrusted operating systems
  • XOMOS [Lie et al. SOSP ’03]
  • Overshadow [Chen et al. ASPLOS ’08]
  • SP3 [Yang & Shin

VEE ’08]

  • Cloudvisor [Zhang et al. SOSP ’11]

37

slide-79
SLIDE 79

Conclusion

  • We can enforce trustworthy services from an

untrustworthy OS

  • Paraverification simplifies crucial isolation

mechanisms

38