Sego: Pervasive Trusted Metadata for Efficiently Verified Untrusted System Services
Youngjin Kwon, Alan Dunn, Michael Lee, Owen Hofmann, Yuanzhong Xu, Emmett Witchel
1
Sego: Pervasive Trusted Metadata for Efficiently Verified Untrusted - - PowerPoint PPT Presentation
Sego: Pervasive Trusted Metadata for Efficiently Verified Untrusted System Services Youngjin Kwon , Alan Dunn, Michael Lee, Owen Hofmann, Yuanzhong Xu, Emmett Witchel 1 Securing OS is difficult OS vulnerabilities in 2014 from national
Youngjin Kwon, Alan Dunn, Michael Lee, Owen Hofmann, Yuanzhong Xu, Emmett Witchel
1
2
40 80 120 160
# of vulnerabilites # of high ranked vulnerabilites
Mac OS iOS Linux Kernel Window 8.1 Windows Server 2012 OS vulnerabilities in 2014
driver
from national vulnerability database (NVD)
3
4% 13% 83%
Application OS Hardware
Vulnerability distribution in 2014 from NVD
4
Application Operating system
Read / modify code or data
Overshadow (ASPLOS 2008) TrustVisor (IEEE S&P 2010) InkTag (ASPLOS 2013) Sego (ASPLOS 2016)
VirtualGhost (ASPLOS 2014)
Haven (OSDI 2014)
5
6
7
Secure APP APP
Sego library
Guest operating system Hypervisor Hardware
Trusted Untrusted
hypercall
System overview
Sego library
8
RAM
APP OS Hypervisor
Software Ciphertext Plaintext
storage
8
A
RAM
APP OS Hypervisor
B C
Software Ciphertext Plaintext
memory page
storage
8
A
RAM
APP OS Hypervisor
B C
Software Ciphertext Plaintext
memory page
storage
8
A
RAM
APP OS Hypervisor
C
Software Ciphertext Plaintext
memory page
a) Encrypts page
0110 1010
storage
8
A
RAM
APP OS Hypervisor
C
Software Ciphertext Plaintext
memory page
a) Encrypts page
0110 1010
storage
8
A
RAM
APP OS Hypervisor
C
Software Ciphertext Plaintext
memory page
a) Encrypts page
0110 1010
storage
9
RAM
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata Software
storage
APP OS Hypervisor
9
A
RAM
B C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata Software
storage
APP OS Hypervisor
9
A
RAM
B C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
Software
storage
APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page Software
storage
0110
1010
APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page Software
storage
0110
1010
H APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page
Software
storage
0110
1010
H APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page
Software
storage
0110
1010
H APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page
a) OS swaps in b) HYP checks hash c) HYP decrypts page Software
storage
0110
1010
H APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page
a) OS swaps in b) HYP checks hash c) HYP decrypts page Software
storage
0110
1010
H APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page
a) OS swaps in b) HYP checks hash c) HYP decrypts page Software
storage
0110
1010
H H APP OS Hypervisor
9
A
RAM
C
Ciphertext Plaintext
H Hash
Hypervisor memory Metadata mA mB mC
a) HYP maintains metadata
a) Encrypts page b) Hashes page
a) OS swaps in b) HYP checks hash c) HYP decrypts page Software
storage
0110
1010
H H APP OS Hypervisor
B
10
11
12
13
APP OS Sego hypervisor
protected data Hypervisor memory Software
13
a) HYP maintains metadata
A
APP OS Sego hypervisor
B C
protected data Hypervisor memory mA mB mC Software
13
a) HYP maintains metadata
A
APP OS Sego hypervisor
B C
protected data Hypervisor memory mA mB mC Software
13
a) HYP maintains metadata
A
APP OS Sego hypervisor
B C
protected data Hypervisor memory mA mB mC
protected memory pages
Software
13
a) HYP maintains metadata
to move memory pages
A
APP OS Sego hypervisor
B C
protected data Hypervisor memory mA mB mC
hypercall
protected memory pages
Software
13
a) HYP maintains metadata
to move memory pages
memory page
A
APP OS Sego hypervisor
B C
protected data Hypervisor memory mA mB mC
hypercall
protected memory pages
Software
14
Hypervisor memory
APP OS Sego hypervisor Virtualized block device
memory
Hypervisor storage OS storage protected data Software
A B C
mA mB mC
C
mC
14
Hypervisor memory
APP OS Sego hypervisor Virtualized block device
memory
IO buffer Hypervisor storage OS storage protected data Software Read
A B C
mA mB mC
C
mC
14
Hypervisor memory
APP OS Sego hypervisor Virtualized block device
memory
IO buffer Hypervisor storage OS storage protected data Software Read
A B C
mA mB mC
C
mC
15
metadata
16
Hypervisor memory
APP OS Sego hypervisor Virtualized block device
Hypervisor storage OS storage protected data Software
Hypervisor protecting data
virtualized block device protecting data
A B C
mA mB mC
C
mC
17
0.5 1 1.5 2
Hard disk SSD
1.26 1.17 1.53 1.93 1 1
Linux-VM InkTag Sego
and hashing
removing encryption and hashing
S l
d
n b e t t e r
18
0.5 1 1.5 2 2.5
429.mcf 470.lbm graph analysis Micro benchmark (Sequential read)
1.06 1.01 1.05 1.05 1.25 1.39 1.61 2.1 1 1 1 1
Linux-VM InkTag Sego Transparent page sharing scan 100 pages at every 20 milliseconds Memory compaction
S l
d
n b e t t e r
19
APP OS Sego hypervisor Virtualized block device
Challenges
20
Hypervisor storage OS storage
C
mC
21
logical view
Configuration file APP OS Sego hypervisor Virtualized block device
21
logical view
Configuration file Security setting
Correct file length
close the file
APP OS Sego hypervisor Virtualized block device
21
logical view
Configuration file Security setting
Correct file length
close the file
APP OS Sego hypervisor Virtualized block device
21
logical view
Configuration file Security setting
Correct file length
close the file
OS tells the length of previous state
APP OS Sego hypervisor Virtualized block device
21
logical view
Configuration file Security setting
Correct file length
close the file
OS tells the length of previous state
If the APP believes the OS length, OS can do the file length attack (undo the security setting)
APP OS Sego hypervisor Virtualized block device
21
logical view
Configuration file Security setting
Correct file length
close the file
OS tells the length of previous state
If the APP believes the OS length, OS can do the file length attack (undo the security setting)
Ask the file length
APP OS Sego hypervisor Virtualized block device
22
APP OS Sego hypervisor Virtualized block device
with hypervisor
M1 Metadata …. Offset Sector number ….
Hypervisor storage OS storage
Secure file M2 …
Secure file APP OS Sego hypervisor Virtualized block device
23
Secure file APP OS Sego hypervisor Virtualized block device
23
Offset 1000
Secure file APP OS Sego hypervisor Virtualized block device
23
Offset 1000
Secure file
Write ordering by OS file system
APP OS Sego hypervisor Virtualized block device
23
Offset 1000
Secure file
Write ordering by OS file system Offset 1000 (Data) I-node (Journal) I-node (Data)
APP OS Sego hypervisor Virtualized block device
23
Offset 1000
Secure file
Write ordering by OS file system Offset 1000 (Data) I-node (Journal) I-node (Data)
APP OS Sego hypervisor Virtualized block device
Journaling filesystem discards the write during recovery
23
Offset 1000
Secure file
Write ordering by OS file system Offset 1000 (Data) I-node (Journal) I-node (Data)
APP OS Sego hypervisor Virtualized block device
Journaling filesystem discards the write during recovery
23
Offset 1000 Offset 1000 Offset 1000 Discarded block
Data is persisted OS I-node has stale length
24
Secure file Offset 1000 Offset 1000 APP OS Sego hypervisor Virtualized block device
24
Secure file Offset 1000 Offset 1000 APP OS Sego hypervisor Virtualized block device
Hypervisor’s length OS’s length
24
Secure file Offset 1000 Offset 1000 APP OS Sego hypervisor Virtualized block device
Hypervisor’s length OS’s length
Ask the file length
24
Secure file Offset 1000 Offset 1000 APP OS Sego hypervisor Virtualized block device
Hypervisor’s length OS’s length
Ask the file length
Read offset 1000
24
Secure file Offset 1000 Offset 1000 APP OS Sego hypervisor Virtualized block device
Hypervisor’s length OS’s length
OS is not able to locate offset 1000
Ask the file length
Read offset 1000
APP cannot progress
25
Secure file Offset 1000 Offset 1000
hypervisor’s length OS’s length
length attack
recovery case
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number …. Offset 1000
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
APP Opens the file LIB Get OS length
Offset 1000
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor
Offset 1000
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor
Offset 1000 Length mismatch
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor HYP Requests recovery of offset 1000
Offset 1000 Length mismatch
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor HYP Requests recovery of offset 1000 Virtualized block device Read the data by looking up metadata
Offset 1000 Length mismatch
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
Copies the offset 1000 to the library APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor HYP Requests recovery of offset 1000 Virtualized block device Read the data by looking up metadata
Offset 1000 Length mismatch
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
Copies the offset 1000 to the library APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor HYP Requests recovery of offset 1000 Virtualized block device Read the data by looking up metadata
Offset 1000 Length mismatch
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
Copies the offset 1000 to the library APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor HYP Requests recovery of offset 1000 Virtualized block device Read the data by looking up metadata
Offset 1000 Length mismatch
26
APP OS Sego hypervisor Virtualized block device Sego library Secure file Offset 1000
Hypervisor’s length OS’s length
Recovery procedure
Metadata … Offset Sector number ….
Copies the offset 1000 to the library APP Opens the file LIB Get OS length LIB Give OS length to Sego hypervisor HYP Requests recovery of offset 1000 Virtualized block device Read the data by looking up metadata
Offset 1000 Length mismatch
27
Recovery target Inconsistency Detection File creation File is created in hypervisor but not in OS When the APP
File length File length of hypervisor and OS is different When OS reboots from crash Data recovery Hypervisor loses blocks because OS discards them When the APP
Block commit (hypervisor crash) Block write might not be committed in virtual block device Hypervisor runs FSCK Crash while recovery One of the above Hypervisor runs FSCK
study
28
file and verify them
add files (30MB).
injected
29
recovery 4 writing processes Git No crash 51 (51%) 114 (76%) File creation 40 (40%) 29 (19%) File length 2 (2%) 7 (5%) Data Recovery 1 (1%)
Sego correctly recovers every case Without Sego’s recovery Application keeps crashing
30
Benchmark Slowdown to Linux-VM OpenLDAP
Insert (15.9%), Query (3.6%), Delete (15.0%)
Apache Throughput (7.5%), Latency (8.2%) Grep Small file (10.1%), Large file (8.3%) DokuWiki 90/10 read/write web pages (49%)
performance without losing security guarantees
recovery from crashes
adapted to device virtualization
31
32
Fault injector - https://github.com/ut-osa/fault-injection