Explicit Information Flow in the HiStar OS Nickolai Zeldovich, - - PowerPoint PPT Presentation

explicit information flow in the histar os
SMART_READER_LITE
LIVE PREVIEW

Explicit Information Flow in the HiStar OS Nickolai Zeldovich, - - PowerPoint PPT Presentation

Explicit Information Flow in the HiStar OS Nickolai Zeldovich, Silas Boyd-Wickizer, Eddie Kohler, David Mazires Too much trusted software Untrustworthy code a huge problem Users willingly run malicious software Malware, spyware,


slide-1
SLIDE 1

Explicit Information Flow in the HiStar OS

Nickolai Zeldovich, Silas Boyd-Wickizer, Eddie Kohler, David Mazières

slide-2
SLIDE 2

Too much trusted software

  • Untrustworthy code a huge problem
  • Users willingly run malicious software

– Malware, spyware, ...

  • Even legitimate software is often vulnerable

– Symantec remote vulnerability

  • No sign that this problem is going away
  • Can an OS make untrustworthy code secure?
slide-3
SLIDE 3

Example: Virus Scanner

Private User Files Virus Scanner /tmp Update Process Virus Database

Network

  • Goal: private files cannot go onto the network

Symantec™

slide-4
SLIDE 4

Information Flow Control

Private User Files Virus Scanner /tmp Update Process Virus Database

Network

  • Goal: private files cannot go onto the network
slide-5
SLIDE 5

Buggy scanner leaks private data

Private User Files Virus Scanner /tmp Update Process Virus Database

Network

  • Must restrict sockets to protect private data
slide-6
SLIDE 6

Buggy scanner leaks private data

Update Process Virus Database

Network

Private User Files Virus Scanner /tmp

  • Must restrict scanner's ability to use IPC
slide-7
SLIDE 7

Buggy scanner leaks private data

Update Process Virus Database

Network

Private User Files Virus Scanner /tmp

  • Must run scanner in chroot jail
slide-8
SLIDE 8

Buggy scanner leaks private data

Update Process Virus Database

Network

User Shell

ptrace

Private User Files Virus Scanner /tmp

  • Must run scanner with different UID
slide-9
SLIDE 9

Buggy scanner leaks private data

setproctitle: 0x6e371bc2 Update Process Virus Database

Network ps

Private User Files /tmp

  • Must restrict access to /proc, ...
slide-10
SLIDE 10

Buggy scanner leaks private data

Update Process Virus Database

Network disk usage

Private User Files Private User Files Virus Scanner /tmp

  • Must restrict FS'es that virus scanner can write
slide-11
SLIDE 11

Buggy scanner leaks private data

Update Process Virus Database

Network fcntl locking

Private User Files Virus Scanner /tmp

  • List goes on – is there any hope?
slide-12
SLIDE 12

What's going on?

P1 Unix Kernel

Unix

P2 P3 Hardware

  • Kernel not designed to

enforce these policies

  • Retrofitting difficult

– Need to track potentially

any memory observed or modified by a system call!

– Hard to even enumerate

slide-13
SLIDE 13

What's going on?

P1 Unix Kernel

Unix

P2 P3 Hardware

  • Kernel not designed to

enforce these policies

  • Retrofitting difficult

– Need to track potentially

any memory observed or modified by a system call!

– Hard to even enumerate

slide-14
SLIDE 14

HiStar Solution

HiStar Kernel

Unix HiStar

Unix Library P1 P2 P3 U1 U2 U3 Hardware P1 Unix Kernel P2 P3 Hardware

  • Make all state explicit, track all communication
slide-15
SLIDE 15

HiStar: Contributions

  • Narrow kernel interface, few comm. channels

– Minimal mechanism: enough for a Unix library – Strong control over information flow

  • Unix support implemented as user-level library

– Unix communication channels are made explicit,

in terms of HiStar's mechanisms

– Provides control over the gamut of Unix channels

slide-16
SLIDE 16

HiStar kernel objects

Segment

(Data)

Address Space Thread Gate

(IPC)

Container

(Directory)

Device

(Network)

slide-17
SLIDE 17

HiStar kernel objects

Segment

(Data)

Address Space Thread Gate

(IPC)

Container

(Directory)

Device

(Network)

Label Label Label Label Label Label

Think of labels as a “tainted” bit

slide-18
SLIDE 18

HiStar: Unix process

Code Segment Address Space Thread Process Container Data Segment

slide-19
SLIDE 19

Unix File Descriptors

Process A Process B

File Descriptor (O_RDONLY) Kernel State

slide-20
SLIDE 20

Unix File Descriptors

Process A Process B

File Descriptor (O_RDONLY)

X

