who am I
• security engineering at Stripe
• work on (and have capital-F Feelings about)
compilers
• Co-own the only CVE for a skateboard with mike
• (Go lookup 2015-2247 it’s pretty lols)
• wrong island con
Slide 4
Slide 4 text
What this isn’t
• Why you should use $technology
• Why you should not use $technology
Slide 5
Slide 5 text
Compilers are super neat
• Sometimes they’ll save you from yourself
• Sometimes they won’t
• Sometimes they’ll essentially go out of their way
to be footguns
Slide 6
Slide 6 text
what even is a compiler
Lex tokens Parse AST
Codegen
asm
Assembler
Object
Link Executable
input
Slide 7
Slide 7 text
int thing(char* s) {
puts(s);
}
Slide 8
Slide 8 text
TOK int
TOK thing
LPAREN
tok void
STAR
tok s
LBRACE
tok puts
LPAREN
STRING hi!
RPAREN
SEMI
RBRACE
Slide 9
Slide 9 text
FnDecl
RetVal
int
Args
char* s
StmtList
Ident
thing
call
…
puts
s
Slide 10
Slide 10 text
(FnDecl thing ((char* s))
(apply puts (s))
Slide 11
Slide 11 text
Sidenote: Golang
src/cmd/internal/gc/lex.go
Slide 12
Slide 12 text
Sidenote: Golang
src/cmd/internal/gc/lex.go
Slide 13
Slide 13 text
Sidenote: Golang
Slide 14
Slide 14 text
what even is a compiler
Lex tokens Parse AST
Codeg
asm
Assem
Objec
Link Execu
input
Analysis!
Slide 15
Slide 15 text
what even is a compiler
Lex tokens Parse AST
Codeg
asm
Assem
Objec
Link Execu
input
Type checking
Coherence
Optimisation
Slide 16
Slide 16 text
No content
Slide 17
Slide 17 text
No content
Slide 18
Slide 18 text
cool, so why do I give a
fuck?
• In the context of safety there are really only two
high level things you should actually care about:
Slide 19
Slide 19 text
cool, so why do I give a
fuck?
• How hard is it to crash my program?
• How hard is it for an attacker to make that crash
turing complete?
RELRO
• Not actually a great protection, but a fine
deterrent
• Some pretty neat WTF about it’s original design
Slide 52
Slide 52 text
No relro
.got
.dtors
.data
.bss
Slide 53
Slide 53 text
Partial RELRO
.got
.dtors
.data
.bss
Slide 54
Slide 54 text
FULL RELRO
.got
.dtors
.data
.bss
Slide 55
Slide 55 text
One last lol-go
Slide 56
Slide 56 text
Conclusion
• I did not actually have a point
• I just think compilers are neat
• Rust == Good
• Go == Good but fucking lulzy if you dare peek
under the covers
• Shoutout to ben who lent me a charger at 1 this
morning
Slide 57
Slide 57 text
Questions?
• richo
• @rich0H
• github.com/richo
• some slideshare url, I’ll toot it