SlideShare a Scribd company logo
SecurePtrs
Proving Secure Compilation with
Data-Flow Back-Translation and
Turn-Taking Simulation
Akram El-Korashy
MPI-SWS
1
Joint work with
Roberto Blanco, Jérémy Thibault, Adrien Durier (MPI-SP), Deepak Garg (MPI-SWS), Catalin Hritcu
(MPI-SP)
Setup: Secure compilation of partial programs
2
Setup: Secure compilation of partial programs
Risk: Partial programs may be linked against buggy
or malicious contexts.
3
Setup: Secure compilation of partial programs
Risk: Partial programs may be linked against buggy
or malicious contexts.
Strategy: Prove that the partial programs, when
compiled properly, are protected from the contexts.
Setup: Secure compilation of partial programs
For example, a
single module
or compilation
unit
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
The context
implements it
The partial
program calls it
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
The partial program
intentionally shares
the array with the
context
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
The partial program
NEVER shares the
user balance with
the context
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
The partial program
NEVER shares the
user balance with
the context
Intention is that
user balance is
"high integrity"
Setup: Secure compilation of partial programs
Risk: Partial programs may be linked against buggy
or malicious contexts.
Strategy: Prove that the partial programs, when
compiled properly, are protected from the contexts.
Recall
Intention is that
user balance is
"high integrity"
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
The partial program
NEVER shares the
user balance with
the context
A buggy/malicious
context
might access the
user balance
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
A buggy/malicious
context
might access the
user balance
r1
init_network:
addi $r1 $r_arg 1024
sw $r2 0($r1)
OVERWRITE
Setup: Secure compilation of partial programs
Risk: Partial programs may be linked against buggy
or malicious contexts.
Strategy: Prove that the partial programs, when
compiled properly, are protected from the contexts.
Setup: Secure compilation of partial programs
Risk: Partial programs may be linked against buggy
or malicious contexts.
Strategy: Prove that the partial programs, when
compiled properly, are protected from the contexts.
"Compiled properly"
means the compiler
enforces isolation e.g.
by relying on CHERI,
micropolicies, etc.
Setup: Secure compilation of partial programs
Risk: Partial programs may be linked against buggy
or malicious contexts.
Strategy: Prove that the partial programs, when
compiled properly, are protected from the contexts.
Focus of this talk:
Proof
techniques
Strategy: Prove that the partial programs, when
compiled properly, are protected from the contexts.
Desired: Preserve the security of the
source program part
(assuming a memory-safe source semantics)
Desired: Preserve the security of the
source program part
(assuming a memory-safe source semantics)
Desired (for our example):
If no execution with a source context overwrites the user
balance, then
no execution with a target context overwrites it either.
Desired: Preserve the security of the
source program part
(assuming a memory-safe source semantics)
Desired (for our example):
Forall safety property S,
If no execution with a source context violates S,
no execution with a target context violates S
either.
called "Preservation of Robust Safety"
Desired (for our example):
Forall safety property S,
If no execution of a source context violates S, then
no execution of the target context violates Seither.
20
called "Preservation of Robust Safety"
Desired (for our example):
Forall safety property S,
If no execution of a source context violates S, then
no execution of the target context violates Seither.
This talk: Explain a proof technique,
called data-flow back-translation.
called "Preservation of Robust Safety"
This talk: Explain a proof technique,
called data-flow back-translation.
Desired (for our example):
Forall safety property S,
If no execution of a source context violates S, then
no execution of the target context violates Seither.
Key
Benefits:
Suited for memory sharing
and syntactic dissimilarity
Desired (for our example):
If no execution with a source context overwrites the user
balance, then
no execution with a target context overwrites it either.
Alternatively, prove the contrapositive:
If there exists an execution of a target context that
overwrites the user balance, then
there also exists a source context and an execution in which
it too overwrites the user balance.
Alternatively, prove the contrapositive:
If there exists an execution of a target context that
overwrites the user balance, then
there also exists a source context and an execution in which
it too overwrites the user balance.
called "Back-translation".
Familiar from plenty of secure compilationliterature
Alternatively, prove the contrapositive:
If there exists an execution of a target context that
overwrites the user balance, then
there also exists a source context and an execution in which
it too overwrites the user balance.
Can prove a back-translation lemma about just whole programs
[Abate et al. 2018 "When good components go bad"]:
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
28
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
ALL target
programs, not
just the image of
the compiler
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Need to prove that is correct, i.e., satisfies the spec.
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Correctness proof similar to a
compiler correctness proof
32
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Trace-directed
Ignore the given program.
Focus just on the given
execution trace (i.e., on an
individual run of the program).
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Trace-directed
interaction
traces
: source
programs
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Trace-directed
interaction
traces
: source
programs
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
A prefix of one target
trace.
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Trace-directed
interaction
traces
: source
programs
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
Indifferent to syntactic dissimilarity
between target and source
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Trace-directed
interaction
traces
: source
programs
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
Indifferent to syntactic dissimilarity
between target and source
No need anymore to
translate the within-
module control
constructs. Only mimic
the external interaction
(flexible def of the back-
translation)
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Trace-directed
interaction
traces
: source
programs
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
Indifferent to syntactic dissimilarity
between target and source
Correctness proof with memory
sharing is involved.
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
If there exists an execution of a whole target program, then
there exists a whole source program and a related execution.
called "Back-translation". Two techniques in the literature:
Syntax-directed
target
programs
: source
programs
Trace-directed
interaction
traces
: source
programs
Correctness proof similar to a
compiler correctness proof
Compiling unstructured target
to a structured source unclear
Indifferent to syntactic dissimilarity
between target and source
Correctness proof with memory
sharing is involved.
40
Trace-directed
interaction
traces
: source
programs
Correctness proof
with memory sharing is involved.
Trace-directed
interaction
traces
: source
programs
Given a trace emitted by
a target program
Correctness proof
with memory sharing is involved.
Trace-directed
interaction
traces
: source
programs
Given a trace emitted by
a target program
Find a source program
emitting a related trace
Correctness proof
with memory sharing is involved.
Trace-directed
interaction
traces
: source
programs
Given a trace emitted by
a target program
Find a source program
emitting a related trace
Correctness proof
with memory sharing is involved.
Back-translation has to
mimic the visible shared
memory operations to
emit a related trace.
45
and
are traces of only the externally observable events
46
and
are traces of only the externally observable events
47
and
are traces of only the externally observable events
Silent labels denote
internal execution. All
silent labels are
eventually dropped.
48
and
are traces of only the externally observable events
There are two kinds of border-
crossing call events (program to
context, and context to program).
49
and
are traces of only the externally observable events
There are two kinds of border-
crossing return events (program to
context, and context to program).
50
and
are traces of only the externally observable events
Calls and returns record a
snapshot of all the
memory shared so far
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
51
Walk through the
example and explain
memory shared so far
and the reason why
Proof of trace-directed back-
translation with memory sharing
is involved.
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
52
border crossing
border crossing
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
53
iobuffer[1024]
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
54
iobuffer[1024]
The call
to init_network shares
the iobuffer; a snapshot
of its contents appears now
and in all future border-
crossing events.
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
55
iobuffer[1024]
The return
from init_network still
shows the iobuffer with
the same contents.
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
56
iobuffer[1024]
The call to receive does
not (directly) share anything
new, but still
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
57
iobuffer[1024]
The return
event from receive also
shows a snapshot
of iobuffer, now with
the received data!
include module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer);
Net.receive();
}
}
58
iobuffer[1024]
The init_network function
must have
stashed the pointer
to iobuffer somewhere in order
to enable other functions of
Net to access it.
59
The init_network function must have
stashed the pointer
to iobuffer somewhere in order to enable other functions of Net
to access it, but
this stash does NOT appear on the
interaction trace because it is not part of the
shared memory.
60
The init_network function must have
stashed the pointer
to iobuffer somewhere in order to enable other functions of Net
to access it, but
this stash does NOT appear on the
interaction trace because it is not part of the
shared memory.
Trace-directed
interaction
traces
: source
programs
Still needs to enable other
functions of Net
to access iobuffer
61
The init_network function must have
stashed the pointer
to iobuffer somewhere in order to enable other functions of Net
to access it, but
this stash does NOT appear on the
interaction trace because it is not part of the
shared memory.
Trace-directed
interaction
traces
: source
programs
implements own
stash
62
Drawback of trace-directed back-translation:
must traverse and stash the whole shared memory
CapablePtrs [El-Korashy et al. 2021]
Reason: Pointers may
be shared indirectly.
63
Fatten the whole graph
reachable from the shared
memory and stash it:
init_network_arg_1,
init_network_arg_2,
.. .
init_network_arg_n
and maintain invariants
between the flattening and
the original.
Drawback of trace-directed back-translation:
must traverse and stash the whole shared memory
CapablePtrs [El-Korashy et al. 2021]
Reason: Pointers may
be shared indirectly.
The stashing mechanism of CapablePtrs [El-Korashy et al.
2021] is not mechanized-proof friendly.
Proving that this stashing mechanism is
sufficient to mimic every possible
memory snapshot is not trivial in Coq.
Proving that this stashing mechanism is
sufficient to mimic every possible
memory snapshot is not trivial in Coq.
e.g., Termination lemmas for custom graph traversal algorithms have to be
proved.
The stashing mechanism of CapablePtrs [El-Korashy et al.
2021] is not mechanized-proof friendly.
66
In summary: Need a back-translation
technique that
we can mechanize with reasonable effort
supports memory sharing by pointer passing
67
In summary: Need a back-translation
technique that
we can mechanize with reasonable effort
supports memory sharing by pointer passing
is indifferent to syntactic dissimilarity between target and source
68
In summary: Need a back-translation
technique that
we can mechanize with reasonable effort
supports memory sharing by pointer passing
is indifferent to syntactic dissimilarity between target and source
Data-Flow
Back-Translation
x 3
69
Data-Flow Back-Translation
[Under submission]
High level idea: Make the traces more informative
so that trace-directed back-translation is easier.
70
Data-Flow Back-Translation
[Under submission]
Need to be careful: The validity of the top-leveltheorem
depends on the interaction traces capturing just the externally
observable behavior of a module.
High level idea: Make the traces more informative
so that trace-directed back-translation is easier.
71
Data-Flow Back-Translation
[Under submission]
(Turns out: easy to decouple the trace alphabet of the main theorem from the trace alphabet of the
back-translation. See the enrichmentlemma and the projectionfunction in the manuscript.)
Need to be careful: The validity of the top-leveltheorem
depends on the interaction traces capturing just the externally
observable behavior of a module.
High level idea: Make the traces more informative
so that trace-directed back-translation is easier.
72
Data-Flow Back-Translation
Silent labels denote
internal execution.
Recall alphabet of
interaction traces
73
Data-Flow Back-Translation
Silent labels are
too abstract.
(They beneficially hide the
control steps, but
unbeneficially hide data-flow
steps.)
74
Data-Flow Back-Translation
Selectively break the
silent-label abstraction
75
Data-Flow Back-Translation
76
Data-Flow Back-Translation
Data-flow events
are just a proof
artefact. They are
emitted by any
execution step
that modifies the
memory or the
register file.
77
If the target context stashes a pointer, or recovers a pointer from the stash,
the data-flow events will now reveal the sequence of operations that
constitutethis stashing/recovery.
78
If the target context stashes a pointer, or recovers a pointer from the stash,
the data-flow events will now reveal the sequence of operations that
constitutethis stashing/recovery.
Data-Flow Back-Translation
maps each individual data-flow event to one or more source-language
expression/statement(s).
data-flow
traces
: source
programs
79
a a+5
80
a a+5
Example: The target context stashes the pointer that is stored
at shared address "a+5" in a private address "b".
81
a a+5
Example: The target context stashes the pointer that is stored
at shared address "a+5" in a private address "b".
Remember: On the interaction trace (standard trace-directed back-
translation), this stashing will just appear as the silent label.
82
a a+5
Data-Flow Events:
83
a a+5
r_arg: a
r_loc: b
Data-Flow Events:
Reg
84
a a+5
r_arg: a
r_1: a
r_loc: b
Data-Flow Events:
Mov Mem Reg' c r_arg r_1 Reg'
85
a a+5
r_arg: a
r_1: a
r_loc: b
r_ct: 5
Data-Flow Events:
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
Reg''
86
a a+5
r_arg: a
r_1: a+5
r_loc: b
r_ct: 5
Data-Flow Events:
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Reg'''
87
a a+5
r_arg: a
r_1: ptr
r_loc: b
r_ct: 5
Data-Flow Events:
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Reg''''
88
a a+5
r_arg: a
r_1: ptr
r_loc: b
r_ct: 5
Reg''''
Data-Flow Events:
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
b: ptr
Mem'
89
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
90
Data-Flow Back-Translation:
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
91
Data-Flow Back-Translation:
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
Reserve one
fixed source
variable to
simulate
each target-
language
register
92
Data-Flow Back-Translation:
Mov Mem Reg' c r_arg r_1
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
93
Data-Flow Back-Translation:
Const Mem Reg'' c 5 r_ct
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
tmp_1 := arg;
94
Data-Flow Back-Translation:
BinOp Mem Reg''' c add r_1 r_ct r_1
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
tmp_1 := arg;
tmp_ct := 5;
95
Data-Flow Back-Translation:
Load Mem Reg'''' c r_1 r_1
Store Mem' Reg'''' c r_loc r_1
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
tmp_1 := arg;
tmp_ct := 5;
tmp_1 := tmp_1 + tmp_ct
96
Data-Flow Back-Translation:
Store Mem' Reg'''' c r_loc r_1
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
tmp_1 := arg;
tmp_ct := 5;
tmp_1 := tmp_1 + tmp_ct
tmp_1 := *(tmp_1)
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
tmp_1 := arg;
tmp_ct := 5;
tmp_1 := tmp_1 + tmp_ct
tmp_1 := *(tmp_1)
*(tmp_loc) := tmp_1
. . .
}
}
97
Data-Flow Back-Translation:
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
tmp_1 := arg;
tmp_ct := 5;
tmp_1 := tmp_1 + tmp_ct
tmp_1 := *(tmp_1)
*(tmp_loc) := tmp_1
. . .
}
}
98
Data-Flow Back-Translation:
Stashing
pointers is
for free.
No need to implement a
traversalof the whole
reachable memory.
module Net {
f (arg) {
...
// tmp_loc points to Net-private memory
tmp_1 := arg;
tmp_ct := 5;
tmp_1 := tmp_1 + tmp_ct
tmp_1 := *(tmp_1)
*(tmp_loc) := tmp_1
. . .
}
}
99
Data-Flow Back-Translation:
Source variables
mimic every
change to target
registers and
private memory.
thanks to the fine-grained information
carried by the data-flowevents.
100
supports memory sharing (without the need for graph traversal)
Data-Flow Back-Translation
101
supports memory sharing (without the need for graph traversal)
Data-Flow Back-Translation
comes with a mechanized back-translation lemma in Coq (12k LoC)
102
supports memory sharing (without the need for graph traversal)
Data-Flow Back-Translation
works for syntactically dissimilar languages: a safe untyped target with
unstructured control and a safe untyped source language with
structured control
comes with a mechanized back-translation lemma in Coq (12k LoC)
103
More in the
paper
https://bit.ly/SecurePtrs
104
More in the
paper
https://bit.ly/SecurePtrs
Our secure compilation proof allows reuse of
whole-program compiler correctness lemmas
(enabled by a novel turn-taking simulation).
Why reuse whole-program compiler
correctness lemmas?
Some kind of a compiler correctness obligation usually shows up in a
secure compilation proof.
Why reuse whole-program compiler
correctness lemmas?
Some kind of a compiler correctness obligation usually shows up in a
secure compilation proof.
If we hope to scale secure compilation proofs to a verified compiler, it will
be easier to reuse rather than redo years-worth of manual proof effort.
Why reuse whole-program compiler
correctness lemmas?
Some kind of a compiler correctness obligation usually shows up in a
secure compilation proof.
If we hope to scale secure compilation proofs to a verified compiler, it will
be easier to reuse rather than redo years-worth of manual proof effort.
Whole-program compiler correctness makes no assumptions about the
context (because there is no context). So, a priori, there will be no difficulty
in instantiating it (as opposed to partial-program correctness lemmas).
Summary: Proof technique for robust safety
preservation
Mechanized in Coq (approx. 30 kLoC)
Reuses whole-program compiler correctness lemmas
Handles syntactically dissimilar target and source languages.
Supports languages with memory sharing
https://bit.ly/SecurePtrs
Backup
State-of-the-art re reuse of whole-program
compiler correctness lemmas in secure compilation
[Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"]
Mechanized in Coq
Supports memory sharing by
pointer passing
Detailed technique but not
machine checkable
Languages have static
memory partition with only
primitive values passable as
arguments.
Scaled the proof of Abate et al. 2018 to languages
with memory sharing
[Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"]
Mechanized in Coq
Supports memory sharing by
pointer passing
Detailed technique but not
machine checkable
Languages have static
memory partition with only
primitive values passable as
arguments.
Scaled the proof of Abate et al. 2018 to languages
with memory sharing
[Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"]
Mechanized in Coq
Supports memory sharing by
pointer passing
Detailed technique but not
machine checkable
Novel ternary turn-taking
relation to support
memory sharing.
(13k LoC in Coq)
Borrowed some intuitions from CapablePtrs
[Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"]
Key Ingredient: Rely on a ternary relation. Key Ingredient: Rely on a ternary relation.
Borrowed some intuitions from CapablePtrs
[Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"]
Key Ingredient: Rely on a ternary relation
(called recomposition) between three target-
language executions.
Key Ingredient: Rely on a ternary relation (called
TrICL) between two target-language executions, and
a third sourceexecuton.
Borrowed some intuitions from CapablePtrs
[Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"]
Key Ingredient: Rely on a ternary relation
(called recomposition) between three target-
language executions.
Key Ingredient: Rely on a ternary relation (called
TrICL) between two target-language executions, and
a third sourceexecuton.
Use ideas from the
strong/weak binary similarity
in CapablePtrs to make the
ternary recomposition
relation aware of memory
sharing.
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
r1
init_network:
addi $r1 $r_arg 1024
sw $r2 0($r1)
Setup: Secure compilation of partial programs
import module Net
module Main {
char iobuffer[1024];
static long int user_balance_usd;
int main(void) {
Net.init_network(iobuffer)
Net.receive();
}
}
r1
init_network:
addi $r1 $r_arg 1024
sw $r2 0($r1)
Compiler should
ensure that the
context
CANNOT access
the user balance
119
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
120
Given a target interaction trace with Net
Call ? init_network
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
121
Given a target interaction trace with Net
Call ? init_network
Ret !
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
122
Given a target interaction trace with Net
Call ? init_network
Ret !
Call ? receive
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
123
Given a target interaction trace with Net
Call ? init_network
Ret !
Call ? receive
Ret !
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
124
Given a target interaction trace with Net
Call ? init_network
Ret !
Call ? receive
Ret !
Find a source
implementation
of Net that emits a related
interaction trace.
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
125
Given a target interaction trace with Net
Call ? init_network
Ret !
Call ? receive
Ret !
Before the source
implementation
of init_network
returns, it stashes its
argument in private
memory, e.g. in a variable
called
init_network_arg.
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
126
Given a target interaction trace with Net
Call ? init_network
Ret !
Call ? receive
Ret !
Before receive
returns, it uses the pointer
stashed in
init_network_arg to
hardcode in the iobuffer
all the green values that
appeared on the given trace.
Example: stash of the Net module
CapablePtrs [El-Korashy et al. 2021]
127
In general, must stash the whole shared memory
CapablePtrs [El-Korashy et al. 2021]
The same function may have
been called more than once: init_network_arg_1_c1,
init_network_arg_2_c1,
.. .
init_network_arg_n_c1
128
In general, must stash the whole shared memory
CapablePtrs [El-Korashy et al. 2021]
The same function may have
been called more than once: init_network_arg_1_c1,
init_network_arg_2_c1,
.. .
init_network_arg_n_c1
init_network_arg_1_c2,
init_network_arg_2_c2,
.. .
init_network_arg_m_c2

More Related Content

What's hot

APSEC2020 Keynote
APSEC2020 KeynoteAPSEC2020 Keynote
APSEC2020 Keynote
Abhik Roychoudhury
 
Key Updating for Leakage Resiliency with Application to AES Modes of Operation
Key Updating for Leakage Resiliency with Application to AES Modes of OperationKey Updating for Leakage Resiliency with Application to AES Modes of Operation
Key Updating for Leakage Resiliency with Application to AES Modes of Operation
1crore projects
 
IRJET - Buffer Overflows Attacks & Defense
IRJET -  	  Buffer Overflows Attacks & DefenseIRJET -  	  Buffer Overflows Attacks & Defense
IRJET - Buffer Overflows Attacks & Defense
IRJET Journal
 
Automated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWSAutomated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWS
Abhik Roychoudhury
 
ICSE2013
ICSE2013ICSE2013
ICSE2013
swy351
 
Dagstuhl2021
Dagstuhl2021Dagstuhl2021
Dagstuhl2021
Abhik Roychoudhury
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Sung Kim
 
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
Lionel Briand
 

What's hot (8)

APSEC2020 Keynote
APSEC2020 KeynoteAPSEC2020 Keynote
APSEC2020 Keynote
 
Key Updating for Leakage Resiliency with Application to AES Modes of Operation
Key Updating for Leakage Resiliency with Application to AES Modes of OperationKey Updating for Leakage Resiliency with Application to AES Modes of Operation
Key Updating for Leakage Resiliency with Application to AES Modes of Operation
 
IRJET - Buffer Overflows Attacks & Defense
IRJET -  	  Buffer Overflows Attacks & DefenseIRJET -  	  Buffer Overflows Attacks & Defense
IRJET - Buffer Overflows Attacks & Defense
 
Automated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWSAutomated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWS
 
ICSE2013
ICSE2013ICSE2013
ICSE2013
 
Dagstuhl2021
Dagstuhl2021Dagstuhl2021
Dagstuhl2021
 
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
 
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
 

Similar to SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Turn-Taking Simulation

A035401010
A035401010A035401010
A035401010
inventionjournals
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
James Wickett
 
SECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONS
SECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONSSECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONS
SECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONS
ijseajournal
 
OWASP Secure Coding Quick Reference Guide
OWASP Secure Coding Quick Reference GuideOWASP Secure Coding Quick Reference Guide
OWASP Secure Coding Quick Reference Guide
Aryan G
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
Carlos Andrés García
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
VMware Tanzu
 
Making Security Agile
Making Security AgileMaking Security Agile
Making Security Agile
Oleg Gryb
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdf
vino108206
 
Application Virtualization
Application VirtualizationApplication Virtualization
Application Virtualization
securityxploded
 
IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...
IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...
IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...
IRJET Journal
 
Introduction to Software Reverse Engineering
Introduction to Software Reverse EngineeringIntroduction to Software Reverse Engineering
Introduction to Software Reverse Engineering
Teodoro Cipresso
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
SHARDA SHARAN
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
Online java compiler with security editor
Online java compiler with security editorOnline java compiler with security editor
Online java compiler with security editor
IRJET Journal
 
Creating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with Chaperone
Gary Wisniewski
 
Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Swati Patel
 
Software Development Life Cycle
Software Development Life Cycle Software Development Life Cycle
Software Development Life Cycle
Dr. Ranjan Kumar Mishra
 
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
Stefano Dalla Palma
 
Newspeak: Evolving Smalltalk for the Age of the Net
Newspeak: Evolving Smalltalk for the Age of the NetNewspeak: Evolving Smalltalk for the Age of the Net
Newspeak: Evolving Smalltalk for the Age of the Net
ESUG
 

Similar to SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Turn-Taking Simulation (20)

A035401010
A035401010A035401010
A035401010
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
 
SECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONS
SECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONSSECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONS
SECURITY FOR DEVOPS DEPLOYMENT PROCESSES: DEFENSES, RISKS, RESEARCH DIRECTIONS
 
OWASP Secure Coding Quick Reference Guide
OWASP Secure Coding Quick Reference GuideOWASP Secure Coding Quick Reference Guide
OWASP Secure Coding Quick Reference Guide
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
 
Securing a Cloud Migration
Securing a Cloud MigrationSecuring a Cloud Migration
Securing a Cloud Migration
 
Making Security Agile
Making Security AgileMaking Security Agile
Making Security Agile
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdf
 
report
reportreport
report
 
Application Virtualization
Application VirtualizationApplication Virtualization
Application Virtualization
 
IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...
IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...
IRJET- An Efficient Hardware-Oriented Runtime Approach for Stack-Based Softwa...
 
Introduction to Software Reverse Engineering
Introduction to Software Reverse EngineeringIntroduction to Software Reverse Engineering
Introduction to Software Reverse Engineering
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
 
Online java compiler with security editor
Online java compiler with security editorOnline java compiler with security editor
Online java compiler with security editor
 
Creating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with Chaperone
 
Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey
 
Software Development Life Cycle
Software Development Life Cycle Software Development Life Cycle
Software Development Life Cycle
 
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
VCCFinder: Finding Potential Vulnerabilities in Open-Source Projects to Assis...
 
Newspeak: Evolving Smalltalk for the Age of the Net
Newspeak: Evolving Smalltalk for the Age of the NetNewspeak: Evolving Smalltalk for the Age of the Net
Newspeak: Evolving Smalltalk for the Age of the Net
 

Recently uploaded

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 

Recently uploaded (20)

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 

SecurePtrs: Proving Secure Compilation with Data-Flow Back-Translation and Turn-Taking Simulation

  • 1. SecurePtrs Proving Secure Compilation with Data-Flow Back-Translation and Turn-Taking Simulation Akram El-Korashy MPI-SWS 1 Joint work with Roberto Blanco, Jérémy Thibault, Adrien Durier (MPI-SP), Deepak Garg (MPI-SWS), Catalin Hritcu (MPI-SP)
  • 2. Setup: Secure compilation of partial programs 2
  • 3. Setup: Secure compilation of partial programs Risk: Partial programs may be linked against buggy or malicious contexts. 3
  • 4. Setup: Secure compilation of partial programs Risk: Partial programs may be linked against buggy or malicious contexts. Strategy: Prove that the partial programs, when compiled properly, are protected from the contexts.
  • 5. Setup: Secure compilation of partial programs For example, a single module or compilation unit
  • 6. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } }
  • 7. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } The context implements it The partial program calls it
  • 8. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } The partial program intentionally shares the array with the context
  • 9. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } The partial program NEVER shares the user balance with the context
  • 10. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } The partial program NEVER shares the user balance with the context Intention is that user balance is "high integrity"
  • 11. Setup: Secure compilation of partial programs Risk: Partial programs may be linked against buggy or malicious contexts. Strategy: Prove that the partial programs, when compiled properly, are protected from the contexts. Recall
  • 12. Intention is that user balance is "high integrity" Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } The partial program NEVER shares the user balance with the context A buggy/malicious context might access the user balance
  • 13. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } A buggy/malicious context might access the user balance r1 init_network: addi $r1 $r_arg 1024 sw $r2 0($r1) OVERWRITE
  • 14. Setup: Secure compilation of partial programs Risk: Partial programs may be linked against buggy or malicious contexts. Strategy: Prove that the partial programs, when compiled properly, are protected from the contexts.
  • 15. Setup: Secure compilation of partial programs Risk: Partial programs may be linked against buggy or malicious contexts. Strategy: Prove that the partial programs, when compiled properly, are protected from the contexts. "Compiled properly" means the compiler enforces isolation e.g. by relying on CHERI, micropolicies, etc.
  • 16. Setup: Secure compilation of partial programs Risk: Partial programs may be linked against buggy or malicious contexts. Strategy: Prove that the partial programs, when compiled properly, are protected from the contexts. Focus of this talk: Proof techniques
  • 17. Strategy: Prove that the partial programs, when compiled properly, are protected from the contexts. Desired: Preserve the security of the source program part (assuming a memory-safe source semantics)
  • 18. Desired: Preserve the security of the source program part (assuming a memory-safe source semantics) Desired (for our example): If no execution with a source context overwrites the user balance, then no execution with a target context overwrites it either.
  • 19. Desired: Preserve the security of the source program part (assuming a memory-safe source semantics) Desired (for our example): Forall safety property S, If no execution with a source context violates S, no execution with a target context violates S either.
  • 20. called "Preservation of Robust Safety" Desired (for our example): Forall safety property S, If no execution of a source context violates S, then no execution of the target context violates Seither. 20
  • 21. called "Preservation of Robust Safety" Desired (for our example): Forall safety property S, If no execution of a source context violates S, then no execution of the target context violates Seither. This talk: Explain a proof technique, called data-flow back-translation.
  • 22. called "Preservation of Robust Safety" This talk: Explain a proof technique, called data-flow back-translation. Desired (for our example): Forall safety property S, If no execution of a source context violates S, then no execution of the target context violates Seither. Key Benefits: Suited for memory sharing and syntactic dissimilarity
  • 23. Desired (for our example): If no execution with a source context overwrites the user balance, then no execution with a target context overwrites it either.
  • 24. Alternatively, prove the contrapositive: If there exists an execution of a target context that overwrites the user balance, then there also exists a source context and an execution in which it too overwrites the user balance.
  • 25. Alternatively, prove the contrapositive: If there exists an execution of a target context that overwrites the user balance, then there also exists a source context and an execution in which it too overwrites the user balance. called "Back-translation". Familiar from plenty of secure compilationliterature
  • 26. Alternatively, prove the contrapositive: If there exists an execution of a target context that overwrites the user balance, then there also exists a source context and an execution in which it too overwrites the user balance. Can prove a back-translation lemma about just whole programs [Abate et al. 2018 "When good components go bad"]: If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 27. called "Back-translation". Two techniques in the literature: If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 28. called "Back-translation". Two techniques in the literature: Syntax-directed 28 If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 29. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 30. If there exists an execution of a whole target program, then there exists a whole source program and a related execution. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs ALL target programs, not just the image of the compiler
  • 31. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Need to prove that is correct, i.e., satisfies the spec. If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 32. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Correctness proof similar to a compiler correctness proof 32 If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 33. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 34. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Trace-directed Ignore the given program. Focus just on the given execution trace (i.e., on an individual run of the program). Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 35. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Trace-directed interaction traces : source programs Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 36. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Trace-directed interaction traces : source programs Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear A prefix of one target trace. If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 37. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Trace-directed interaction traces : source programs Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear Indifferent to syntactic dissimilarity between target and source If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 38. If there exists an execution of a whole target program, then there exists a whole source program and a related execution. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Trace-directed interaction traces : source programs Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear Indifferent to syntactic dissimilarity between target and source No need anymore to translate the within- module control constructs. Only mimic the external interaction (flexible def of the back- translation)
  • 39. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Trace-directed interaction traces : source programs Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear Indifferent to syntactic dissimilarity between target and source Correctness proof with memory sharing is involved. If there exists an execution of a whole target program, then there exists a whole source program and a related execution.
  • 40. If there exists an execution of a whole target program, then there exists a whole source program and a related execution. called "Back-translation". Two techniques in the literature: Syntax-directed target programs : source programs Trace-directed interaction traces : source programs Correctness proof similar to a compiler correctness proof Compiling unstructured target to a structured source unclear Indifferent to syntactic dissimilarity between target and source Correctness proof with memory sharing is involved. 40
  • 42. Trace-directed interaction traces : source programs Given a trace emitted by a target program Correctness proof with memory sharing is involved.
  • 43. Trace-directed interaction traces : source programs Given a trace emitted by a target program Find a source program emitting a related trace Correctness proof with memory sharing is involved.
  • 44. Trace-directed interaction traces : source programs Given a trace emitted by a target program Find a source program emitting a related trace Correctness proof with memory sharing is involved. Back-translation has to mimic the visible shared memory operations to emit a related trace.
  • 45. 45 and are traces of only the externally observable events
  • 46. 46 and are traces of only the externally observable events
  • 47. 47 and are traces of only the externally observable events Silent labels denote internal execution. All silent labels are eventually dropped.
  • 48. 48 and are traces of only the externally observable events There are two kinds of border- crossing call events (program to context, and context to program).
  • 49. 49 and are traces of only the externally observable events There are two kinds of border- crossing return events (program to context, and context to program).
  • 50. 50 and are traces of only the externally observable events Calls and returns record a snapshot of all the memory shared so far
  • 51. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } 51 Walk through the example and explain memory shared so far and the reason why Proof of trace-directed back- translation with memory sharing is involved.
  • 52. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } 52 border crossing border crossing
  • 53. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } 53 iobuffer[1024]
  • 54. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } 54 iobuffer[1024] The call to init_network shares the iobuffer; a snapshot of its contents appears now and in all future border- crossing events.
  • 55. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } 55 iobuffer[1024] The return from init_network still shows the iobuffer with the same contents.
  • 56. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } 56 iobuffer[1024] The call to receive does not (directly) share anything new, but still
  • 57. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } 57 iobuffer[1024] The return event from receive also shows a snapshot of iobuffer, now with the received data!
  • 58. include module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer); Net.receive(); } } 58 iobuffer[1024] The init_network function must have stashed the pointer to iobuffer somewhere in order to enable other functions of Net to access it.
  • 59. 59 The init_network function must have stashed the pointer to iobuffer somewhere in order to enable other functions of Net to access it, but this stash does NOT appear on the interaction trace because it is not part of the shared memory.
  • 60. 60 The init_network function must have stashed the pointer to iobuffer somewhere in order to enable other functions of Net to access it, but this stash does NOT appear on the interaction trace because it is not part of the shared memory. Trace-directed interaction traces : source programs Still needs to enable other functions of Net to access iobuffer
  • 61. 61 The init_network function must have stashed the pointer to iobuffer somewhere in order to enable other functions of Net to access it, but this stash does NOT appear on the interaction trace because it is not part of the shared memory. Trace-directed interaction traces : source programs implements own stash
  • 62. 62 Drawback of trace-directed back-translation: must traverse and stash the whole shared memory CapablePtrs [El-Korashy et al. 2021] Reason: Pointers may be shared indirectly.
  • 63. 63 Fatten the whole graph reachable from the shared memory and stash it: init_network_arg_1, init_network_arg_2, .. . init_network_arg_n and maintain invariants between the flattening and the original. Drawback of trace-directed back-translation: must traverse and stash the whole shared memory CapablePtrs [El-Korashy et al. 2021] Reason: Pointers may be shared indirectly.
  • 64. The stashing mechanism of CapablePtrs [El-Korashy et al. 2021] is not mechanized-proof friendly. Proving that this stashing mechanism is sufficient to mimic every possible memory snapshot is not trivial in Coq.
  • 65. Proving that this stashing mechanism is sufficient to mimic every possible memory snapshot is not trivial in Coq. e.g., Termination lemmas for custom graph traversal algorithms have to be proved. The stashing mechanism of CapablePtrs [El-Korashy et al. 2021] is not mechanized-proof friendly.
  • 66. 66 In summary: Need a back-translation technique that we can mechanize with reasonable effort supports memory sharing by pointer passing
  • 67. 67 In summary: Need a back-translation technique that we can mechanize with reasonable effort supports memory sharing by pointer passing is indifferent to syntactic dissimilarity between target and source
  • 68. 68 In summary: Need a back-translation technique that we can mechanize with reasonable effort supports memory sharing by pointer passing is indifferent to syntactic dissimilarity between target and source Data-Flow Back-Translation x 3
  • 69. 69 Data-Flow Back-Translation [Under submission] High level idea: Make the traces more informative so that trace-directed back-translation is easier.
  • 70. 70 Data-Flow Back-Translation [Under submission] Need to be careful: The validity of the top-leveltheorem depends on the interaction traces capturing just the externally observable behavior of a module. High level idea: Make the traces more informative so that trace-directed back-translation is easier.
  • 71. 71 Data-Flow Back-Translation [Under submission] (Turns out: easy to decouple the trace alphabet of the main theorem from the trace alphabet of the back-translation. See the enrichmentlemma and the projectionfunction in the manuscript.) Need to be careful: The validity of the top-leveltheorem depends on the interaction traces capturing just the externally observable behavior of a module. High level idea: Make the traces more informative so that trace-directed back-translation is easier.
  • 72. 72 Data-Flow Back-Translation Silent labels denote internal execution. Recall alphabet of interaction traces
  • 73. 73 Data-Flow Back-Translation Silent labels are too abstract. (They beneficially hide the control steps, but unbeneficially hide data-flow steps.)
  • 74. 74 Data-Flow Back-Translation Selectively break the silent-label abstraction
  • 76. 76 Data-Flow Back-Translation Data-flow events are just a proof artefact. They are emitted by any execution step that modifies the memory or the register file.
  • 77. 77 If the target context stashes a pointer, or recovers a pointer from the stash, the data-flow events will now reveal the sequence of operations that constitutethis stashing/recovery.
  • 78. 78 If the target context stashes a pointer, or recovers a pointer from the stash, the data-flow events will now reveal the sequence of operations that constitutethis stashing/recovery. Data-Flow Back-Translation maps each individual data-flow event to one or more source-language expression/statement(s). data-flow traces : source programs
  • 80. 80 a a+5 Example: The target context stashes the pointer that is stored at shared address "a+5" in a private address "b".
  • 81. 81 a a+5 Example: The target context stashes the pointer that is stored at shared address "a+5" in a private address "b". Remember: On the interaction trace (standard trace-directed back- translation), this stashing will just appear as the silent label.
  • 83. 83 a a+5 r_arg: a r_loc: b Data-Flow Events: Reg
  • 84. 84 a a+5 r_arg: a r_1: a r_loc: b Data-Flow Events: Mov Mem Reg' c r_arg r_1 Reg'
  • 85. 85 a a+5 r_arg: a r_1: a r_loc: b r_ct: 5 Data-Flow Events: Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct Reg''
  • 86. 86 a a+5 r_arg: a r_1: a+5 r_loc: b r_ct: 5 Data-Flow Events: Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Reg'''
  • 87. 87 a a+5 r_arg: a r_1: ptr r_loc: b r_ct: 5 Data-Flow Events: Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Reg''''
  • 88. 88 a a+5 r_arg: a r_1: ptr r_loc: b r_ct: 5 Reg'''' Data-Flow Events: Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1 b: ptr Mem'
  • 89. 89 Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1
  • 90. 90 Data-Flow Back-Translation: Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1 module Net { f (arg) { ... // tmp_loc points to Net-private memory
  • 91. 91 Data-Flow Back-Translation: Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1 module Net { f (arg) { ... // tmp_loc points to Net-private memory Reserve one fixed source variable to simulate each target- language register
  • 92. 92 Data-Flow Back-Translation: Mov Mem Reg' c r_arg r_1 Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1 module Net { f (arg) { ... // tmp_loc points to Net-private memory
  • 93. 93 Data-Flow Back-Translation: Const Mem Reg'' c 5 r_ct BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1 module Net { f (arg) { ... // tmp_loc points to Net-private memory tmp_1 := arg;
  • 94. 94 Data-Flow Back-Translation: BinOp Mem Reg''' c add r_1 r_ct r_1 Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1 module Net { f (arg) { ... // tmp_loc points to Net-private memory tmp_1 := arg; tmp_ct := 5;
  • 95. 95 Data-Flow Back-Translation: Load Mem Reg'''' c r_1 r_1 Store Mem' Reg'''' c r_loc r_1 module Net { f (arg) { ... // tmp_loc points to Net-private memory tmp_1 := arg; tmp_ct := 5; tmp_1 := tmp_1 + tmp_ct
  • 96. 96 Data-Flow Back-Translation: Store Mem' Reg'''' c r_loc r_1 module Net { f (arg) { ... // tmp_loc points to Net-private memory tmp_1 := arg; tmp_ct := 5; tmp_1 := tmp_1 + tmp_ct tmp_1 := *(tmp_1)
  • 97. module Net { f (arg) { ... // tmp_loc points to Net-private memory tmp_1 := arg; tmp_ct := 5; tmp_1 := tmp_1 + tmp_ct tmp_1 := *(tmp_1) *(tmp_loc) := tmp_1 . . . } } 97 Data-Flow Back-Translation:
  • 98. module Net { f (arg) { ... // tmp_loc points to Net-private memory tmp_1 := arg; tmp_ct := 5; tmp_1 := tmp_1 + tmp_ct tmp_1 := *(tmp_1) *(tmp_loc) := tmp_1 . . . } } 98 Data-Flow Back-Translation: Stashing pointers is for free. No need to implement a traversalof the whole reachable memory.
  • 99. module Net { f (arg) { ... // tmp_loc points to Net-private memory tmp_1 := arg; tmp_ct := 5; tmp_1 := tmp_1 + tmp_ct tmp_1 := *(tmp_1) *(tmp_loc) := tmp_1 . . . } } 99 Data-Flow Back-Translation: Source variables mimic every change to target registers and private memory. thanks to the fine-grained information carried by the data-flowevents.
  • 100. 100 supports memory sharing (without the need for graph traversal) Data-Flow Back-Translation
  • 101. 101 supports memory sharing (without the need for graph traversal) Data-Flow Back-Translation comes with a mechanized back-translation lemma in Coq (12k LoC)
  • 102. 102 supports memory sharing (without the need for graph traversal) Data-Flow Back-Translation works for syntactically dissimilar languages: a safe untyped target with unstructured control and a safe untyped source language with structured control comes with a mechanized back-translation lemma in Coq (12k LoC)
  • 104. 104 More in the paper https://bit.ly/SecurePtrs Our secure compilation proof allows reuse of whole-program compiler correctness lemmas (enabled by a novel turn-taking simulation).
  • 105. Why reuse whole-program compiler correctness lemmas? Some kind of a compiler correctness obligation usually shows up in a secure compilation proof.
  • 106. Why reuse whole-program compiler correctness lemmas? Some kind of a compiler correctness obligation usually shows up in a secure compilation proof. If we hope to scale secure compilation proofs to a verified compiler, it will be easier to reuse rather than redo years-worth of manual proof effort.
  • 107. Why reuse whole-program compiler correctness lemmas? Some kind of a compiler correctness obligation usually shows up in a secure compilation proof. If we hope to scale secure compilation proofs to a verified compiler, it will be easier to reuse rather than redo years-worth of manual proof effort. Whole-program compiler correctness makes no assumptions about the context (because there is no context). So, a priori, there will be no difficulty in instantiating it (as opposed to partial-program correctness lemmas).
  • 108. Summary: Proof technique for robust safety preservation Mechanized in Coq (approx. 30 kLoC) Reuses whole-program compiler correctness lemmas Handles syntactically dissimilar target and source languages. Supports languages with memory sharing https://bit.ly/SecurePtrs
  • 109. Backup
  • 110. State-of-the-art re reuse of whole-program compiler correctness lemmas in secure compilation [Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"] Mechanized in Coq Supports memory sharing by pointer passing Detailed technique but not machine checkable Languages have static memory partition with only primitive values passable as arguments.
  • 111. Scaled the proof of Abate et al. 2018 to languages with memory sharing [Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"] Mechanized in Coq Supports memory sharing by pointer passing Detailed technique but not machine checkable Languages have static memory partition with only primitive values passable as arguments.
  • 112. Scaled the proof of Abate et al. 2018 to languages with memory sharing [Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"] Mechanized in Coq Supports memory sharing by pointer passing Detailed technique but not machine checkable Novel ternary turn-taking relation to support memory sharing. (13k LoC in Coq)
  • 113. Borrowed some intuitions from CapablePtrs [Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"] Key Ingredient: Rely on a ternary relation. Key Ingredient: Rely on a ternary relation.
  • 114. Borrowed some intuitions from CapablePtrs [Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"] Key Ingredient: Rely on a ternary relation (called recomposition) between three target- language executions. Key Ingredient: Rely on a ternary relation (called TrICL) between two target-language executions, and a third sourceexecuton.
  • 115. Borrowed some intuitions from CapablePtrs [Abate et al. 2018 "When good components go bad"] [El-Korashy et al. 2021 "CapablePtrs"] Key Ingredient: Rely on a ternary relation (called recomposition) between three target- language executions. Key Ingredient: Rely on a ternary relation (called TrICL) between two target-language executions, and a third sourceexecuton. Use ideas from the strong/weak binary similarity in CapablePtrs to make the ternary recomposition relation aware of memory sharing.
  • 116.
  • 117. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } r1 init_network: addi $r1 $r_arg 1024 sw $r2 0($r1)
  • 118. Setup: Secure compilation of partial programs import module Net module Main { char iobuffer[1024]; static long int user_balance_usd; int main(void) { Net.init_network(iobuffer) Net.receive(); } } r1 init_network: addi $r1 $r_arg 1024 sw $r2 0($r1) Compiler should ensure that the context CANNOT access the user balance
  • 119. 119 Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 120. 120 Given a target interaction trace with Net Call ? init_network Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 121. 121 Given a target interaction trace with Net Call ? init_network Ret ! Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 122. 122 Given a target interaction trace with Net Call ? init_network Ret ! Call ? receive Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 123. 123 Given a target interaction trace with Net Call ? init_network Ret ! Call ? receive Ret ! Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 124. 124 Given a target interaction trace with Net Call ? init_network Ret ! Call ? receive Ret ! Find a source implementation of Net that emits a related interaction trace. Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 125. 125 Given a target interaction trace with Net Call ? init_network Ret ! Call ? receive Ret ! Before the source implementation of init_network returns, it stashes its argument in private memory, e.g. in a variable called init_network_arg. Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 126. 126 Given a target interaction trace with Net Call ? init_network Ret ! Call ? receive Ret ! Before receive returns, it uses the pointer stashed in init_network_arg to hardcode in the iobuffer all the green values that appeared on the given trace. Example: stash of the Net module CapablePtrs [El-Korashy et al. 2021]
  • 127. 127 In general, must stash the whole shared memory CapablePtrs [El-Korashy et al. 2021] The same function may have been called more than once: init_network_arg_1_c1, init_network_arg_2_c1, .. . init_network_arg_n_c1
  • 128. 128 In general, must stash the whole shared memory CapablePtrs [El-Korashy et al. 2021] The same function may have been called more than once: init_network_arg_1_c1, init_network_arg_2_c1, .. . init_network_arg_n_c1 init_network_arg_1_c2, init_network_arg_2_c2, .. . init_network_arg_m_c2