Kernel State

  • Tainted process only talks to other tainted procs
slide-21
SLIDE 21

Unix File Descriptors

Process A Process B

File Descriptor (O_RDONLY) Seek pointer: 0xa32f

X

Kernel State

  • Lots of shared state in kernel, easy to miss
slide-22
SLIDE 22

HiStar File Descriptors

Address Space A Thread A

File Descriptor Segment (O_RDONLY) Seek pointer: 0xa32f

Address Space B Thread B

slide-23
SLIDE 23

HiStar File Descriptors

Address Space A Thread A

File Descriptor Segment (O_RDONLY) Seek pointer: 0xa32f

Address Space B Thread B X

  • All shared state is now explicitly labeled
  • Just need segment read/write checks
slide-24
SLIDE 24

Taint Tracking Strawman

Tainted Thread A File Thread B write(File)

slide-25
SLIDE 25

Taint Tracking Strawman

Tainted Thread A Thread B write(File) File

  • Propagate taint when writing to file
slide-26
SLIDE 26

Taint Tracking Strawman

Thread B read(File)

  • Propagate taint when writing to file
  • What happens when reading?

Tainted Thread A File

slide-27
SLIDE 27

Taint Tracking Strawman

Thread B read(File)

ACCESS X DENIED

Tainted Thread A File

slide-28
SLIDE 28

Strawman has Covert Channel

Tainted Thread A File 0 File 1 Thread B Network Secret = 1

X

slide-29
SLIDE 29

Strawman has Covert Channel

Tainted Thread A Thread B File 0 File 1 Network write(File 1) Secret = 1

slide-30
SLIDE 30

Strawman has Covert Channel

Tainted Thread A Thread B File 0 File 1 Network read(File 0) read(File 1) Secret = 1

slide-31
SLIDE 31

Strawman has Covert Channel

Tainted Thread A Thread B File 0 File 1 Network send email: “secret=1” Secret = 1

slide-32
SLIDE 32

Strawman has Covert Channel

Tainted Thread A Thread B File 0 File 1 Network Secret = 1 read(File 0) read(File 1)

X

  • What if we taint B

when it reads File 1?

slide-33
SLIDE 33

Strawman has Covert Channel

Tainted Thread A Thread 0 File 0 File 1 Thread 1 Network Secret = 1 read(File 0) read(File 1)

  • What if we taint B

when it reads File 1?

slide-34
SLIDE 34

Strawman has Covert Channel

Tainted Thread A Thread 0 File 0 File 1 Thread 1 Network Secret = 1 send email: “secret=1” send email: “secret=0”

X

  • What if we taint B

when it reads File 1?

slide-35
SLIDE 35

HiStar: Immutable File Labels

Tainted Thread A Thread B read(...) Untainted File Tainted File

X X

write(...)

  • Label (taint level) is state that must be tracked
  • Immutable labels solve this problem!
slide-36
SLIDE 36

Who creates tainted files?

Tainted Thread A Untainted File Thread B Directory Create Tainted File Tainted File

X

  • Tainted thread can't modify untainted directory

to place the new file there...

slide-37
SLIDE 37

Thread B Tainted File Directory Tainted Thread A Create Tainted File Thread C

HiStar: Untainted thread pre-creates tainted file

  • Existence and label of tainted file

provide no information about A

Untainted File

slide-38
SLIDE 38

Reading a tainted file

Tainted Thread A Untainted File Thread B Tainted File Directory

  • Existence and label of tainted file

provide no information about A

X X

Thread C

slide-39
SLIDE 39

Reading a tainted file

Tainted Thread A Untainted File Thread B Tainted File Directory readdir():

  • T. File's label
  • Existence and label of tainted file

provide no information about A

X X

Thread C

slide-40
SLIDE 40

Reading a tainted file

Tainted Thread A Untainted File Thread B Tainted File Directory Taint self

  • Existence and label of tainted file

provide no information about A

  • Neither does B's decision to taint

X

Thread C

slide-41
SLIDE 41

HiStar avoids file covert channels

  • Immutable labels prevent covert channels that

communicate through label state

  • Untainted threads pre-allocate tainted files

– File existence or label provides no secret information

  • Threads taint themselves to read tainted files

– Tainted file's label accessible via parent directory

slide-42
SLIDE 42

Problems with IPC

IPC Port

DB Server Client Thread

Time

  • IPC with tainted client

– Taint server thread

during request

SELECT ...

Server Threads Create

slide-43
SLIDE 43

Problems with IPC

IPC Port IPC Return

DB Server Client Thread

Time

  • IPC with tainted client

– Taint server thread

during request

SELECT ...

Server Threads Create

slide-44
SLIDE 44

