Bunshin: Compositing Security Mechanisms through Diversification
Meng Xu, Kangjie Lu, Taesoo Kim, Wenke Lee Georgia Institute of Technology
1
Bunshin: Compositing Security Mechanisms through Diversification - - PowerPoint PPT Presentation
Bunshin: Compositing Security Mechanisms through Diversification Meng Xu, Kangjie Lu, Taesoo Kim, Wenke Lee Georgia Institute of Technology 1 Memory Corruptions Are Costly 2 3 4 Name your phone Nexus 5X %x.%x 5 Battle against
1
2
3
4
5
6
7
void foo(T *a) { *a = 0x1234; } void foo(T *a) { if(!is_valid_address(a) { report_and_abort(); } *a = 0x1234; } Sanitize
8
Memory Error Main Causes Defenses Out-of-bound read/write Lack of length check Softbound AddressSanitizer Integer overflow Format string bug Bad type casting Use-after-free Dangling pointer CETS AddressSanitizer Double free Uninitialized read Lack of initialization MemorySanitizer Data structure alignment Subword copying Undefined behaviors Divide-by-zero UndefinedBehaviorSanitizer Pointer misalignment Null-pointer dereference
9
10
11
Program Input Output
12
Virtualization Synchronize Execution & Consolidate Outputs
Input Output Variant 1 Variant 2 Variant 3 Program Input Output
13
Virtualization Synchronize Execution & Consolidate Outputs
Input (benign) Output (consensus) Variant 1 Variant 2 Variant 3 Program Input Output
14
Virtualization Synchronize Execution & Consolidate Outputs
Output (divergence) Variant 1 Variant 2 Variant 3 Program Input Output Input (malicious)
15
Virtualization Synchronize Execution & Consolidate Outputs
Output (divergence) Variant 1 Variant 2 Variant 3 Program Input Output Input (malicious)
16
17
18
19
Memory Error Defenses Out-of-bound read/write Softbound, AddressSanitizer Use-after-free CETS, AddressSanitizer Uninitialized read MemorySanitizer Undefined behaviors UndefinedBehaviorSanitizer
void foo(T *a) { if(!is_valid_address(a) { report_and_abort(); } *a = 0x1234; } void bar(T *b) { if(!is_valid_address(b) { report_and_abort(); } *b = 0x5678; }
20
21
Virtualization Synchronize Execution & Consolidate Outputs
Input Output Variant 1 Variant 2 Variant 3 Program Input Output
Partition 1 Partition 2 Partition 3 Partition 1 Partition 2 Partition 3
22
Virtualization Synchronize Execution & Consolidate Outputs
Input Output Variant 1 Variant 2 Variant 3 Program Input Output
A D D R E S S M E M O R Y U N D E F A D D R E S S M E M O R Y U N D E F
void foo(T *a) { timing_start(); if(!is_valid_address(a) { report_and_abort(); } *a = 0x1234; timing_end(); } void foo(T *a) { timing_start(); *a = 0x1234; timing_end(); }
23
24
17% 28% 35% 20%
Foo Bar Baz Qux
17% 35%
Foo Baz
28% 20%
Bar Qux Variant 1 (52% overhead) Variant 2 (48% overhead)
25
Costs profiling Security mechanisms Variant compiling Variant generator Source code Variants Overhead distribution
(e.g., ASan, MSan, UBSan)
w/ ASan w/ UBSan w/ MSan w/ ASan
...
full selective
...
26
27
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
sync slot
Syscall number Arguments Execution result
28
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
Syscall number Arguments Execution result
sync slot
① Leader enters syscall
29
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
Syscall number Arguments Execution result
sync slot
② Followers enter syscall
30
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
Syscall number Arguments Execution result
sync slot
③ Kernel execute the syscall
31
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
Syscall number Arguments Execution result
sync slot
④ Leader fetches syscall result ④ Followers fetch syscall result
32
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
sync ring buffer
Leader writes at the next available slot Followers read at their own speed
33
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
sync ring buffer Always strictly synchronized for “write” related system calls
34
Userspace Kernel Leader Follower 1 Follower 2
Partition 1 Partition 2 Partition 3
sync ring buffer Always strictly synchronized for “write” related system calls
35
Before fork After fork Leader Follower 1 Follower 2
Original Execution group New Execution group New ring buffer
36
Before fork After fork Leader Follower 1 Follower 2
Original Execution group New Execution group New ring buffer
37
Leader Follower 1 Follower 2 Userspace Kernel Total order of lock acquisition and releases Record Enforce Enforce
38
Leader Follower 1 Follower 2 Userspace Kernel Total order of lock acquisition and releases Record Enforce Enforce
39
40
Benchmark Single/Multi-thread Featuer Pass ? SPEC CPU2006 Single CPU Intensive SPLASH-2x Multi PARSEC Multi 6 out of 13 lighttpd Single I/O Intensive nginx Multi python, php Single Interpreter
41
Config Succeed Probabilistic Failed Not possible Default 114 16 720 2990 AddressSanitizer 8 842 2990 Bunshin 8 842 2990 Config CVE Exploits Sanitizer Detect nginx-1.4.0 2013-2028 Blind ROP AddressSanitizer cpython-2.7.10 2016-5636 Integer overflow AddressSanitizer php-5.6.6 2015-4602 Type confusion AddressSanitizer
2014-0160 Heartbleed AddressSanitizer httpd-2.4.10 2014-3581 Null dereference UndefinedBehaviorSanitizer
Benchmark Items Strict-Lockstep Selective-Lockstep SPEC CPU2006 (19 Programs) Max 17.5% 14.7% Min 1.6% 1.0% Ave 8.6% 5.6% SPLASH-2X / PARSEC (19 Programs) Max 21.4% 18.9% Min 10.7% 6.6% Ave 16.6% 14.5% lighttpd 1MB File Request Ave 1.44% 1.21% nginx 1MB File Request Ave 1.71% 1.41%
44
Sync Overhead (%) Number of variants 2 4 6 8
0.5 6.6 11.4 1.7 11.2 17.2 37.6 0.6 4.4 10.5 20.9
Ave Max Min
45
Sync Overhead (%) Number of variants 2 4 6 8
0.5 6.6 11.4 1.7 11.2 17.2 37.6 0.6 4.4 10.5 20.9
Ave Max Min
46
Sync Overhead (%) Number of variants 2% 50% 99%
0.2 0.8 1.9 6.4 9.7 13 2.2 4.8 6.6
Ave Max Min
47
Sync Overhead (%) Number of variants 2% 50% 99%
0.2 0.8 1.9 6.4 9.7 13 2.2 4.8 6.6
Ave Max Min
48
Overhead (%) Whole V1 V2 V3 Bunshin
43.1 37.2 34.9 34.8 107
Overhead (%) Whole V1 V2 Bunshin
65.6 63 57.4 107
49
Overhead (%) Whole V1 V2 V3 Bunshin
94.5 88 78.7 77.2 228
Overhead (%) Whole V1 V2 Bunshin
129 125 124 228
50
Overhead (%) Whole V1 V2 V3 Bunshin
43.1 37.2 34.9 34.8 107
Overhead (%) Whole V1 V2 Bunshin
65.6 63 57.4 107 53.5 53.5 35.7 35.7
51
Overhead (%) Whole V1 V2 V3 Bunshin
94.5 88 78.7 77.2 228
Overhead (%) Whole V1 V2 Bunshin
129 125 124 228 114 114 76 76
53
Overhead (%) gobmk povray h264ref average
177 208 248 165 172 207 189 141 148 191 246 158 98.9 112 205 116
ASan MSan UBSan Bunshin
Overhead (%) gobmk povray h264ref average
177 208 248 165 172 207 189 141 148 191 246 158 98.9 112 205 116
ASan MSan UBSan Bunshin
54
55
56