S2ss_prop.thy
author chunhan
Thu, 05 Sep 2013 13:23:03 +0800
changeset 42 021672ec28f5
parent 41 db15ef2ee18c
child 43 137358bd4921
permissions -rw-r--r--
update
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32
705e1e41faf7 add event-trace simpset for s2ss
chunhan
parents:
diff changeset
     1
(*<*)
705e1e41faf7 add event-trace simpset for s2ss
chunhan
parents:
diff changeset
     2
theory S2ss_prop
705e1e41faf7 add event-trace simpset for s2ss
chunhan
parents:
diff changeset
     3
imports Main Flask Flask_type Static Static_type Init_prop Tainted_prop Valid_prop Alive_prop Co2sobj_prop
705e1e41faf7 add event-trace simpset for s2ss
chunhan
parents:
diff changeset
     4
begin
705e1e41faf7 add event-trace simpset for s2ss
chunhan
parents:
diff changeset
     5
(*>*)
705e1e41faf7 add event-trace simpset for s2ss
chunhan
parents:
diff changeset
     6
33
6884b3c9284b fix bug of static.thy for the static of recvmsg case
chunhan
parents: 32
diff changeset
     7
context tainting_s begin
6884b3c9284b fix bug of static.thy for the static of recvmsg case
chunhan
parents: 32
diff changeset
     8
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
     9
(* simpset for s2ss*)
39
13bba99ca090 done with co2sobj_simps
chunhan
parents: 38
diff changeset
    10
13bba99ca090 done with co2sobj_simps
chunhan
parents: 38
diff changeset
    11
33
6884b3c9284b fix bug of static.thy for the static of recvmsg case
chunhan
parents: 32
diff changeset
    12
lemma s2ss_execve:
34
e7f850d1e08e remove O_msg from co2sobj/init_obj2sobj
chunhan
parents: 33
diff changeset
    13
  "valid (Execve p f fds # s) \<Longrightarrow> s2ss (Execve p f fds # s) = (
e7f850d1e08e remove O_msg from co2sobj/init_obj2sobj
chunhan
parents: 33
diff changeset
    14
     if (\<exists> p'. p' \<noteq> p \<and> p' \<in> current_procs s \<and> co2sobj s (O_proc p') = co2sobj s (O_proc p))
35
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    15
     then (case (cp2sproc (Execve p f fds # s) p) of
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    16
             Some sp \<Rightarrow> s2ss s \<union> {S_proc sp (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s)}
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    17
           | _ \<Rightarrow> s2ss s)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    18
     else (case (cp2sproc (Execve p f fds # s) p) of
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    19
             Some sp \<Rightarrow> s2ss s - {S_proc sp (O_proc p \<in> Tainted s)}
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    20
                              \<union> {S_proc sp (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s)}
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    21
           | _ \<Rightarrow> s2ss s) )"
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    22
apply (frule vd_cons, frule vt_grant_os, simp split:if_splits)
42
chunhan
parents: 41
diff changeset
    23
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    24
apply (rule conjI, rule impI, (erule exE|erule conjE)+)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    25
apply (frule_tac p = p in current_proc_has_sp, simp, erule exE)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    26
apply (frule_tac p = p' in current_proc_has_sp, simp, erule exE, simp)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    27
apply (subgoal_tac "p \<in> current_procs (Execve p f fds # s)")
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    28
apply (drule_tac p = p and s = "Execve p f fds # s" in current_proc_has_sp, simp)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    29
apply (erule exE, simp)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    30
apply (simp add:s2ss_def, rule set_eqI, rule iffI)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    31
apply (drule CollectD, (erule exE|erule conjE)+)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    32
apply (case_tac "obj = O_proc p")
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    33
apply (simp add:co2sobj_execve tainted_eq_Tainted split:if_splits)
42
chunhan
parents: 41
diff changeset
    34
apply (simp add:co2sobj_execve, rule disjI2)
chunhan
parents: 41
diff changeset
    35
apply (rule_tac x = obj in exI, case_tac obj, (simp add:alive_simps)+)[1]
chunhan
parents: 41
diff changeset
    36
apply (simp, erule disjE)
chunhan
parents: 41
diff changeset
    37
apply (rule_tac x = "O_proc p" in exI, simp add:tainted_eq_Tainted)
chunhan
parents: 41
diff changeset
    38
apply (erule exE| erule conjE)+
chunhan
parents: 41
diff changeset
    39
apply (case_tac "x = S_proc sp (O_proc p \<in> tainted s)")
chunhan
parents: 41
diff changeset
    40
apply (rule_tac x = "O_proc p'" in exI)
chunhan
parents: 41
diff changeset
    41
apply (simp add:alive_execve co2sobj_execve tainted_eq_Tainted cp2sproc_execve)
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    42
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    43
apply (case_tac obj, simp_all add:co2sobj_execve alive_simps)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    44
thm alive_execve
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    45
thm co2sobj_execve
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    46
apply (simp add:co2sobj_execve, rule disjI2)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    47
apply (rule_tac x = obj in exI, simp split:t_object.splits)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    48
thm co2sobj_execve
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    49
apply (case_tac obj, auto simp:co2sobj_execve alive_simps tainted_eq_Tainted split:option.splits dest!:current_proc_has_sp')[1]
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    50
apply (simp add:co2sobj_execve)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    51
apply clarsimp
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    52
thm current_proc_has_sp
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    53
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    54
apply (auto simp:s2ss_def co2sobj_execve split:option.splits)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    55
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    56
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    57
35
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    58
apply (rule conjI, clarify)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    59
apply (frule_tac p = p in current_proc_has_sp, simp, erule exE)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    60
apply (frule_tac p = p' in current_proc_has_sp, simp, erule exE)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    61
apply (simp, (erule conjE)+)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    62
apply (split option.splits, rule conjI, rule impI, drule current_proc_has_sp', simp, simp)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    63
apply (rule allI, rule impI)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    64
apply (rule set_eqI, rule iffI)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    65
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    66
apply (simp split:option.splits)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    67
apply (frule_tac p = p and s = "Execve p f fds # s" in current_proc_has_sp)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    68
thm current_proc_has_sp
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    69
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    70
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    71
apply (simp split:option.splits)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    72
apply (drule current_proc_has_sp', simp, simp)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    73
apply (rule conjI, rule impI, drule current_proc_has_sp', simp, simp)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    74
apply (simp add:s2ss_def)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    75
apply (rule allI|rule impI)+
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    76
apply (rule set_eqI, rule iffI)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    77
apply (auto simp:alive_simps)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    78
apply (case_tac obj, auto split:option.splits simp:cp2sproc_execve)
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    79
apply (auto split:if_splits)