Problems with IPC

IPC Port IPC Return

DB Server Client Thread

Time

  • IPC with tainted client

– Taint server thread

during request

Results

Server Threads Create

slide-45
SLIDE 45

Problems with IPC

IPC Port IPC Return

DB Server Client Thread

Time

  • IPC with tainted client

– Taint server thread

during request

– Secrecy preserved?

Results

Server Threads Create

slide-46
SLIDE 46

Problems with IPC

IPC Port IPC Return

DB Server Client Thread

Time

  • IPC with tainted client

– Taint server thread

during request

– Secrecy preserved?

  • Lots of client calls

– Limit server threads?

Leaks information...

– Otherwise, no control

  • ver resources!

Create

Results

Server Threads

slide-47
SLIDE 47

Gates make resources explicit

  • Client donates initial

resources (thread)

Time Gate

DB Server Client Thread

SELECT ...

Server Threads Create

slide-48
SLIDE 48

Gates make resources explicit

  • Client donates initial

resources (thread)

  • Client thread runs in

server address space, executing server code

Time Gate

DB Server Client Thread

SELECT ...

Server Threads Create Server Code

Return Gate

slide-49
SLIDE 49

Gates make resources explicit

  • Client donates initial

resources (thread)

  • Client thread runs in

server address space, executing server code

Time Gate

DB Server Client Thread

Results

Server Threads Create Server Code

Return Gate

slide-50
SLIDE 50

Gates make resources explicit

  • Client donates initial

resources (thread)

  • Client thread runs in

server address space, executing server code

  • No implicit resource

allocation – no leaks

Time Gate

DB Server Client Thread

Server Threads Create Server Code

Return Gate

Results

slide-51
SLIDE 51

How do we get anything out?

Network

Virus Scanner

X

Alice's Files

slide-52
SLIDE 52

“Owner” privilege

Alice's shell

Network

Virus Scanner

X

Alice's Files

  • Yellow objects can only interact with other

yellow objects, or objects with yellow star

  • Small, trusted shell can isolate a large,

frequently-changing virus scanner

slide-53
SLIDE 53

Multiple categories of taint

Alice's shell

Network

Virus Scanner

X

Alice's Files Bob's shell Bob's Files Virus Scanner

X

  • Owner privilege and information flow control

are the only access control mechanism

  • Anyone can allocate a new category, gets star
slide-54
SLIDE 54

What about “root”?

  • Huge security hole for information flow control

– Observe/modify anything – violate any security policy

  • Make it explicit

– Can be controlled as necessary

slide-55
SLIDE 55

HiStar root privileges are explicit

Alice's shell Bob's shell root's shell Alice's Files Bob's Files

  • Kernel gives no special treatment to root
slide-56
SLIDE 56

HiStar root privileges are explicit

Bob's Secret Files Alice's shell Bob's shell root's shell Alice's Files Bob's Files

X

  • Users can keep secret data inaccessible to root
slide-57
SLIDE 57

What about inaccessible files?

Bob's Secret Files Alice's shell Bob's shell root's shell Alice's Files Bob's Files

X X

  • Noone has privilege to access Bob's Secret Files
slide-58
SLIDE 58

HiStar resource allocation

Bob's Container Bob's Files Bob's shell

slide-59
SLIDE 59

HiStar resource allocation

Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell

  • Create a new sub-container for secret files
slide-60
SLIDE 60

HiStar resource allocation

Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell

X

  • Create a new sub-container for secret files
slide-61
SLIDE 61

HiStar resource allocation

Unlink

  • Create a new sub-container for secret files
  • Bob can delete sub-container even if he cannot
  • therwise access it!

Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell

X

slide-62
SLIDE 62

HiStar resource allocation

  • Create a new sub-container for secret files
  • Bob can delete sub-container even if he cannot
  • therwise access it!

Bob's Secret Container Bob's Container Bob's Files Bob's Secret Files Bob's shell

X

slide-63
SLIDE 63

HiStar resource allocation

  • Create a new sub-container for secret files
  • Bob can delete sub-container even if he cannot
  • therwise access it!

Bob's Container Bob's Files Bob's shell

slide-64
SLIDE 64

HiStar resource allocation

Bob's Container Bob's Files Bob's shell Root Container root's shell

  • Root has control over

all resources, via the root container

slide-65
SLIDE 65

Persistent Storage

  • Unix: file system implemented in the kernel

– Many potential pitfalls leading to covert channels:

mtime, atime, link counts, ...

– Would be great to implement it in user-space as well

  • HiStar: Single-level store (ala Multics / EROS)

– All kernel objects stored on disk – memory is a cache – No difference between disk & memory objects

slide-66
SLIDE 66

