Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Sanitizing All* The Things
Greg Heo
September 12, 2017
Technology
0
34
Sanitizing All* The Things
Address sanitizer and thread sanitizer. What, why, how?
Greg Heo
September 12, 2017
Tweet
Share
More Decks by Greg Heo
See All by Greg Heo
gregheo
0
67
gregheo
0
47
gregheo
0
160
gregheo
0
16
gregheo
0
33
gregheo
0
500
gregheo
0
64
gregheo
0
98
gregheo
3
170
Other Decks in Technology
See All in Technology
sei88888
5
450
akakou
2
360
ytaka23
3
740
ocise
0
120
prog893
0
140
brtriver
1
490
1ftseabass
PRO
0
110
hacker2202
0
100
yashi8484
0
130
halhira
1
120
gracia
0
970
kinunori
1
130
Featured
See All Featured
zenorocha
296
40k
roundedbygravity
84
7.9k
schacon
147
6.7k
carmenhchung
34
1.6k
frogandcode
128
20k
stephaniewalter
262
11k
pedronauck
652
110k
akmur
252
19k
lynnandtonic
272
16k
sachag
267
17k
jmmastey
10
700
keathley
20
760
Transcript
Sanitizing All* The Things tacow / September 2017 / @gregheo
❓ ✋
None
✅
None
‣ ASAN ‣ TSAN
‣ What? ‣ So what? ‣ How? ‣ Show me?
Address Sanitizer allocated buffer unallocated!
‣ Buffer overflows ‣ Subtle bugs ‣ Security vulnerabilities
None
allocated buffer padding shadow memory poisoned poisoned OK
asan_malloc malloc asan_free free Shadow memory check Pointer access
Live Coding!
Address Sanitizer Memory corruption & errors Security & crashes Custom
malloc & free
Thread Sanitizer memory buffer read write
‣ Race conditions ‣ Very subtle and difficult-to-reproduce bugs ‣
Thread mismatch errors
None
‣ Thread ID ‣ Timestamp ‣ Read or write? ‣
Bytes accessed
None
Live Coding!
Thread Sanitizer Data race detector Find race conditions & thread
issues Thread IDs & timestamps
Address Sanitizer Memory corruption & errors Security & crashes Custom
malloc & free
None
@gregheo