S2ss_prop.thy
author chunhan
Thu, 12 Sep 2013 15:17:53 +0800
changeset 44 563194dcdbc6
parent 43 137358bd4921
child 45 d7fab2e2a0b8
permissions -rw-r--r--
s2ss_readfile
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
43
chunhan
parents: 42
diff changeset
    11
lemma co2sobj_some_case:
chunhan
parents: 42
diff changeset
    12
  "\<lbrakk>co2sobj s obj = Some sobj; \<And> p. obj = O_proc p \<Longrightarrow> P (O_proc p);
chunhan
parents: 42
diff changeset
    13
    \<And> f. obj = O_file f \<Longrightarrow> P (O_file f); \<And> h. obj = O_shm h \<Longrightarrow> P (O_shm h);
chunhan
parents: 42
diff changeset
    14
    \<And> f. obj = O_dir f \<Longrightarrow> P (O_dir f); \<And> q. obj = O_msgq q \<Longrightarrow> P (O_msgq q)\<rbrakk>
chunhan
parents: 42
diff changeset
    15
   \<Longrightarrow> P obj"
chunhan
parents: 42
diff changeset
    16
by (case_tac obj, auto)
chunhan
parents: 42
diff changeset
    17
chunhan
parents: 42
diff changeset
    18
lemma co2sobj_execve_alive:
chunhan
parents: 42
diff changeset
    19
  "\<lbrakk>alive s obj; co2sobj s obj = Some x; valid (Execve p f fds # s)\<rbrakk>
chunhan
parents: 42
diff changeset
    20
   \<Longrightarrow> alive (Execve p f fds # s) obj"
chunhan
parents: 42
diff changeset
    21
apply (erule co2sobj_some_case)
chunhan
parents: 42
diff changeset
    22
by (auto simp:alive_simps simp del:alive.simps)
39
13bba99ca090 done with co2sobj_simps
chunhan
parents: 38
diff changeset
    23
33
6884b3c9284b fix bug of static.thy for the static of recvmsg case
chunhan
parents: 32
diff changeset
    24
lemma s2ss_execve:
34
e7f850d1e08e remove O_msg from co2sobj/init_obj2sobj
chunhan
parents: 33
diff changeset
    25
  "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
    26
     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
    27
     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
    28
             Some sp \<Rightarrow> s2ss s \<union> {S_proc sp (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s)}
43
chunhan
parents: 42
diff changeset
    29
           | _ \<Rightarrow> {} )
