Enhancing Memory Error Detection for Large-Scale Applications and Fuzz testing
Wookhyun Han, Byunggil Joe, Byoungyoung Lee*, Chengyu Song†, Insik Shin KAIST, *Purdue, †UCR
1
Enhancing Memory Error Detection for Large-Scale Applications and - - PowerPoint PPT Presentation
Enhancing Memory Error Detection for Large-Scale Applications and Fuzz testing Wookhyun Han , Byunggil Joe, Byoungyoung Lee * , Chengyu Song , Insik Shin KAIST, * Purdue, UCR 1 Memory error glibc: getaddrinfo Heartbleed Shellshock
1
2
Heartbleed Shellshock glibc: getaddrinfo stack-based buffer
3
4
4
4
5
Inaccessible Accessible ptrX Shadow memory
5
Inaccessible Accessible
Quarantined
ptrX ptrX free(ptrX) Shadow memory
5
Inaccessible Accessible
Quarantined
ptrX ptrX free(ptrX) Shadow memory
5
Inaccessible Accessible
Quarantined
ptrX ptrX
ptrY free(ptrX) ptrY = malloc() Shadow memory
6
ptrX
6
ptrX
6
ptrX
ptrX
6
ptrX
ptrX
ptrX
6
ptrX
ptrX
ptrX
7
P1 P1
P1
7
P2 P1 P1
P1 P2
7
P2 P1 P1
P1 P2
8
9
Allocated Redzone A memory page Page aliasing
Virtual
9
Allocated Redzone A memory page Page aliasing
Physical Virtual
9
Allocated Redzone A memory page Page aliasing
Physical Virtual
10
Allocated Redzone A memory page Page aliasing
Physical Virtual
Unmapped page
10
Allocated Redzone A memory page Page aliasing
Physical Virtual
Unmapped page
11
Physical Virtual
Allocated Redzone A memory page Page aliasing Unmapped page
11
Physical Virtual
Physical Virtual
Quarantined
Allocated Redzone A memory page Page aliasing Unmapped page
11
Physical Virtual
Physical Virtual
Quarantined
Allocated Redzone A memory page Page aliasing Unmapped page
11
Physical Virtual
Physical Virtual
Quarantined
Allocated Redzone A memory page Page aliasing Unmapped page
ptr
12
ptr
12
ptr
12
ptr
12
13
ASan: 35% vs. MEDS: 98%
14
15
1 2 3 4 Chrome Firefox Apache Nginx ASan MEDS
16
Baseline
1 2 3 4 Chrome Firefox Apache Nginx ASan MEDS
16
Baseline
1 2 3 4 Chrome Firefox Apache Nginx ASan MEDS
16
Baseline
17
0.5 1 1.5 2 2.5 3 3.5 4
ASan
17
0.5 1 1.5 2 2.5 3 3.5 4
ASan
10 20 30 40 50 60 70
1 2 3 4 5 6 7 8
Found crashes Time spent (hrs)
ASan MEDS
18
Saturated
size
19
int a[10]; a[x] = x; struct A { int num[10]; }; struct A *a = malloc(sizeof(struct A)); ... (a+i)->num[8] = i;
size
19
int a[10]; a[x] = x; struct A { int num[10]; }; struct A *a = malloc(sizeof(struct A)); ... (a+i)->num[8] = i;
size
19
int a[10]; a[x] = x; struct A { int num[10]; }; struct A *a = malloc(sizeof(struct A)); ... (a+i)->num[8] = i;
size
19
int a[10]; a[x] = x; struct A { int num[10]; }; struct A *a = malloc(sizeof(struct A)); ... (a+i)->num[8] = i;
20
21