File System

Segment /tmp/one Container /tmp/two Filename Segment

  • ne

two Container /tmp

. . .

  • Implemented at user-level, using same objects
  • Security checks separate from FS implementation
slide-67
SLIDE 67

HiStar kernel design

  • Kernel operations make information flow explicit

– Explicit operation for thread to taint itself

  • Kernel never implicitly changes labels

– Explicit resource allocation: gates, pre-created files

  • Kernel never implicitly allocates resources
  • Kernel has no concept of superuser

– Users can explicitly grant their privileges to root – Root owns the top-level container

slide-68
SLIDE 68

Applications

  • Many Unix applications

– gcc, gdb, openssh, ...

  • High-security applications alongside with Unix

– Untrusted virus scanners (already described) – VPN/Internet data separation (see paper) – login with user-supplied authentication code (next)

slide-69
SLIDE 69

Login on Unix

  • Login must run as root

– Only root can setuid() to grant user privileges

  • Why is this bad?

– Login is complicated (Kerberos, PAM, ...) – Bugs lead to complete system compromise

slide-70
SLIDE 70

Login on HiStar

Login Process Alice's

  • Auth. Service

Bob's

  • Auth. Service

User: Bob Pass: 1bob

PW: H(alic3) PW: H(1bob)

  • Each user can provide their own auth. service
slide-71
SLIDE 71

Login on HiStar

Login Process

Pass: 1bob

Alice's

  • Auth. Service

Bob's

  • Auth. Service

PW: H(alic3) PW: H(1bob)

  • Each user can provide their own auth. service
slide-72
SLIDE 72

Login on HiStar

Login Process

OK Pass: 1bob

Alice's

  • Auth. Service

Bob's

  • Auth. Service

PW: H(alic3) PW: H(1bob)

slide-73
SLIDE 73

Password disclosure

Login Process

Pass: 1bob

Alice's

  • Auth. Service

Bob's

  • Auth. Service

PW: H(alic3) PW: H(1bob)

  • What if Bob mistypes his username as “alice”?
slide-74
SLIDE 74

Password disclosure

Login Process

Pass: 1bob

Alice's

  • Auth. Service

Bob's

  • Auth. Service

PW: H(alic3) PW: H(1bob)

  • What if Bob mistypes his username as “alice”?

Network

slide-75
SLIDE 75

Avoiding password disclosure

  • It's all about information flow

– HiStar enforces: – “Password cannot go out onto the network”

  • Details in the paper
slide-76
SLIDE 76

Reducing trusted code

  • HiStar allows developers to reduce trusted code

– No code with every user's privilege during login – No trusted code needed to initiate authentication – 110-line trusted wrapper for complex virus scanner

  • Small kernel: 16,000 lines of code
slide-77
SLIDE 77

HiStar Conclusion

  • HiStar reduces amount of trusted code

– Enforce security properties on untrusted code

using strict information flow control

  • Kernel interface eliminates covert channels

– Make everything explicit: labels, resources

  • Unix library makes Unix information flow explicit

– Superuser by convention, not by design

slide-78
SLIDE 78

What about Asbestos?

  • Different goal: Unix vs. specialized web server

– HiStar closes covert channels inherent in the

Asbestos design (mutable labels, IPC, ...)

– Lower-level kernel interface

  • Process vs Container+Thread+AS+Segments+Gates
  • 2 times less kernel code than Asbestos
  • Generality shown by the user-space Unix library

– System-wide support for persistent storage

  • Asbestos uses trusted user-space file server

– Resources are manageable

  • In Asbestos, reboot to kill runaway process
slide-79
SLIDE 79

How is this different from EROS?

  • To isolate in EROS, must strictly partition the

capabilities between isolated applications

  • Labels enforce policy without affecting structure

– Can impose policies on existing code (see paper)

slide-80
SLIDE 80

gcc wget Clam AV pipe disk read disk write create 10k files fork exec 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5

Linux HiStar OpenBSD

Benchmarks, relative to Linux

Comparable performance to Linux and OpenBSD

Application-level benchmarks and disk benchmarks

slide-81
SLIDE 81

gcc wget Clam AV pipe disk read disk write create 10k files fork exec 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5

Linux HiStar OpenBSD

Benchmarks, relative to Linux

217x faster!

Synchronous creation of 10,000 files HiStar allows use of group sync. Application either runs to completion, or appears to never start (single-level store)

slide-82
SLIDE 82

gcc wget Clam AV pipe disk read disk write create 10k files fork exec 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5

Linux HiStar OpenBSD

Benchmarks, relative to Linux

7.5x slower

Linux: 9 syscalls per iteration HiStar: 317 syscalls per iteration