Upload
hanhi
View
224
Download
3
Embed Size (px)
Citation preview
A DSL Approach to Reconcile Equivalent Divergent ProgramExecutions
LuísPina
DanielGrumberg
AnastasiosAndronidis
CristianCadar
{l.pina / daniel.grumberg14 / a.andronidis15 / c.cadar}@imperial.ac.ukImperial College London
London, UK
July 13th, 2017
2017 USENIX Annual Technical Conference (ATC)
Equivalent Divergent Program Executions
>./hello1 >./hello2Hello world Hello world
>ldd hello1 >ldd hello2libc.so.6 libc.so.6
jemalloc.so.6>strace hello1 >strace hello2write(1, "Hello world", 11) write(1, "Hello ", 6)
write(1, "world" , 5)
3
Equivalent Divergent Program Executions
>./hello1 >./hello2Hello world Hello world>ldd hello1 >ldd hello2libc.so.6 libc.so.6
jemalloc.so.6
>strace hello1 >strace hello2write(1, "Hello world", 11) write(1, "Hello ", 6)
write(1, "world" , 5)
4
Equivalent Divergent Program Executions
>./hello1 >./hello2Hello world Hello world>ldd hello1 >ldd hello2libc.so.6 libc.so.6
jemalloc.so.6>strace hello1 >strace hello2write(1, "Hello world", 11) write(1, "Hello ", 6)
write(1, "world" , 5)
5
Multi-Version Execution (MVE)
Run multiple versions as one
I Improves reliabilitymalloc(WEIRD_NUMBER) jemalloc(WEIRD_NUMBER)SEGFAULT OK
I Improves security>strace hello1 >strace hello2write(1,"Hello world") write(1,"Hello, ")
fork()execve("/bin/sh")write(1,"world!")
Versions should be diverse but equivalent
6
Multi-Version Execution (MVE)
Run multiple versions as one
I Improves reliabilitymalloc(WEIRD_NUMBER) jemalloc(WEIRD_NUMBER)SEGFAULT OK
I Improves security>strace hello1 >strace hello2write(1,"Hello world") write(1,"Hello, ")
fork()execve("/bin/sh")write(1,"world!")
Versions should be diverse but equivalent
7
Multi-Version Execution (MVE)
Run multiple versions as one
I Improves reliabilitymalloc(WEIRD_NUMBER) jemalloc(WEIRD_NUMBER)SEGFAULT OK
I Improves security>strace hello1 >strace hello2write(1,"Hello world") write(1,"Hello, ")
fork()execve("/bin/sh")write(1,"world!")
Versions should be diverse but equivalent
8
Multi-Version Execution (MVE)
Run multiple versions as one
I Improves reliabilitymalloc(WEIRD_NUMBER) jemalloc(WEIRD_NUMBER)SEGFAULT OK
I Improves security>strace hello1 >strace hello2write(1,"Hello world") write(1,"Hello, ")
fork()execve("/bin/sh")write(1,"world!")
Versions should be diverse but equivalent9
Versions should be diverse but equivalent
What about equivalent executions that issue divergent sequencesof system calls?
>strace hello1 >strace hello2write(1,"Hello world", 11)
=>
write(1,"Hello ", 6)
,
write(1,"world" , 5)
Describe the divergences with aDomain Specific Language (DSL)
10
Versions should be diverse but equivalent
What about equivalent executions that issue divergent sequencesof system calls?
>strace hello1 >strace hello2write(1,"Hello world", 11)
=>
write(1,"Hello ", 6)
,
write(1,"world" , 5)
Describe the divergences with aDomain Specific Language (DSL)
11
Versions should be diverse but equivalent
What about equivalent executions that issue divergent sequencesof system calls?
>strace hello1 >strace hello2
write(1,"Hello world", 11)
=>
write(1,"Hello ", 6)
,
write(1,"world" , 5)
Describe the divergences with aDomain Specific Language (DSL)
12
Versions should be diverse but equivalent
What about equivalent executions that issue divergent sequencesof system calls?
>strace hello1 >strace hello2
write(1,"Hello world", 11) => write(1,"Hello ", 6) ,write(1,"world" , 5)
Describe the divergences with aDomain Specific Language (DSL)
13
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar". . .
. . .
. . .
Recorded
Replayed
DSL
14
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar". . .
. . .
. . .
Recorded
Replayed
DSL
15
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar". . .
. . .
. . .
Recorded
Replayed
DSL
16
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar"
. . .
. . .
. . .
Recorded
Replayed
DSL
17
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar"
. . .
. . .
. . .
Recorded
Replayed
DSL
18
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar"
. . .
. . .
. . .
Recorded
Replayed
DSL
19
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar"
. . .
. . .
. . .
Recorded
Replayed
DSL
20
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar". . .
. . .
. . .
Recorded
Replayed
DSL
21
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar". . .
. . .
. . .
Recorded
Replayed
DSL
22
MVE ArchitectureVaran
1234
567
891011
12
RingBuffer
SharedMemory
Leader Follower
User
Varan
OS Kernel
read(0,_,128)
read(0,_,128)
read(0,_,128) = 6 // "foobar"
6, "foobar". . .
. . .
. . .
Recorded
Replayed
DSL
23
DSL ArchitectureRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
24
DSL ArchitectureRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
25
DSL ArchitectureRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
26
DSL Rules
I Default rule: read(_,_,_) as r => rI Actions
I MATCHI NOPI SKIPI EXECUTEI STORE
I Further examplesI Hello worldI nothing keywordI C predicates
27
Hello World RuleRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSL
nop exec
write"Hello "DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
29
Hello World RuleRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
30
Hello World RuleRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
31
Hello World RuleRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
32
Hello World RuleRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
33
Hello World RuleRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
34
Hello World RuleRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
write(1, "Hello world", 11) => write(1, "Hello ", 6),write(1, "world" , 5)
35
nothing KeywordRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSL
nopexec sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
nothing => sched_yield()37
nothing KeywordRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
nothing => sched_yield()38
nothing KeywordRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
nothing => sched_yield()39
nothing KeywordRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
nothing => sched_yield()
40
C Predicatesand multiple left-hand side
// extern int sig1, sig2;sigact(sig,_,_) { $(sig) == sig1; } as s1,sigact(sig,_,_) { $(sig) == sig2; } as s2 => s2, s1
41
C PredicatesRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
sigact(sig,_,_) { $(sig) == sig1; } as s1,sigact(sig,_,_) { $(sig) == sig2; } as s2 => s2, s1
42
C PredicatesRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
sigact(sig,_,_) { $(sig) == sig1; } as s1,sigact(sig,_,_) { $(sig) == sig2; } as s2 => s2, s1
43
C PredicatesRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
sigact(sig,_,_) { $(sig) == sig1; } as s1,sigact(sig,_,_) { $(sig) == sig2; } as s2 => s2, s1
44
C PredicatesRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
sigact(sig,_,_) { $(sig) == sig1; } as s1,sigact(sig,_,_) { $(sig) == sig2; } as s2 => s2, s1
45
C PredicatesRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig11.
DSL
storenop
sigactionsig22.
DSL
match 2
match
sigactionsig2DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
sigact(sig,_,_) { $(sig) == sig1; } as s1,sigact(sig,_,_) { $(sig) == sig2; } as s2 => s2, s1
46
C PredicatesRecorded
read"foobar"
. . .Replayed
read"foobar"
. . .
DSL
match match
read"foobar"
read"foobar"
write"Hello world"
write"Hello "write
"world"
DSLnop exec
write"Hello "
DSL
skipexec
write"Hello world"
write"world"
?
sched_yield
DSLnop
exec
sched_yield
sigactionsig1
sigactionsig2
?sigaction
sig2sigaction
sig1
DSL
store
nop
sigactionsig1
1.
DSL
storenop
sigactionsig2
2.
DSL
match 2
match
sigactionsig2
DSL
match 1
match
sigactionsig1
sigactionsig2
sigactionsig1
sigact(sig,_,_) { $(sig) == sig1; } as s1,sigact(sig,_,_) { $(sig) == sig2; } as s2 => s2, s1
47
Deployment scenariosDifferent configurations
Recorded Redis minimal configReplayed 1 Redis with persistency (3 rules)Replayed 2 Redis with verbose logs (4 rules)Replayed 3 Redis with persistency and verbose logs (7 rules)
49
Deployment scenariosDifferent releases
ID Redis Versions Commits RulesRecorded – Replayed1 1.3.8 – 1.3.10 40 0
6
2 1.3.10 – 1.3.12 105 03 1.3.12 – 2.0.0 92 14 2.0.0 – 2.0.5 34 15 2.0.5 – 2.2.0 730 36 2.2.0 – 2.2.15 110 2
50
Deployment scenariosAnalyses
Recorded NativeReplayed 1 Asan (3 rules)Replayed 2 Msan (1 rule)Replayed 3 Tsan (5 rules)Replayed 4 Valgrind (14 rules)1
× I git (log, blame, diff, tag)I openssh (ssh, ssh-keygen)I htopI vim
1Expands to 31 rules through group syntatic-sugar51
Deployment scenariosAnalyses
Recorded NativeReplayed 1 Asan (3 rules)Replayed 2 Msan (1 rule)Replayed 3 Tsan (5 rules)Replayed 4 Valgrind (14 rules)1
×
I git (log, blame, diff, tag)I openssh (ssh, ssh-keygen)I htopI vim
1Expands to 31 rules through group syntatic-sugar52
Deployment scenariosAnalyses
Recorded NativeReplayed 1 Asan (3 rules)Replayed 2 Msan (1 rule)Replayed 3 Tsan (5 rules)Replayed 4 Valgrind (14 rules)1
× I git (log, blame, diff, tag)I openssh (ssh, ssh-keygen)I htopI vim
1Expands to 31 rules through group syntatic-sugar53
Finding Rules
1. strace -o native.log native
2. strace -o valgrind.log valgrind
3. vimdiff native.log valgrind.log
56
Finding Rulesvimdiff native.log
gettid
read(3, ..., 4096)gettid
lseek(3, -2347, SEEK_CUR)gettid
read(3, ..., 4096)gettid
close(3)
valgrind.loggettid()write(1029, "D", 1)sigprocmask([], ~[...])read(3, ..., 4096)sigprocmask(~[...], NULL)gettid()read(1028, "D", 1)lseek(3, -2347, SEEK_CUR)gettid()write(1029, "E", 1)sigprocmask([], ~[...])read(3, ..., 4096)sigprocmask( [...], NULL)gettid()read(1028, "E", 1)close(3)
57
Finding Rulesvimdiff native.log
gettid
read(3, ..., 4096)gettid
lseek(3, -2347, SEEK_CUR)
gettid
read(3, ..., 4096)gettid
close(3)
valgrind.loggettid()write(1029, "D", 1)sigprocmask([], ~[...])read(3, ..., 4096)sigprocmask(~[...], NULL)gettid()read(1028, "D", 1)
lseek(3, -2347, SEEK_CUR)
gettid()write(1029, "E", 1)sigprocmask([], ~[...])read(3, ..., 4096)sigprocmask( [...], NULL)gettid()read(1028, "E", 1)
close(3)
58
Finding Rulesvimdiff native.log
gettid
read( _ , _ , _ ) as r =>gettid
lseek(3, -2347, SEEK_CUR)
gettid
read(3, ..., 4096)gettid
close(3)
valgrind.loggettid() ,write(1029, _ , 1) ,sigprocmask( _ , _ ) ,r,
sigprocmask( _ , _ ) ,gettid() ,read(1028, _ , 1)
lseek(3, -2347, SEEK_CUR)
gettid()write(1029, "E", 1)sigprocmask([], ~[...])read(3, ..., 4096)sigprocmask( [...], NULL)gettid()read(1028, "E", 1)
close(3)
59
Rule synthesis algorithm
I Rules with the shape: syscall as s => ..., s, ...I Input: recorded and replayed tracesI Output: set of candidate rulesI Was able to find 16 out of 19 applicable rules
I Non-determinism and infrequent syscalls impact quality of rulesI Details in the paper
60
Conclusion
A DSL Approach to Reconcile EquivalentDivergent Program Executions
I Increases the applicability of multi-version executionI For reliability and securityI State-of-the-art MVE struggles with divergences
I Simple expressive language for reconciling system call sequencesI Recorded and replayedI DSL provides the required action to tolerate divergences
I Necessary rules are easy to identifyI vimdiff of strace logs
I Automatic algorithm to synthethize rulesI From equivalent strace logs
61
We’re hiring!
I Post-doc position in Software Systems and Program AnalysisI Starting in November 2017, apply until August 2017I Up to 17 months, possibly extendable to 24I Details: https://srg.ic.ac.uk/vacancies
62
A DSL Approach to Reconcile EquivalentDivergent Program Executions
I Increases the applicability of multi-version executionI For reliability and securityI State-of-the-art MVE struggles with divergences
I Simple expressive language for reconciling system call sequencesI Recorded and replayedI DSL provides the required action to tolerate divergences
I Necessary rules are easy to identifyI vimdiff of strace logs
I Automatic algorithm to synthethize rulesI From equivalent strace logs
Luís Pina, Daniel Grumberg, Anastasios Andronidis, Cristian CadarImperial College London
63