chunhan
parents: 42
diff changeset
    30
     else (case (cp2sproc (Execve p f fds # s) p, cp2sproc s p) of
chunhan
parents: 42
diff changeset
    31
             (Some sp, Some sp') \<Rightarrow> s2ss s - {S_proc sp' (O_proc p \<in> Tainted s)}
chunhan
parents: 42
diff changeset
    32
                                    \<union> {S_proc sp (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s)}
chunhan
parents: 42
diff changeset
    33
           | _ \<Rightarrow> {} ) )"
35
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
    34
apply (frule vd_cons, frule vt_grant_os, simp split:if_splits)
42
chunhan
parents: 41
diff changeset
    35
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    36
apply (rule conjI, rule impI, (erule exE|erule conjE)+)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    37
apply (frule_tac p = p in current_proc_has_sp, simp, erule exE)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    38
apply (frule_tac p = p' in current_proc_has_sp, simp, erule exE, simp)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    39
apply (subgoal_tac "p \<in> current_procs (Execve p f fds # s)")
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    40
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
    41
apply (erule exE, simp)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    42
apply (simp add:s2ss_def, rule set_eqI, rule iffI)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    43
apply (drule CollectD, (erule exE|erule conjE)+)
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    44
apply (case_tac "obj = O_proc p")
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    45
apply (simp add:co2sobj_execve tainted_eq_Tainted split:if_splits)
42
chunhan
parents: 41
diff changeset
    46
apply (simp add:co2sobj_execve, rule disjI2)
chunhan
parents: 41
diff changeset
    47
apply (rule_tac x = obj in exI, case_tac obj, (simp add:alive_simps)+)[1]
chunhan
parents: 41
diff changeset
    48
apply (simp, erule disjE)
chunhan
parents: 41
diff changeset
    49
apply (rule_tac x = "O_proc p" in exI, simp add:tainted_eq_Tainted)
chunhan
parents: 41
diff changeset
    50
apply (erule exE| erule conjE)+
chunhan
parents: 41
diff changeset
    51
apply (case_tac "x = S_proc sp (O_proc p \<in> tainted s)")
chunhan
parents: 41
diff changeset
    52
apply (rule_tac x = "O_proc p'" in exI)
chunhan
parents: 41
diff changeset
    53
apply (simp add:alive_execve co2sobj_execve tainted_eq_Tainted cp2sproc_execve)
43
chunhan
parents: 42
diff changeset
    54
apply (case_tac "obj = O_proc p", simp)
chunhan
parents: 42
diff changeset
    55
apply (frule co2sobj_execve_alive, simp, simp)
chunhan
parents: 42
diff changeset
    56
apply (frule_tac obj = obj in co2sobj_execve, simp)
chunhan
parents: 42
diff changeset
    57
apply (rule_tac x = obj in exI, simp, simp)
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    58
43
chunhan
parents: 42
diff changeset
    59
apply (erule conjE, frule current_proc_has_sp, simp, erule exE, rule impI, simp)
chunhan
parents: 42
diff changeset
    60
apply (subgoal_tac "p \<in> current_procs (Execve p f fds # s)") 
chunhan
parents: 42
diff changeset
    61
apply (drule_tac p = p and s = "Execve p f fds # s" in current_proc_has_sp, simp)
chunhan
parents: 42
diff changeset
    62
apply (erule exE, erule conjE, simp)
chunhan
parents: 42
diff changeset
    63
apply (simp add:s2ss_def, rule set_eqI, rule iffI)
chunhan
parents: 42
diff changeset
    64
apply (drule CollectD, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
    65
apply (case_tac "obj = O_proc p", simp add:tainted_eq_Tainted)
chunhan
parents: 42
diff changeset
    66
apply (rule disjI1, simp split:if_splits)
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
    67
apply (simp add:co2sobj_execve, rule disjI2)
43
chunhan
parents: 42
diff changeset
    68
apply (rule conjI,rule_tac x = obj in exI, simp add:alive_simps split:t_object.splits)
chunhan
parents: 42
diff changeset
    69
apply (rule notI, simp, case_tac obj)
chunhan
parents: 42
diff changeset
    70
apply (erule_tac x = nat in allE, simp add:tainted_eq_Tainted, (simp split:option.splits)+)
chunhan
parents: 42
diff changeset
    71
apply (erule disjE, simp)
chunhan
parents: 42
diff changeset
    72
apply (rule_tac x = "O_proc p" in exI, simp add:tainted_eq_Tainted)
chunhan
parents: 42
diff changeset
    73
apply (erule exE|erule conjE)+
chunhan
parents: 42
diff changeset
    74
apply (rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
    75
apply (drule_tac obj = obj in co2sobj_execve_alive, simp+)
chunhan
parents: 42
diff changeset
    76
apply (frule_tac obj = obj in co2sobj_execve, simp, simp)
chunhan
parents: 42
diff changeset
    77
apply (rule impI, simp add:tainted_eq_Tainted, simp)
chunhan
parents: 42
diff changeset
    78
done
chunhan
parents: 42
diff changeset
    79
chunhan
parents: 42
diff changeset
    80
lemma s2ss_clone_alive:
chunhan
parents: 42
diff changeset
    81
  "\<lbrakk>co2sobj s obj = Some x; alive s obj; obj \<noteq> O_proc p'; valid (Clone p p' fds shms # s)\<rbrakk>
chunhan
parents: 42
diff changeset
    82
   \<Longrightarrow> alive (Clone p p' fds shms # s) obj"
chunhan
parents: 42
diff changeset
    83
by (erule co2sobj_some_case, auto simp:alive_clone)
chunhan
parents: 42
diff changeset
    84
chunhan
parents: 42
diff changeset
    85
lemma s2ss_clone:
chunhan
parents: 42
diff changeset
    86
  "valid (Clone p p' fds shms # s) \<Longrightarrow> s2ss (Clone p p' fds shms # s) = (
chunhan
parents: 42
diff changeset
    87
     case (cp2sproc (Clone p p' fds shms # s) p') of
chunhan
parents: 42
diff changeset
    88
       Some sp \<Rightarrow> s2ss s \<union> {S_proc sp (O_proc p \<in> Tainted s)}
chunhan
parents: 42
diff changeset
    89
     | _       \<Rightarrow> {})"
chunhan
parents: 42
diff changeset
    90
apply (frule vd_cons, frule vt_grant_os, split option.splits)
chunhan
parents: 42
diff changeset
    91
apply (rule conjI, rule impI, drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
    92
apply (rule allI, rule impI, simp add:s2ss_def)
chunhan
parents: 42
diff changeset
    93
apply (rule set_eqI, rule iffI, drule CollectD, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
    94
apply (case_tac "obj = O_proc p'", simp add:tainted_eq_Tainted)
chunhan
parents: 42
diff changeset
    95
apply (case_tac "O_proc p' \<in> Tainted s", drule Tainted_in_current, simp+)
chunhan
parents: 42
diff changeset
    96
apply (rule disjI1, simp split:if_splits)
chunhan
parents: 42
diff changeset
    97
apply (simp add:tainted_eq_Tainted, rule disjI2)
chunhan
parents: 42
diff changeset
    98
apply (frule co2sobj_clone, simp)
chunhan
parents: 42
diff changeset
    99
apply (rule_tac x = obj in exI, simp add:alive_simps split:t_object.splits)
chunhan
parents: 42
diff changeset
   100
chunhan
parents: 42
diff changeset
   101
apply (simp, erule disjE, simp)
chunhan
parents: 42
diff changeset
   102
apply (rule_tac x = "O_proc p'" in exI, simp add:tainted_eq_Tainted)
chunhan
parents: 42
diff changeset
   103
apply (rule impI, rule notI, drule Tainted_in_current, simp+)
chunhan
parents: 42
diff changeset
   104
apply (erule exE| erule conjE)+
chunhan
parents: 42
diff changeset
   105
apply (case_tac "obj = O_proc p'", simp)
chunhan
parents: 42
diff changeset
   106
apply (rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   107
apply (frule s2ss_clone_alive, simp+)
chunhan
parents: 42
diff changeset
   108
apply (auto simp:co2sobj_clone alive_simps)
chunhan
parents: 42
diff changeset
   109
done
chunhan
parents: 42
diff changeset
   110
chunhan
parents: 42
diff changeset
   111
definition update_s2ss_shm:: "t_state \<Rightarrow> t_process \<Rightarrow> t_static_state" 
chunhan
parents: 42
diff changeset
   112
where
chunhan
parents: 42
diff changeset
   113
  "update_s2ss_shm s pfrom \<equiv> s2ss s 
chunhan
parents: 42
diff changeset
   114
     \<union> {S_proc sp True| sp p. info_flow_shm s pfrom p \<and> cp2sproc s p = Some sp}
chunhan
parents: 42
diff changeset
   115
     - {S_proc sp False | sp p. info_flow_shm s pfrom p \<and> cp2sproc s p = Some sp \<and> 
chunhan
parents: 42
diff changeset
   116
           (\<not> (\<exists> p'. \<not> info_flow_shm s pfrom p' \<and> p' \<in> current_procs s \<and> 
chunhan
parents: 42
diff changeset
   117
                cp2sproc s p' = Some sp \<and> O_proc p' \<notin> Tainted s))}"
chunhan
parents: 42
diff changeset
   118
chunhan
parents: 42
diff changeset
   119
lemma Tainted_ptrace':
chunhan
parents: 42
diff changeset
   120
  "valid s \<Longrightarrow> Tainted (Ptrace p p' # s) = 
chunhan
parents: 42
diff changeset
   121
     (if (O_proc p \<in> Tainted s \<and> O_proc p' \<notin> Tainted s)
chunhan
parents: 42
diff changeset
   122
      then Tainted s \<union> {O_proc p'' | p''. info_flow_shm s p' p''}
chunhan
parents: 42
diff changeset
   123
      else if (O_proc p' \<in> Tainted s \<and> O_proc p \<notin> Tainted s)
chunhan
parents: 42
diff changeset
   124
           then Tainted s \<union> {O_proc p'' | p''. info_flow_shm s p p''}
chunhan
parents: 42
diff changeset
   125
                else Tainted s)"
chunhan
parents: 42
diff changeset
   126
using info_flow_shm_Tainted by auto
chunhan
parents: 42
diff changeset
   127
chunhan
parents: 42
diff changeset
   128
lemma co2sobj_some_caseD:
chunhan
parents: 42
diff changeset
   129
  "\<lbrakk>co2sobj s obj = Some sobj; \<And> p. \<lbrakk>co2sobj s obj = Some sobj; obj = O_proc p\<rbrakk> \<Longrightarrow> P (O_proc p);
chunhan
parents: 42
diff changeset
   130
    \<And> f. \<lbrakk>co2sobj s obj = Some sobj; obj = O_file f\<rbrakk> \<Longrightarrow> P (O_file f); 
chunhan
parents: 42
diff changeset
   131
    \<And> h. \<lbrakk>co2sobj s obj = Some sobj; obj = O_shm h\<rbrakk> \<Longrightarrow> P (O_shm h);
chunhan
parents: 42
diff changeset
   132
    \<And> f. \<lbrakk>co2sobj s obj = Some sobj; obj = O_dir f\<rbrakk> \<Longrightarrow> P (O_dir f); 
chunhan
parents: 42
diff changeset
   133
    \<And> q. \<lbrakk>co2sobj s obj = Some sobj; obj = O_msgq q\<rbrakk> \<Longrightarrow> P (O_msgq q)\<rbrakk>
chunhan
parents: 42
diff changeset
   134
   \<Longrightarrow> P obj"
chunhan
parents: 42
diff changeset
   135
by (case_tac obj, auto)
chunhan
parents: 42
diff changeset
   136
chunhan
parents: 42
diff changeset
   137
lemma s2ss_ptrace1_aux: "x \<notin> {x. P x} \<Longrightarrow> \<not> P x" by simp
chunhan
parents: 42
diff changeset
   138
chunhan
parents: 42
diff changeset
   139
lemma s2ss_ptrace1:
chunhan
parents: 42
diff changeset
   140
  "\<lbrakk>valid (Ptrace p p' # s); O_proc p \<in> Tainted s; O_proc p' \<notin> Tainted s\<rbrakk>
chunhan
parents: 42
diff changeset
   141
   \<Longrightarrow> s2ss (Ptrace p p' # s) = update_s2ss_shm s p'"
chunhan
parents: 42
diff changeset
   142
unfolding update_s2ss_shm_def s2ss_def
chunhan
parents: 42
diff changeset
   143
apply (frule vd_cons, rule set_eqI, rule iffI)
chunhan
parents: 42
diff changeset
   144
apply (drule CollectD, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
   145
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   146
apply (rule DiffI)
chunhan
parents: 42
diff changeset
   147
apply (case_tac "O_proc pa \<in> Tainted s")
chunhan
parents: 42
diff changeset
   148
apply (rule UnI1, simp, rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   149
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   150
apply (case_tac "info_flow_shm s p' pa")
chunhan
parents: 42
diff changeset
   151
apply (rule UnI2, rule CollectI, simp only:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   152
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   153
apply (rule_tac x = a in exI, rule_tac x = pa in exI)
chunhan
parents: 42
diff changeset
   154
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   155
apply (rule UnI1, simp)
chunhan
parents: 42
diff changeset
   156
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   157
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   158
apply (rule notI, clarsimp simp:cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   159
apply (erule_tac x = pa in allE, simp)
chunhan
parents: 42
diff changeset
   160
chunhan
parents: 42
diff changeset
   161
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   162
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   163
apply (simp)
chunhan
parents: 42
diff changeset
   164
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   165
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   166
apply (simp split:option.splits)
chunhan
parents: 42
diff changeset
   167
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   168
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   169
apply (simp split:option.splits)
chunhan
parents: 42
diff changeset
   170
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   171
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   172
apply (simp split:option.splits)
chunhan
parents: 42
diff changeset
   173
chunhan
parents: 42
diff changeset
   174
apply (erule DiffE, drule s2ss_ptrace1_aux, erule UnE)
chunhan
parents: 42
diff changeset
   175
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   176
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   177
apply (case_tac "O_proc pa \<in> Tainted s")
chunhan
parents: 42
diff changeset
   178
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   179
apply (clarsimp simp add:tainted_eq_Tainted cp2sproc_other split:option.splits)
chunhan
parents: 42
diff changeset
   180
apply (case_tac "info_flow_shm s p' pa", simp only:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   181
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   182
apply (drule Meson.not_exD, erule_tac x = a in allE, drule Meson.not_exD, erule_tac x = pa in allE)
chunhan
parents: 42
diff changeset
   183
apply (simp add:tainted_eq_Tainted, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
   184
apply (rule_tac x = "O_proc p'a" in exI)
chunhan
parents: 42
diff changeset
   185
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   186
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   187
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   188
chunhan
parents: 42
diff changeset
   189
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   190
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   191
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   192
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   193
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   194
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   195
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   196
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   197
chunhan
parents: 42
diff changeset
   198
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   199
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   200
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted info_shm_flow_in_procs)
chunhan
parents: 42
diff changeset
   201
done
chunhan
parents: 42
diff changeset
   202
chunhan
parents: 42
diff changeset
   203
lemma s2ss_ptrace2:
chunhan
parents: 42
diff changeset
   204
  "\<lbrakk>valid (Ptrace p p' # s); O_proc p' \<in> Tainted s; O_proc p \<notin> Tainted s\<rbrakk>
chunhan
parents: 42
diff changeset
   205
   \<Longrightarrow> s2ss (Ptrace p p' # s) = update_s2ss_shm s p"
chunhan
parents: 42
diff changeset
   206
unfolding update_s2ss_shm_def s2ss_def
chunhan
parents: 42
diff changeset
   207
apply (frule vd_cons, rule set_eqI, rule iffI)
chunhan
parents: 42
diff changeset
   208
apply (drule CollectD, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
   209
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   210
apply (rule DiffI)
chunhan
parents: 42
diff changeset
   211
apply (case_tac "O_proc pa \<in> Tainted s")
chunhan
parents: 42
diff changeset
   212
apply (rule UnI1, simp, rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   213
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   214
apply (case_tac "info_flow_shm s p pa")
chunhan
parents: 42
diff changeset
   215
apply (rule UnI2, rule CollectI, simp only:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   216
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   217
apply (rule_tac x = a in exI, rule_tac x = pa in exI)
chunhan
parents: 42
diff changeset
   218
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   219
apply (rule UnI1, simp)
chunhan
parents: 42
diff changeset
   220
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   221
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   222
apply (rule notI, clarsimp simp:cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   223
apply (erule_tac x = pa in allE, simp)
chunhan
parents: 42
diff changeset
   224
chunhan
parents: 42
diff changeset
   225
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   226
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   227
apply (simp)
chunhan
parents: 42
diff changeset
   228
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   229
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   230
apply (simp split:option.splits)
chunhan
parents: 42
diff changeset
   231
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   232
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   233
apply (simp split:option.splits)
chunhan
parents: 42
diff changeset
   234
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   235
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   236
apply (simp split:option.splits)
chunhan
parents: 42
diff changeset
   237
chunhan
parents: 42
diff changeset
   238
apply (erule DiffE, drule s2ss_ptrace1_aux, erule UnE)
chunhan
parents: 42
diff changeset
   239
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   240
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   241
apply (case_tac "O_proc pa \<in> Tainted s")
chunhan
parents: 42
diff changeset
   242
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   243
apply (clarsimp simp add:tainted_eq_Tainted cp2sproc_other split:option.splits)
chunhan
parents: 42
diff changeset
   244
apply (case_tac "info_flow_shm s p pa", simp only:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   245
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   246
apply (drule Meson.not_exD, erule_tac x = a in allE, drule Meson.not_exD, erule_tac x = pa in allE)
chunhan
parents: 42
diff changeset
   247
apply (simp add:tainted_eq_Tainted, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
   248
apply (rule_tac x = "O_proc p'a" in exI)
chunhan
parents: 42
diff changeset
   249
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   250
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   251
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   252
chunhan
parents: 42
diff changeset
   253
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   254
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   255
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   256
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   257
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   258
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   259
apply (rule_tac x = obj in exI,
chunhan
parents: 42
diff changeset
   260
       auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1]
chunhan
parents: 42
diff changeset
   261
chunhan
parents: 42
diff changeset
   262
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   263
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   264
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted info_shm_flow_in_procs)
chunhan
parents: 42
diff changeset
   265
done
chunhan
parents: 42
diff changeset
   266
chunhan
parents: 42
diff changeset
   267
lemma s2ss_ptrace3:
chunhan
parents: 42
diff changeset
   268
  "\<lbrakk>valid (Ptrace p p' # s); (O_proc p' \<in> Tainted s) = (O_proc p \<in> Tainted s)\<rbrakk>
chunhan
parents: 42
diff changeset
   269
   \<Longrightarrow> s2ss (Ptrace p p' # s) = s2ss s"
chunhan
parents: 42
diff changeset
   270
unfolding s2ss_def
chunhan
parents: 42
diff changeset
   271
apply (frule vd_cons, rule set_eqI, rule iffI)
chunhan
parents: 42
diff changeset
   272
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   273
apply (rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   274
apply (frule alive_other, simp+)
chunhan
parents: 42
diff changeset
   275
apply (frule_tac obj = obj in co2sobj_ptrace, simp)
chunhan
parents: 42
diff changeset
   276
apply (auto simp add:tainted_eq_Tainted split:t_object.splits option.splits if_splits
chunhan
parents: 42
diff changeset
   277
  intro:info_flow_shm_Tainted)[1]
chunhan
parents: 42
diff changeset
   278
chunhan
parents: 42
diff changeset
   279
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   280
apply (rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   281
apply (frule alive_other, simp+)
chunhan
parents: 42
diff changeset
   282
apply (frule_tac obj = obj in co2sobj_ptrace, simp)
chunhan
parents: 42
diff changeset
   283
apply (auto simp add:tainted_eq_Tainted split:t_object.splits option.splits if_splits 
chunhan
parents: 42
diff changeset
   284
  intro:info_flow_shm_Tainted)
chunhan
parents: 42
diff changeset
   285
done
chunhan
parents: 42
diff changeset
   286
chunhan
parents: 42
diff changeset
   287
lemma s2ss_ptrace:
chunhan
parents: 42
diff changeset
   288
  "valid (Ptrace p p' # s) \<Longrightarrow> s2ss (Ptrace p p' # s) = (
chunhan
parents: 42
diff changeset
   289
     if (O_proc p \<in> Tainted s \<and> O_proc p' \<notin> Tainted s) 
chunhan
parents: 42
diff changeset
   290
     then update_s2ss_shm s p'
chunhan
parents: 42
diff changeset
   291
     else if (O_proc p' \<in> Tainted s \<and> O_proc p \<notin> Tainted s)
chunhan
parents: 42
diff changeset
   292
          then update_s2ss_shm s p
chunhan
parents: 42
diff changeset
   293
          else s2ss s                                   )"
chunhan
parents: 42
diff changeset
   294
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents: 42
diff changeset
   295
apply (simp add:s2ss_ptrace2 s2ss_ptrace1 split:if_splits)
chunhan
parents: 42
diff changeset
   296
by (auto dest:s2ss_ptrace3)
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
   297
43
chunhan
parents: 42
diff changeset
   298
lemma s2ss_kill:
chunhan
parents: 42
diff changeset
   299
  "valid (Kill p p' # s) \<Longrightarrow> s2ss (Kill p p' # s) = (
chunhan
parents: 42
diff changeset
   300
     if (\<exists> p''. p'' \<in> current_procs s \<and> p'' \<noteq> p' \<and> co2sobj s (O_proc p'') = co2sobj s (O_proc p'))
chunhan
parents: 42
diff changeset
   301
     then s2ss s 
chunhan
parents: 42
diff changeset
   302
     else (case (co2sobj s (O_proc p')) of
chunhan
parents: 42
diff changeset
   303
             Some sp \<Rightarrow> s2ss s - {sp}
chunhan
parents: 42
diff changeset
   304
           | _       \<Rightarrow> {}))"
chunhan
parents: 42
diff changeset
   305
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents: 42
diff changeset
   306
unfolding s2ss_def
chunhan
parents: 42
diff changeset
   307
apply (simp split:if_splits, rule conjI)
chunhan
parents: 42
diff changeset
   308
apply (rule impI, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
   309
apply (split option.splits)
chunhan
parents: 42
diff changeset
   310
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   311
apply (simp split: option.splits, (erule conjE)+)
chunhan
parents: 42
diff changeset
   312
apply (rule set_eqI, rule iffI, erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   313
apply (rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   314
apply (simp add:co2sobj_kill tainted_eq_Tainted alive_kill split:t_object.splits if_splits)
chunhan
parents: 42
diff changeset
   315
apply (erule CollectE, erule exE, erule conjE, rule CollectI)
chunhan
parents: 42
diff changeset
   316
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   317
apply (case_tac "pa = p'")
chunhan
parents: 42
diff changeset
   318
apply (rule_tac x = "O_proc p''" in exI)
chunhan
parents: 42
diff changeset
   319
apply (simp add:cp2sproc_kill tainted_eq_Tainted alive_kill
chunhan
parents: 42
diff changeset
   320
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   321
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   322
apply (clarsimp simp add:cp2sproc_kill tainted_eq_Tainted alive_kill
chunhan
parents: 42
diff changeset
   323
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   324
apply (rule_tac x = obj in exI, frule alive_kill, simp add:co2sobj_kill del:co2sobj.simps)+
chunhan
parents: 42
diff changeset
   325
chunhan
parents: 42
diff changeset
   326
apply (rule impI, erule conjE, frule current_proc_has_sp, simp, erule exE, simp)
chunhan
parents: 42
diff changeset
   327
apply (rule set_eqI, rule iffI)
chunhan
parents: 42
diff changeset
   328
apply (erule CollectE, erule exE, erule conjE, rule DiffI)
chunhan
parents: 42
diff changeset
   329
apply (rule CollectI, rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   330
apply (simp add:co2sobj_kill tainted_eq_Tainted alive_kill split:t_object.splits if_splits)
chunhan
parents: 42
diff changeset
   331
apply (rule notI, simp, case_tac obj)
chunhan
parents: 42
diff changeset
   332
apply (erule_tac x = nat in allE)
chunhan
parents: 42
diff changeset
   333
apply (simp add:co2sobj_kill cp2sproc_kill tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   334
apply (simp split:option.splits)+
chunhan
parents: 42
diff changeset
   335
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   336
apply (case_tac "pa = p'")
chunhan
parents: 42
diff changeset
   337
apply (rule_tac x = "O_proc p''" in exI)
chunhan
parents: 42
diff changeset
   338
apply (simp add:cp2sproc_kill tainted_eq_Tainted alive_kill
chunhan
parents: 42
diff changeset
   339
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   340
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   341
apply (clarsimp simp add:cp2sproc_kill tainted_eq_Tainted alive_kill
chunhan
parents: 42
diff changeset
   342
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   343
apply (rule_tac x = obj in exI, frule alive_kill, simp add:co2sobj_kill del:co2sobj.simps)+
chunhan
parents: 42
diff changeset
   344
done
chunhan
parents: 42
diff changeset
   345
chunhan
parents: 42
diff changeset
   346
lemma s2ss_exit:
chunhan
parents: 42
diff changeset
   347
  "valid (Exit p # s) \<Longrightarrow> s2ss (Exit p # s) = (
chunhan
parents: 42
diff changeset
   348
     if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = co2sobj s (O_proc p))
chunhan
parents: 42
diff changeset
   349
     then s2ss s 
chunhan
parents: 42
diff changeset
   350
     else (case (co2sobj s (O_proc p)) of
chunhan
parents: 42
diff changeset
   351
             Some sp \<Rightarrow> s2ss s - {sp}
chunhan
parents: 42
diff changeset
   352
           | _       \<Rightarrow> {}))"
chunhan
parents: 42
diff changeset
   353
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents: 42
diff changeset
   354
unfolding s2ss_def
chunhan
parents: 42
diff changeset
   355
apply (simp split:if_splits, rule conjI)
chunhan
parents: 42
diff changeset
   356
apply (rule impI, (erule exE|erule conjE)+)
chunhan
parents: 42
diff changeset
   357
apply (split option.splits)
chunhan
parents: 42
diff changeset
   358
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   359
apply (simp split: option.splits, (erule conjE)+)
chunhan
parents: 42
diff changeset
   360
apply (rule set_eqI, rule iffI, erule CollectE, (erule exE|erule conjE)+, rule CollectI)
chunhan
parents: 42
diff changeset
   361
apply (rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   362
apply (simp add:co2sobj_exit tainted_eq_Tainted alive_exit split:t_object.splits if_splits)
chunhan
parents: 42
diff changeset
   363
apply (erule CollectE, erule exE, erule conjE, rule CollectI)
chunhan
parents: 42
diff changeset
   364
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   365
apply (case_tac "pa = p")
chunhan
parents: 42
diff changeset
   366
apply (rule_tac x = "O_proc p'" in exI)
chunhan
parents: 42
diff changeset
   367
apply (simp add:cp2sproc_exit tainted_eq_Tainted alive_exit
chunhan
parents: 42
diff changeset
   368
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   369
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   370
apply (clarsimp simp add:cp2sproc_exit tainted_eq_Tainted alive_exit
chunhan
parents: 42
diff changeset
   371
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   372
apply (rule_tac x = obj in exI, frule alive_exit, simp add:co2sobj_exit del:co2sobj.simps)+
chunhan
parents: 42
diff changeset
   373
chunhan
parents: 42
diff changeset
   374
apply (rule impI, frule current_proc_has_sp, simp, erule exE, simp)
chunhan
parents: 42
diff changeset
   375
apply (rule set_eqI, rule iffI)
chunhan
parents: 42
diff changeset
   376
apply (erule CollectE, erule exE, erule conjE, rule DiffI)
chunhan
parents: 42
diff changeset
   377
apply (rule CollectI, rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   378
apply (simp add:co2sobj_exit tainted_eq_Tainted alive_exit split:t_object.splits if_splits)
chunhan
parents: 42
diff changeset
   379
apply (rule notI, simp, case_tac obj)
chunhan
parents: 42
diff changeset
   380
apply (erule_tac x = nat in allE)
chunhan
parents: 42
diff changeset
   381
apply (simp add:co2sobj_exit cp2sproc_exit tainted_eq_Tainted split:option.splits)
chunhan
parents: 42
diff changeset
   382
apply (simp split:option.splits)+
chunhan
parents: 42
diff changeset
   383
apply (erule co2sobj_some_caseD)
chunhan
parents: 42
diff changeset
   384
apply (case_tac "pa = p")
chunhan
parents: 42
diff changeset
   385
apply (rule_tac x = "O_proc p'" in exI)
chunhan
parents: 42
diff changeset
   386
apply (simp add:cp2sproc_exit tainted_eq_Tainted alive_exit
chunhan
parents: 42
diff changeset
   387
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   388
apply (rule_tac x = "O_proc pa" in exI)
chunhan
parents: 42
diff changeset
   389
apply (clarsimp simp add:cp2sproc_exit tainted_eq_Tainted alive_exit
chunhan
parents: 42
diff changeset
   390
  split:t_object.splits if_splits option.splits)
chunhan
parents: 42
diff changeset
   391
apply (rule_tac x = obj in exI, frule alive_exit, simp add:co2sobj_exit del:co2sobj.simps)+
chunhan
parents: 42
diff changeset
   392
done
chunhan
parents: 42
diff changeset
   393
chunhan
parents: 42
diff changeset
   394
lemma alive_has_sobj':
chunhan
parents: 42
diff changeset
   395
  "\<lbrakk>co2sobj s obj = None; valid s\<rbrakk> \<Longrightarrow> \<not> alive s obj"
chunhan
parents: 42
diff changeset
   396
apply (case_tac obj)
chunhan
parents: 42
diff changeset
   397
apply (auto split:option.splits)
chunhan
parents: 42
diff changeset
   398
oops
chunhan
parents: 42
diff changeset
   399
chunhan
parents: 42
diff changeset
   400
declare co2sobj.simps [simp del]
chunhan
parents: 42
diff changeset
   401
chunhan
parents: 42
diff changeset
   402
lemma co2sobj_open_none:
chunhan
parents: 42
diff changeset
   403
  "\<lbrakk>valid (Open p f flag fd None # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Open p f flag fd None # s) obj = (
chunhan
parents: 42
diff changeset
   404
      if (obj = O_proc p) 
chunhan
parents: 42
diff changeset
   405
      then (case (cp2sproc (Open p f flag fd None # s) p) of
chunhan
parents: 42
diff changeset
   406
              Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> Tainted s))
chunhan
parents: 42
diff changeset
   407
           | _       \<Rightarrow> None)
chunhan
parents: 42
diff changeset
   408
      else co2sobj s obj)"
chunhan
parents: 42
diff changeset
   409
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents: 42
diff changeset
   410
apply (frule_tac obj = obj in co2sobj_open, simp add:alive_open)
chunhan
parents: 42
diff changeset
   411
apply (auto split:t_object.splits option.splits dest!:current_proc_has_sp')
chunhan
parents: 42
diff changeset
   412
done
chunhan
parents: 42
diff changeset
   413
chunhan
parents: 42
diff changeset
   414
lemma co2sobj_open_some:
chunhan
parents: 42
diff changeset
   415
  "\<lbrakk>valid (Open p f flag fd (Some i) # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Open p f flag fd (Some i) # s) obj = (
chunhan
parents: 42
diff changeset
   416
      if (obj = O_proc p) 
chunhan
parents: 42
diff changeset
   417
      then (case (cp2sproc (Open p f flag fd (Some i) # s) p) of
chunhan
parents: 42
diff changeset
   418
              Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> Tainted s))
chunhan
parents: 42
diff changeset
   419
           | _       \<Rightarrow> None)
chunhan
parents: 42
diff changeset
   420
      else if (obj = O_file f) 
chunhan
parents: 42
diff changeset
   421
           then (case (cf2sfile (Open p f flag fd (Some i) # s) f) of
chunhan
parents: 42
diff changeset
   422
                   Some sf \<Rightarrow> Some (S_file {sf} (O_proc p \<in> Tainted s))
chunhan
parents: 42
diff changeset
   423
                 | _       \<Rightarrow> None)
chunhan
parents: 42
diff changeset
   424
           else co2sobj s obj)"
chunhan
parents: 42
diff changeset
   425
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents: 42
diff changeset
   426
apply (frule_tac obj = obj in co2sobj_open, simp add:alive_open)
chunhan
parents: 42
diff changeset
   427
apply (auto split:t_object.splits option.splits dest!:current_proc_has_sp')
chunhan
parents: 42
diff changeset
   428
done
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
   429
43
chunhan
parents: 42
diff changeset
   430
lemma alive_co2sobj_some_open_none:
chunhan
parents: 42
diff changeset
   431
  "\<lbrakk>co2sobj s obj = Some sobj; alive s obj; valid (Open p f flag fd None # s)\<rbrakk>
chunhan
parents: 42
diff changeset
   432
   \<Longrightarrow> alive (Open p f flag fd None # s) obj"
chunhan
parents: 42
diff changeset
   433
by (erule co2sobj_some_caseD, auto simp:alive_simps is_file_simps is_dir_simps)
chunhan
parents: 42
diff changeset
   434
chunhan
parents: 42
diff changeset
   435
lemma alive_co2sobj_some_open_none':
chunhan
parents: 42
diff changeset
   436
  "\<lbrakk>co2sobj (Open p f flag fd None # s) obj = Some sobj; alive (Open p f flag fd None # s) obj; 
chunhan
parents: 42
diff changeset
   437
    valid (Open p f flag fd None # s)\<rbrakk> \<Longrightarrow> alive s obj"
chunhan
parents: 42
diff changeset
   438
by (erule co2sobj_some_caseD, auto simp:alive_simps is_file_simps is_dir_simps)
chunhan
parents: 42
diff changeset
   439
chunhan
parents: 42
diff changeset
   440
lemma co2sobj_proc_obj:
chunhan
parents: 42
diff changeset
   441
  "\<lbrakk>co2sobj s obj = Some x; co2sobj s (O_proc p) = Some x\<rbrakk>
chunhan
parents: 42
diff changeset
   442
   \<Longrightarrow> \<exists> p'. obj = O_proc p'"
chunhan
parents: 42
diff changeset
   443
by (case_tac obj, auto simp:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   444
chunhan
parents: 42
diff changeset
   445
lemma s2ss_open_none:
chunhan
parents: 42
diff changeset
   446
  "valid (Open p f flag fd None # s) \<Longrightarrow> s2ss (Open p f flag fd None # s) = (
chunhan
parents: 42
diff changeset
   447
      case (co2sobj s (O_proc p), co2sobj (Open p f flag fd None # s) (O_proc p)) of
chunhan
parents: 42
diff changeset
   448
        (Some sp, Some sp') \<Rightarrow> 
chunhan
parents: 42
diff changeset
   449
           if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp)
chunhan
parents: 42
diff changeset
   450
           then s2ss s \<union> {sp'}
chunhan
parents: 42
diff changeset
   451
           else s2ss s - {sp} \<union> {sp'} 
chunhan
parents: 42
diff changeset
   452
      | _                   \<Rightarrow> {} )"
chunhan
parents: 42
diff changeset
   453
unfolding s2ss_def
chunhan
parents: 42
diff changeset
   454
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents: 42
diff changeset
   455
apply (case_tac "co2sobj s (O_proc p)", simp add:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   456
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   457
apply (case_tac "co2sobj (Open p f flag fd None # s) (O_proc p)")
chunhan
parents: 42
diff changeset
   458
apply (simp add:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   459
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   460
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE, simp)
chunhan
parents: 42
diff changeset
   461
apply (frule_tac obj = obj in alive_co2sobj_some_open_none', simp, simp)
chunhan
parents: 42
diff changeset
   462
apply (rule conjI, rule impI, erule exE, (erule conjE)+)
chunhan
parents: 42
diff changeset
   463
apply (rule Meson.disj_comm, rule disjCI, case_tac "obj = O_proc p", simp)
chunhan
parents: 42
diff changeset
   464
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none)
chunhan
parents: 42
diff changeset
   465
apply (rule impI)
chunhan
parents: 42
diff changeset
   466
apply (case_tac "obj = O_proc p", simp)
chunhan
parents: 42
diff changeset
   467
apply (rule Meson.disj_comm, rule disjCI, rule conjI)
chunhan
parents: 42
diff changeset
   468
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none)
chunhan
parents: 42
diff changeset
   469
apply (simp add:co2sobj_open_none split:option.splits)
chunhan
parents: 42
diff changeset
   470
apply (rule notI)
chunhan
parents: 42
diff changeset
   471
apply (frule co2sobj_proc_obj, simp, erule exE)
chunhan
parents: 42
diff changeset
   472
apply (erule_tac x = p' in allE, simp)
chunhan
parents: 42
diff changeset
   473
chunhan
parents: 42
diff changeset
   474
apply (simp split:if_splits)
chunhan
parents: 42
diff changeset
   475
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp)
chunhan
parents: 42
diff changeset
   476
apply (erule exE, erule conjE, case_tac "obj = O_proc p")
chunhan
parents: 42
diff changeset
   477
apply (rule_tac x = "O_proc p'" in exI, simp add:co2sobj_open_none)
chunhan
parents: 42
diff changeset
   478
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none alive_co2sobj_some_open_none)
chunhan
parents: 42
diff changeset
   479
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp)
chunhan
parents: 42
diff changeset
   480
apply (erule conjE, erule exE, erule conjE, case_tac "obj = O_proc p")
chunhan
parents: 42
diff changeset
   481
apply (rule_tac x = "O_proc p'" in exI, simp add:co2sobj_open_none)
chunhan
parents: 42
diff changeset
   482
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none alive_co2sobj_some_open_none)
chunhan
parents: 42
diff changeset
   483
done
chunhan
parents: 42
diff changeset
   484
chunhan
parents: 42
diff changeset
   485
lemma alive_co2sobj_some_open_some:
chunhan
parents: 42
diff changeset
   486
  "\<lbrakk>alive s obj; valid (Open p f flag fd (Some i) # s)\<rbrakk>
chunhan
parents: 42
diff changeset
   487
   \<Longrightarrow> alive (Open p f flag fd (Some i) # s) obj"
chunhan
parents: 42
diff changeset
   488
by (case_tac obj, auto simp:alive_simps is_file_simps is_dir_simps)
chunhan
parents: 42
diff changeset
   489
chunhan
parents: 42
diff changeset
   490
lemma alive_co2sobj_some_open_some':
chunhan
parents: 42
diff changeset
   491
  "\<lbrakk>co2sobj (Open p f flag fd (Some i) # s) obj = Some sobj; alive (Open p f flag fd (Some i) # s) obj; 
chunhan
parents: 42
diff changeset
   492
    valid (Open p f flag fd (Some i) # s); obj \<noteq> O_file f\<rbrakk> \<Longrightarrow> alive s obj"
chunhan
parents: 42
diff changeset
   493
by (erule co2sobj_some_caseD, auto simp:alive_simps is_file_simps is_dir_simps)
chunhan
parents: 42
diff changeset
   494
chunhan
parents: 42
diff changeset
   495
lemma s2ss_open_some:
chunhan
parents: 42
diff changeset
   496
  "valid (Open p f flag fd (Some i) # s) \<Longrightarrow> s2ss (Open p f flag fd (Some i) # s) = (
chunhan
parents: 42
diff changeset
   497
      case (co2sobj s (O_proc p), co2sobj (Open p f flag fd (Some i) # s) (O_proc p),
chunhan
parents: 42
diff changeset
   498
            co2sobj (Open p f flag fd (Some i) # s) (O_file f)) of
chunhan
parents: 42
diff changeset
   499
        (Some sp, Some sp', Some sf) \<Rightarrow> 
chunhan
parents: 42
diff changeset
   500
           if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp)
chunhan
parents: 42
diff changeset
   501
           then s2ss s \<union> {sp', sf} 
chunhan
parents: 42
diff changeset
   502
           else s2ss s - {sp} \<union> {sp', sf} 
chunhan
parents: 42
diff changeset
   503
      | _                   \<Rightarrow> {} )"
chunhan
parents: 42
diff changeset
   504
unfolding s2ss_def
chunhan
parents: 42
diff changeset
   505
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents: 42
diff changeset
   506
apply (case_tac "co2sobj s (O_proc p)", simp add:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   507
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   508
apply (case_tac "co2sobj (Open p f flag fd (Some i) # s) (O_proc p)")
chunhan
parents: 42
diff changeset
   509
apply (simp add:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   510
apply (drule current_proc_has_sp', simp, simp)
chunhan
parents: 42
diff changeset
   511
apply (case_tac "co2sobj (Open p f flag fd (Some i) # s) (O_file f)")
chunhan
parents: 42
diff changeset
   512
apply (simp add:co2sobj.simps split:option.splits)
chunhan
parents: 42
diff changeset
   513
apply (clarsimp split del:if_splits)
chunhan
parents: 42
diff changeset
   514
chunhan
parents: 42
diff changeset
   515
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE)
chunhan
parents: 42
diff changeset
   516
apply (split if_splits, rule conjI, rule impI, erule exE, erule conjE, erule conjE)
chunhan
parents: 42
diff changeset
   517
apply (case_tac "obj = O_proc p", simp, case_tac "obj = O_file f", simp)
chunhan
parents: 42
diff changeset
   518
apply (rule UnI1, rule CollectI, rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   519
apply (frule_tac obj = obj in alive_co2sobj_some_open_some', simp+)
chunhan
parents: 42
diff changeset
   520
apply (simp add:co2sobj_open split:t_object.splits)
chunhan
parents: 42
diff changeset
   521
apply (rule impI, case_tac "obj = O_proc p", simp, case_tac "obj = O_file f", simp)
chunhan
parents: 42
diff changeset
   522
apply (rule UnI1, rule DiffI, rule CollectI, rule_tac x = obj in exI)
chunhan
parents: 42
diff changeset
   523
apply (frule_tac obj = obj in alive_co2sobj_some_open_some', simp+)
chunhan
parents: 42
diff changeset
   524
apply (simp add:co2sobj_open split:t_object.splits)
chunhan
parents: 42
diff changeset
   525
apply (frule_tac obj = obj in co2sobj_open_some, simp+)
chunhan
parents: 42
diff changeset
   526
apply (simp add:alive_co2sobj_some_open_some', simp)
chunhan
parents: 42
diff changeset
   527
apply (rule notI)
chunhan
parents: 42
diff changeset
   528
apply (frule_tac obj = obj and p = p in co2sobj_proc_obj, simp+, erule exE)
chunhan
parents: 42
diff changeset
   529
apply (erule_tac x = p' in allE, simp)
chunhan
parents: 42
diff changeset
   530
chunhan
parents: 42
diff changeset
   531
apply (simp split:if_splits, erule disjE)
chunhan
parents: 42
diff changeset
   532
apply (rule_tac x = "O_proc p" in exI, simp)
chunhan
parents: 42
diff changeset
   533
apply (erule disjE, rule_tac x = "O_file f" in exI, simp add:is_file_simps)
chunhan
parents: 42
diff changeset
   534
apply (erule exE, erule conjE)
chunhan
parents: 42
diff changeset
   535
apply (case_tac "obj = O_proc p", simp)
chunhan
parents: 42
diff changeset
   536
apply (rule_tac x = "O_proc p'" in exI, simp add:co2sobj_open_some)
chunhan
parents: 42
diff changeset
   537
apply (case_tac "obj = O_file f", simp add:is_file_in_current)
chunhan
parents: 42
diff changeset
   538
apply (rule_tac x = obj in exI, simp add:co2sobj_open_some alive_co2sobj_some_open_some)
chunhan
parents: 42
diff changeset
   539
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp)
chunhan
parents: 42
diff changeset
   540
apply (erule disjE, rule_tac x = "O_file f" in exI, simp add:is_file_simps)
chunhan
parents: 42
diff changeset
   541
apply (erule conjE, erule exE, erule conjE)
chunhan
parents: 42
diff changeset
   542
apply (case_tac "obj = O_proc p", simp)
chunhan
parents: 42
diff changeset
   543
apply (case_tac "obj = O_file f", simp add:is_file_in_current)
chunhan
parents: 42
diff changeset
   544
apply (rule_tac x = obj in exI, simp add:co2sobj_open_some alive_co2sobj_some_open_some)
chunhan
parents: 42
diff changeset
   545
done
chunhan
parents: 42
diff changeset
   546
chunhan
parents: 42
diff changeset
   547
lemma s2ss_open:
chunhan
parents: 42
diff changeset
   548
  "valid (Open p f flag fd opt # s) \<Longrightarrow> s2ss (Open p f flag fd opt # s) = (
chunhan
parents: 42
diff changeset
   549
     if opt = None
chunhan
parents: 42
diff changeset
   550
     then (case (co2sobj s (O_proc p), co2sobj (Open p f flag fd opt # s) (O_proc p)) of
chunhan
parents: 42
diff changeset
   551
        (Some sp, Some sp') \<Rightarrow> 
chunhan
parents: 42
diff changeset
   552
           if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp)
chunhan
parents: 42
diff changeset
   553
           then s2ss s \<union> {sp'}
chunhan
parents: 42
diff changeset
   554
           else s2ss s - {sp} \<union> {sp'} 
chunhan
parents: 42
diff changeset
   555
      | _                   \<Rightarrow> {} )
chunhan
parents: 42
diff changeset
   556
     else (case (co2sobj s (O_proc p), co2sobj (Open p f flag fd opt # s) (O_proc p),
chunhan
parents: 42
diff changeset
   557
            co2sobj (Open p f flag fd opt # s) (O_file f)) of
chunhan
parents: 42
diff changeset
   558
        (Some sp, Some sp', Some sf) \<Rightarrow> 
chunhan
parents: 42
diff changeset
   559
           if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp)
chunhan
parents: 42
diff changeset
   560
           then s2ss s \<union> {sp', sf} 
chunhan
parents: 42
diff changeset
   561
           else s2ss s - {sp} \<union> {sp', sf} 
chunhan
parents: 42
diff changeset
   562
      | _                   \<Rightarrow> {} ) )"
chunhan
parents: 42
diff changeset
   563
apply (case_tac opt)
chunhan
parents: 42
diff changeset
   564
apply (simp add:s2ss_open_some s2ss_open_none)+
chunhan
parents: 42
diff changeset
   565
done
chunhan
parents: 42
diff changeset
   566
44
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   567
lemma s2ss_readfile:
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   568
  "valid (ReadFile p fd # s) \<Longrightarrow> s2ss (ReadFile p fd # s) = (
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   569
     case (file_of_proc_fd s p fd) of 
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   570
       Some f \<Rightarrow> if (O_file f \<in> Tainted s)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   571
                 then update_s2ss_shm s p
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   572
                 else s2ss s
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   573
     | _      \<Rightarrow> {})"
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   574
apply (frule vt_grant_os, frule vd_cons, clarsimp split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   575
apply (rule conjI, rule impI, rule impI, simp)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   576
unfolding update_s2ss_shm_def s2ss_def
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   577
apply (rule set_eqI, rule iffI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   578
apply (drule CollectD, (erule exE|erule conjE)+)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   579
apply (erule co2sobj_some_caseD)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   580
apply (rule DiffI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   581
apply (case_tac "O_proc pa \<in> Tainted s")
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   582
apply (rule UnI1, simp, rule_tac x = "O_proc pa" in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   583
apply (clarsimp simp:cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   584
apply (case_tac "info_flow_shm s p pa")
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   585
apply (rule UnI2, rule CollectI, simp only:co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   586
apply (drule current_proc_has_sp', simp, simp)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   587
apply (rule_tac x = ab in exI, rule_tac x = pa in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   588
apply (clarsimp simp:cp2sproc_other tainted_eq_Tainted split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   589
apply (rule UnI1, simp)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   590
apply (rule_tac x = "O_proc pa" in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   591
apply (clarsimp simp:cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   592
apply (rule notI, clarsimp simp:cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   593
apply (erule_tac x = pa in allE, simp)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   594
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   595
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   596
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   597
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   598
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   599
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   600
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   601
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   602
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   603
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   604
apply (erule DiffE, drule s2ss_ptrace1_aux, erule UnE)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   605
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   606
apply (erule co2sobj_some_caseD)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   607
apply (case_tac "O_proc pa \<in> Tainted s")
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   608
apply (rule_tac x = "O_proc pa" in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   609
apply (clarsimp simp:tainted_eq_Tainted cp2sproc_other co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   610
apply (case_tac "info_flow_shm s p pa", simp only:co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   611
apply (drule current_proc_has_sp', simp, simp)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   612
apply (drule Meson.not_exD, erule_tac x = ab in allE, drule Meson.not_exD, erule_tac x = pa in allE)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   613
apply (simp add:tainted_eq_Tainted, (erule exE|erule conjE)+)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   614
apply (rule_tac x = "O_proc p'" in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   615
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   616
apply (rule_tac x = "O_proc pa" in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   617
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   618
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   619
apply (rule_tac x = obj in exI,
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   620
       auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1]
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   621
apply (rule_tac x = obj in exI,
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   622
       auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1]
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   623
apply (rule_tac x = obj in exI,
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   624
       auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1]
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   625
apply (rule_tac x = obj in exI,
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   626
       auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1]
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   627
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   628
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   629
apply (rule_tac x = "O_proc pa" in exI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   630
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted info_shm_flow_in_procs co2sobj.simps)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   631
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   632
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   633
apply (rule impI, rule impI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   634
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE, rule CollectI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   635
apply (rule_tac x = obj in exI, simp add:alive_simps co2sobj_readfile split:t_object.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   636
apply (erule CollectE, erule exE, erule conjE, rule CollectI)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   637
apply (rule_tac x = obj in exI, simp add:alive_simps)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   638
apply (drule_tac obj = obj in co2sobj_readfile, simp)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   639
apply (simp split:t_object.splits)
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   640
apply (simp add:co2sobj.simps)+
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   641
done
41
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
   642
db15ef2ee18c fixed bugs in co2sobj
chunhan
parents: 39
diff changeset
   643
43
chunhan
parents: 42
diff changeset
   644
lemmas s2ss_simps = s2ss_execve s2ss_clone s2ss_ptrace s2ss_kill s2ss_exit s2ss_open
44
563194dcdbc6 s2ss_readfile
chunhan
parents: 43
diff changeset
   645
  s2ss_readfile
35
f2e620d799cf in the middle of building simpset for co2sobj, therefore we can deal with s2ss
chunhan
parents: 34
diff changeset
   646