Splitting the Control Flow with Boolean Flags
Axel Simon ´ Ecole Normale Sup´ erieure, Paris, France A.Simon@ens.fr July 2008
Axel Simon Splitting the Control Flow with Boolean Flags
Splitting the Control Flow with Boolean Flags Axel Simon Ecole - - PowerPoint PPT Presentation
Splitting the Control Flow with Boolean Flags Axel Simon Ecole Normale Sup erieure, Paris, France A.Simon@ens.fr July 2008 Axel Simon Splitting the Control Flow with Boolean Flags Good States are Usually Convex Declare C variable int
Axel Simon Splitting the Control Flow with Boolean Flags
11
1 2 3 4 5 6 7 8 9 10
Axel Simon Splitting the Control Flow with Boolean Flags
1 2 3 4 5 6 7 8 9 s-1
Axel Simon Splitting the Control Flow with Boolean Flags
1 2 3 4 5 6 7 8 9 s-1
Axel Simon Splitting the Control Flow with Boolean Flags
1 2 3 4 5 6 7 8 9 s-1
Axel Simon Splitting the Control Flow with Boolean Flags
1 2 3 4 5 6 7 8 9 s-1
Axel Simon Splitting the Control Flow with Boolean Flags
◮ e.g. value of p is expressed by xp ∈ X ◮ let
Axel Simon Splitting the Control Flow with Boolean Flags
◮ e.g. value of p is expressed by xp ∈ X ◮ let
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
1
f d
1 5 9 P P -
+
d=0
Axel Simon Splitting the Control Flow with Boolean Flags
1
f d
1 5 9 P P -
+
d=0
Axel Simon Splitting the Control Flow with Boolean Flags
1
f d
1 5 9 P P -
+
d=0
Axel Simon Splitting the Control Flow with Boolean Flags
◮ ⊓ satisfies P1 ⊓ P2 = S s.th. S ∩ Zn = P1 ∩ P2 ∩ Zn, ◮ P1 and P2 are bounded.
1
f d
1 5 9 P P -
+
d=0
Axel Simon Splitting the Control Flow with Boolean Flags
◮ ⊓ satisfies P1 ⊓ P2 = S s.th. S ∩ Zn = P1 ∩ P2 ∩ Zn, ◮ P1 and P2 are bounded.
1
f d
1 5 P P -
+
d=0 10
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
1 1 x y x⋀y 1 1 x y x⊕y 1 1 x y x⇒y 1 1 x y x⋁y
Axel Simon Splitting the Control Flow with Boolean Flags
1 1 x y x⋀y 1 1 x y x⊕y 1 1 x y x⇒y 1 1 x y x⋁y
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
1
f d
1 5 9 P P -
+
d=0
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
◮ The error traces are infeasible since r = 0 in P ⊓ [
Axel Simon Splitting the Control Flow with Boolean Flags
◮ The error traces are infeasible since r = 0 in P ⊓ [
◮ However, need to re-analyse code between f(&p) and if (r). Axel Simon Splitting the Control Flow with Boolean Flags
◮ The error traces are infeasible since r = 0 in P ⊓ [
◮ However, need to re-analyse code between f(&p) and if (r).
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
Axel Simon Splitting the Control Flow with Boolean Flags
◮ Same calculation, independent of which variable is a pointer. Axel Simon Splitting the Control Flow with Boolean Flags
◮ Same calculation, independent of which variable is a pointer. ◮ if 0 ≤ f e
1 ≤ 1, . . . 0 ≤ f e k ≤ 1: each flag is Boolean
Axel Simon Splitting the Control Flow with Boolean Flags
◮ Same calculation, independent of which variable is a pointer. ◮ if 0 ≤ f e
1 ≤ 1, . . . 0 ≤ f e k ≤ 1: each flag is Boolean
◮ if f e
1 + . . . + f e k ≥ 1: e is not NULL
Axel Simon Splitting the Control Flow with Boolean Flags
◮ Same calculation, independent of which variable is a pointer. ◮ if 0 ≤ f e
1 ≤ 1, . . . 0 ≤ f e k ≤ 1: each flag is Boolean
◮ if f e
1 + . . . + f e k ≥ 1: e is not NULL
◮ if f e
1 + . . . + f e k ≤ 1: e is not the sum of pointers
Axel Simon Splitting the Control Flow with Boolean Flags
◮ but approximation to Z-polyhedra suffice in practice
Axel Simon Splitting the Control Flow with Boolean Flags
◮ but approximation to Z-polyhedra suffice in practice
Axel Simon Splitting the Control Flow with Boolean Flags
Towards Proving the Absence of Buffer Overflow Vulnerabilities Axel Simon
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Axel Simon Splitting the Control Flow with Boolean Flags