author | chunhan |
Wed, 30 Oct 2013 08:18:40 +0800 | |
changeset 65 | 6f9a588bcfc4 |
parent 57 | d7cb2fb2e3b4 |
permissions | -rw-r--r-- |
32 | 1 |
(*<*) |
2 |
theory S2ss_prop |
|
3 |
imports Main Flask Flask_type Static Static_type Init_prop Tainted_prop Valid_prop Alive_prop Co2sobj_prop |
|
4 |
begin |
|
5 |
(*>*) |
|
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 | 9 |
(* simpset for s2ss*) |
39 | 10 |
|
43 | 11 |
lemma co2sobj_some_case: |
12 |
"\<lbrakk>co2sobj s obj = Some sobj; \<And> p. obj = O_proc p \<Longrightarrow> P (O_proc p); |
|
13 |
\<And> f. obj = O_file f \<Longrightarrow> P (O_file f); \<And> h. obj = O_shm h \<Longrightarrow> P (O_shm h); |
|
14 |
\<And> f. obj = O_dir f \<Longrightarrow> P (O_dir f); \<And> q. obj = O_msgq q \<Longrightarrow> P (O_msgq q)\<rbrakk> |
|
15 |
\<Longrightarrow> P obj" |
|
16 |
by (case_tac obj, auto) |
|
17 |
||
18 |
lemma co2sobj_execve_alive: |
|
19 |
"\<lbrakk>alive s obj; co2sobj s obj = Some x; valid (Execve p f fds # s)\<rbrakk> |
|
20 |
\<Longrightarrow> alive (Execve p f fds # s) obj" |
|
21 |
apply (erule co2sobj_some_case) |
|
22 |
by (auto simp:alive_simps simp del:alive.simps) |
|
39 | 23 |
|
33
6884b3c9284b
fix bug of static.thy for the static of recvmsg case
chunhan
parents:
32
diff
changeset
|
24 |
lemma s2ss_execve: |
34 | 25 |
"valid (Execve p f fds # s) \<Longrightarrow> s2ss (Execve p f fds # s) = ( |
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 | 29 |
| _ \<Rightarrow> {} ) |
30 |
else (case (cp2sproc (Execve p f fds # s) p, cp2sproc s p) of |
|
31 |
(Some sp, Some sp') \<Rightarrow> s2ss s - {S_proc sp' (O_proc p \<in> Tainted s)} |
|
32 |
\<union> {S_proc sp (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s)} |
|
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 | 35 |
|
41 | 36 |
apply (rule conjI, rule impI, (erule exE|erule conjE)+) |
37 |
apply (frule_tac p = p in current_proc_has_sp, simp, erule exE) |
|
38 |
apply (frule_tac p = p' in current_proc_has_sp, simp, erule exE, simp) |
|
39 |
apply (subgoal_tac "p \<in> current_procs (Execve p f fds # s)") |
|
40 |
apply (drule_tac p = p and s = "Execve p f fds # s" in current_proc_has_sp, simp) |
|
41 |
apply (erule exE, simp) |
|
42 |
apply (simp add:s2ss_def, rule set_eqI, rule iffI) |
|
43 |
apply (drule CollectD, (erule exE|erule conjE)+) |
|
44 |
apply (case_tac "obj = O_proc p") |
|
45 |
apply (simp add:co2sobj_execve tainted_eq_Tainted split:if_splits) |
|
42 | 46 |
apply (simp add:co2sobj_execve, rule disjI2) |
47 |
apply (rule_tac x = obj in exI, case_tac obj, (simp add:alive_simps)+)[1] |
|
48 |
apply (simp, erule disjE) |
|
49 |
apply (rule_tac x = "O_proc p" in exI, simp add:tainted_eq_Tainted) |
|
50 |
apply (erule exE| erule conjE)+ |
|
51 |
apply (case_tac "x = S_proc sp (O_proc p \<in> tainted s)") |
|
52 |
apply (rule_tac x = "O_proc p'" in exI) |
|
53 |
apply (simp add:alive_execve co2sobj_execve tainted_eq_Tainted cp2sproc_execve) |
|
43 | 54 |
apply (case_tac "obj = O_proc p", simp) |
55 |
apply (frule co2sobj_execve_alive, simp, simp) |
|
56 |
apply (frule_tac obj = obj in co2sobj_execve, simp) |
|
57 |
apply (rule_tac x = obj in exI, simp, simp) |
|
41 | 58 |
|
43 | 59 |
apply (erule conjE, frule current_proc_has_sp, simp, erule exE, rule impI, simp) |
60 |
apply (subgoal_tac "p \<in> current_procs (Execve p f fds # s)") |
|
61 |
apply (drule_tac p = p and s = "Execve p f fds # s" in current_proc_has_sp, simp) |
|
62 |
apply (erule exE, erule conjE, simp) |
|
63 |
apply (simp add:s2ss_def, rule set_eqI, rule iffI) |
|
64 |
apply (drule CollectD, (erule exE|erule conjE)+) |
|
65 |
apply (case_tac "obj = O_proc p", simp add:tainted_eq_Tainted) |
|
66 |
apply (rule disjI1, simp split:if_splits) |
|
41 | 67 |
apply (simp add:co2sobj_execve, rule disjI2) |
43 | 68 |
apply (rule conjI,rule_tac x = obj in exI, simp add:alive_simps split:t_object.splits) |
69 |
apply (rule notI, simp, case_tac obj) |
|
70 |
apply (erule_tac x = nat in allE, simp add:tainted_eq_Tainted, (simp split:option.splits)+) |
|
71 |
apply (erule disjE, simp) |
|
72 |
apply (rule_tac x = "O_proc p" in exI, simp add:tainted_eq_Tainted) |
|
73 |
apply (erule exE|erule conjE)+ |
|
74 |
apply (rule_tac x = obj in exI) |
|
75 |
apply (drule_tac obj = obj in co2sobj_execve_alive, simp+) |
|
76 |
apply (frule_tac obj = obj in co2sobj_execve, simp, simp) |
|
77 |
apply (rule impI, simp add:tainted_eq_Tainted, simp) |
|
78 |
done |
|
79 |
||
80 |
lemma s2ss_clone_alive: |
|
81 |
"\<lbrakk>co2sobj s obj = Some x; alive s obj; obj \<noteq> O_proc p'; valid (Clone p p' fds shms # s)\<rbrakk> |
|
82 |
\<Longrightarrow> alive (Clone p p' fds shms # s) obj" |
|
83 |
by (erule co2sobj_some_case, auto simp:alive_clone) |
|
84 |
||
85 |
lemma s2ss_clone: |
|
86 |
"valid (Clone p p' fds shms # s) \<Longrightarrow> s2ss (Clone p p' fds shms # s) = ( |
|
87 |
case (cp2sproc (Clone p p' fds shms # s) p') of |
|
88 |
Some sp \<Rightarrow> s2ss s \<union> {S_proc sp (O_proc p \<in> Tainted s)} |
|
89 |
| _ \<Rightarrow> {})" |
|
90 |
apply (frule vd_cons, frule vt_grant_os, split option.splits) |
|
91 |
apply (rule conjI, rule impI, drule current_proc_has_sp', simp, simp) |
|
92 |
apply (rule allI, rule impI, simp add:s2ss_def) |
|
93 |
apply (rule set_eqI, rule iffI, drule CollectD, (erule exE|erule conjE)+) |
|
94 |
apply (case_tac "obj = O_proc p'", simp add:tainted_eq_Tainted) |
|
95 |
apply (case_tac "O_proc p' \<in> Tainted s", drule Tainted_in_current, simp+) |
|
96 |
apply (rule disjI1, simp split:if_splits) |
|
97 |
apply (simp add:tainted_eq_Tainted, rule disjI2) |
|
98 |
apply (frule co2sobj_clone, simp) |
|
99 |
apply (rule_tac x = obj in exI, simp add:alive_simps split:t_object.splits) |
|
100 |
||
101 |
apply (simp, erule disjE, simp) |
|
102 |
apply (rule_tac x = "O_proc p'" in exI, simp add:tainted_eq_Tainted) |
|
103 |
apply (rule impI, rule notI, drule Tainted_in_current, simp+) |
|
104 |
apply (erule exE| erule conjE)+ |
|
105 |
apply (case_tac "obj = O_proc p'", simp) |
|
106 |
apply (rule_tac x = obj in exI) |
|
107 |
apply (frule s2ss_clone_alive, simp+) |
|
108 |
apply (auto simp:co2sobj_clone alive_simps) |
|
109 |
done |
|
110 |
||
54 | 111 |
definition s2ss_shm_no_backup:: "t_state \<Rightarrow> t_process \<Rightarrow> t_static_state" |
112 |
where |
|
113 |
"s2ss_shm_no_backup s pfrom \<equiv> {S_proc sp False | sp p. info_flow_shm s pfrom p \<and> cp2sproc s p = Some sp \<and> |
|
114 |
(\<not> (\<exists> p'. \<not> info_flow_shm s pfrom p' \<and> p' \<in> current_procs s \<and> co2sobj s (O_proc p') = Some (S_proc sp False)))}" |
|
115 |
||
43 | 116 |
definition update_s2ss_shm:: "t_state \<Rightarrow> t_process \<Rightarrow> t_static_state" |
117 |
where |
|
118 |
"update_s2ss_shm s pfrom \<equiv> s2ss s |
|
119 |
\<union> {S_proc sp True| sp p. info_flow_shm s pfrom p \<and> cp2sproc s p = Some sp} |
|
54 | 120 |
- (s2ss_shm_no_backup s pfrom)" |
121 |
||
122 |
lemma s2ss_shm_no_bk_elim: |
|
123 |
"\<lbrakk>S_proc sp False \<notin> s2ss_shm_no_backup s pfrom; co2sobj s (O_proc p) = Some (S_proc sp False); |
|
124 |
valid s; info_flow_shm s pfrom p\<rbrakk> |
|
125 |
\<Longrightarrow> \<exists> p'. \<not> info_flow_shm s pfrom p' \<and> p' \<in> current_procs s \<and> co2sobj s (O_proc p') = Some (S_proc sp False)" |
|
126 |
apply (auto simp:s2ss_shm_no_backup_def co2sobj.simps tainted_eq_Tainted split:option.splits) |
|
127 |
apply (erule_tac x = p in allE, auto) |
|
128 |
apply (rule_tac x = p' in exI, auto) |
|
129 |
done |
|
130 |
||
131 |
lemma s2ss_shm_no_bk_intro1: |
|
132 |
"\<lbrakk>co2sobj s' obj = Some x; \<forall> p. obj \<noteq> O_proc p\<rbrakk> \<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom" |
|
133 |
apply (case_tac obj) |
|
134 |
apply (auto simp:co2sobj.simps s2ss_shm_no_backup_def split:option.splits) |
|
135 |
done |
|
136 |
||
137 |
lemma s2ss_shm_no_bk_intro2: |
|
138 |
"\<lbrakk>co2sobj s' obj = Some x; obj \<in> Tainted s'; valid s'\<rbrakk> \<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom" |
|
139 |
apply (case_tac obj) |
|
140 |
||
141 |
apply (auto simp:co2sobj.simps s2ss_shm_no_backup_def tainted_eq_Tainted split:option.splits) |
|
142 |
done |
|
143 |
||
144 |
lemma s2ss_shm_no_bk_intro3: |
|
145 |
"\<lbrakk>co2sobj s (O_proc p) = Some x; \<not> info_flow_shm s pfrom p; p \<in> current_procs s |
|
146 |
\<rbrakk> \<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom" |
|
147 |
apply (auto simp add:s2ss_shm_no_backup_def split:option.splits) |
|
148 |
apply (rule_tac x = p in exI, simp) |
|
149 |
done |
|
150 |
||
151 |
lemma s2ss_shm_no_bk_intro4: |
|
152 |
"\<lbrakk>co2sobj s (O_proc p) = Some x; info_flow_shm s pfrom p; |
|
153 |
\<not> info_flow_shm s pfrom p'; p' \<in> current_procs s; co2sobj s (O_proc p') = Some x\<rbrakk> |
|
154 |
\<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom" |
|
155 |
apply (rule notI) |
|
156 |
apply (auto simp add:s2ss_shm_no_backup_def co2sobj.simps split:option.splits) |
|
157 |
done |
|
43 | 158 |
|
159 |
lemma Tainted_ptrace': |
|
160 |
"valid s \<Longrightarrow> Tainted (Ptrace p p' # s) = |
|
161 |
(if (O_proc p \<in> Tainted s \<and> O_proc p' \<notin> Tainted s) |
|
162 |
then Tainted s \<union> {O_proc p'' | p''. info_flow_shm s p' p''} |
|
163 |
else if (O_proc p' \<in> Tainted s \<and> O_proc p \<notin> Tainted s) |
|
164 |
then Tainted s \<union> {O_proc p'' | p''. info_flow_shm s p p''} |
|
165 |
else Tainted s)" |
|
166 |
using info_flow_shm_Tainted by auto |
|
167 |
||
168 |
lemma co2sobj_some_caseD: |
|
169 |
"\<lbrakk>co2sobj s obj = Some sobj; \<And> p. \<lbrakk>co2sobj s obj = Some sobj; obj = O_proc p\<rbrakk> \<Longrightarrow> P (O_proc p); |
|
170 |
\<And> f. \<lbrakk>co2sobj s obj = Some sobj; obj = O_file f\<rbrakk> \<Longrightarrow> P (O_file f); |
|
171 |
\<And> h. \<lbrakk>co2sobj s obj = Some sobj; obj = O_shm h\<rbrakk> \<Longrightarrow> P (O_shm h); |
|
172 |
\<And> f. \<lbrakk>co2sobj s obj = Some sobj; obj = O_dir f\<rbrakk> \<Longrightarrow> P (O_dir f); |
|
173 |
\<And> q. \<lbrakk>co2sobj s obj = Some sobj; obj = O_msgq q\<rbrakk> \<Longrightarrow> P (O_msgq q)\<rbrakk> |
|
174 |
\<Longrightarrow> P obj" |
|
175 |
by (case_tac obj, auto) |
|
176 |
||
177 |
lemma s2ss_ptrace1_aux: "x \<notin> {x. P x} \<Longrightarrow> \<not> P x" by simp |
|
178 |
||
179 |
lemma s2ss_ptrace1: |
|
180 |
"\<lbrakk>valid (Ptrace p p' # s); O_proc p \<in> Tainted s; O_proc p' \<notin> Tainted s\<rbrakk> |
|
181 |
\<Longrightarrow> s2ss (Ptrace p p' # s) = update_s2ss_shm s p'" |
|
54 | 182 |
unfolding update_s2ss_shm_def s2ss_def s2ss_shm_no_backup_def |
43 | 183 |
apply (frule vd_cons, rule set_eqI, rule iffI) |
184 |
apply (drule CollectD, (erule exE|erule conjE)+) |
|
185 |
apply (erule co2sobj_some_caseD) |
|
186 |
apply (rule DiffI) |
|
187 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
188 |
apply (rule UnI1, simp, rule_tac x = "O_proc pa" in exI) |
|
189 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
190 |
apply (case_tac "info_flow_shm s p' pa") |
|
191 |
apply (rule UnI2, rule CollectI, simp only:co2sobj.simps split:option.splits) |
|
192 |
apply (drule current_proc_has_sp', simp, simp) |
|
193 |
apply (rule_tac x = a in exI, rule_tac x = pa in exI) |
|
194 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
195 |
apply (rule UnI1, simp) |
|
196 |
apply (rule_tac x = "O_proc pa" in exI) |
|
197 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
198 |
apply (rule notI, clarsimp simp:cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
199 |
apply (erule_tac x = pa in allE, simp) |
|
200 |
||
201 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
202 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
203 |
apply (simp) |
|
204 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
205 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
206 |
apply (simp split:option.splits) |
|
207 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
208 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
209 |
apply (simp split:option.splits) |
|
210 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
211 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
212 |
apply (simp split:option.splits) |
|
213 |
||
214 |
apply (erule DiffE, drule s2ss_ptrace1_aux, erule UnE) |
|
215 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
216 |
apply (erule co2sobj_some_caseD) |
|
217 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
218 |
apply (rule_tac x = "O_proc pa" in exI) |
|
219 |
apply (clarsimp simp add:tainted_eq_Tainted cp2sproc_other split:option.splits) |
|
220 |
apply (case_tac "info_flow_shm s p' pa", simp only:co2sobj.simps split:option.splits) |
|
221 |
apply (drule current_proc_has_sp', simp, simp) |
|
222 |
apply (drule Meson.not_exD, erule_tac x = a in allE, drule Meson.not_exD, erule_tac x = pa in allE) |
|
223 |
apply (simp add:tainted_eq_Tainted, (erule exE|erule conjE)+) |
|
224 |
apply (rule_tac x = "O_proc p'a" in exI) |
|
225 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
226 |
apply (rule_tac x = "O_proc pa" in exI) |
|
227 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
228 |
||
229 |
apply (rule_tac x = obj in exI, |
|
230 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
231 |
apply (rule_tac x = obj in exI, |
|
232 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
233 |
apply (rule_tac x = obj in exI, |
|
234 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
235 |
apply (rule_tac x = obj in exI, |
|
236 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
237 |
||
238 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
239 |
apply (rule_tac x = "O_proc pa" in exI) |
|
240 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted info_shm_flow_in_procs) |
|
241 |
done |
|
242 |
||
243 |
lemma s2ss_ptrace2: |
|
244 |
"\<lbrakk>valid (Ptrace p p' # s); O_proc p' \<in> Tainted s; O_proc p \<notin> Tainted s\<rbrakk> |
|
245 |
\<Longrightarrow> s2ss (Ptrace p p' # s) = update_s2ss_shm s p" |
|
54 | 246 |
unfolding update_s2ss_shm_def s2ss_def s2ss_shm_no_backup_def |
43 | 247 |
apply (frule vd_cons, rule set_eqI, rule iffI) |
248 |
apply (drule CollectD, (erule exE|erule conjE)+) |
|
249 |
apply (erule co2sobj_some_caseD) |
|
250 |
apply (rule DiffI) |
|
251 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
252 |
apply (rule UnI1, simp, rule_tac x = "O_proc pa" in exI) |
|
253 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
254 |
apply (case_tac "info_flow_shm s p pa") |
|
255 |
apply (rule UnI2, rule CollectI, simp only:co2sobj.simps split:option.splits) |
|
256 |
apply (drule current_proc_has_sp', simp, simp) |
|
257 |
apply (rule_tac x = a in exI, rule_tac x = pa in exI) |
|
258 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
259 |
apply (rule UnI1, simp) |
|
260 |
apply (rule_tac x = "O_proc pa" in exI) |
|
261 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
262 |
apply (rule notI, clarsimp simp:cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
263 |
apply (erule_tac x = pa in allE, simp) |
|
264 |
||
265 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
266 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
267 |
apply (simp) |
|
268 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
269 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
270 |
apply (simp split:option.splits) |
|
271 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
272 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
273 |
apply (simp split:option.splits) |
|
274 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI, |
|
275 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
276 |
apply (simp split:option.splits) |
|
277 |
||
278 |
apply (erule DiffE, drule s2ss_ptrace1_aux, erule UnE) |
|
279 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
280 |
apply (erule co2sobj_some_caseD) |
|
281 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
282 |
apply (rule_tac x = "O_proc pa" in exI) |
|
283 |
apply (clarsimp simp add:tainted_eq_Tainted cp2sproc_other split:option.splits) |
|
284 |
apply (case_tac "info_flow_shm s p pa", simp only:co2sobj.simps split:option.splits) |
|
285 |
apply (drule current_proc_has_sp', simp, simp) |
|
286 |
apply (drule Meson.not_exD, erule_tac x = a in allE, drule Meson.not_exD, erule_tac x = pa in allE) |
|
287 |
apply (simp add:tainted_eq_Tainted, (erule exE|erule conjE)+) |
|
288 |
apply (rule_tac x = "O_proc p'a" in exI) |
|
289 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
290 |
apply (rule_tac x = "O_proc pa" in exI) |
|
291 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
292 |
||
293 |
apply (rule_tac x = obj in exI, |
|
294 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
295 |
apply (rule_tac x = obj in exI, |
|
296 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
297 |
apply (rule_tac x = obj in exI, |
|
298 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
299 |
apply (rule_tac x = obj in exI, |
|
300 |
auto split:option.splits simp:co2sobj_ptrace alive_simps simp del:co2sobj.simps)[1] |
|
301 |
||
302 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
303 |
apply (rule_tac x = "O_proc pa" in exI) |
|
304 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted info_shm_flow_in_procs) |
|
305 |
done |
|
306 |
||
307 |
lemma s2ss_ptrace3: |
|
308 |
"\<lbrakk>valid (Ptrace p p' # s); (O_proc p' \<in> Tainted s) = (O_proc p \<in> Tainted s)\<rbrakk> |
|
309 |
\<Longrightarrow> s2ss (Ptrace p p' # s) = s2ss s" |
|
310 |
unfolding s2ss_def |
|
311 |
apply (frule vd_cons, rule set_eqI, rule iffI) |
|
312 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
313 |
apply (rule_tac x = obj in exI) |
|
314 |
apply (frule alive_other, simp+) |
|
315 |
apply (frule_tac obj = obj in co2sobj_ptrace, simp) |
|
316 |
apply (auto simp add:tainted_eq_Tainted split:t_object.splits option.splits if_splits |
|
317 |
intro:info_flow_shm_Tainted)[1] |
|
318 |
||
319 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
320 |
apply (rule_tac x = obj in exI) |
|
321 |
apply (frule alive_other, simp+) |
|
322 |
apply (frule_tac obj = obj in co2sobj_ptrace, simp) |
|
323 |
apply (auto simp add:tainted_eq_Tainted split:t_object.splits option.splits if_splits |
|
324 |
intro:info_flow_shm_Tainted) |
|
325 |
done |
|
326 |
||
327 |
lemma s2ss_ptrace: |
|
328 |
"valid (Ptrace p p' # s) \<Longrightarrow> s2ss (Ptrace p p' # s) = ( |
|
329 |
if (O_proc p \<in> Tainted s \<and> O_proc p' \<notin> Tainted s) |
|
330 |
then update_s2ss_shm s p' |
|
331 |
else if (O_proc p' \<in> Tainted s \<and> O_proc p \<notin> Tainted s) |
|
332 |
then update_s2ss_shm s p |
|
333 |
else s2ss s )" |
|
334 |
apply (frule vt_grant_os, frule vd_cons) |
|
335 |
apply (simp add:s2ss_ptrace2 s2ss_ptrace1 split:if_splits) |
|
336 |
by (auto dest:s2ss_ptrace3) |
|
41 | 337 |
|
43 | 338 |
lemma s2ss_kill: |
339 |
"valid (Kill p p' # s) \<Longrightarrow> s2ss (Kill p p' # s) = ( |
|
340 |
if (\<exists> p''. p'' \<in> current_procs s \<and> p'' \<noteq> p' \<and> co2sobj s (O_proc p'') = co2sobj s (O_proc p')) |
|
341 |
then s2ss s |
|
342 |
else (case (co2sobj s (O_proc p')) of |
|
343 |
Some sp \<Rightarrow> s2ss s - {sp} |
|
344 |
| _ \<Rightarrow> {}))" |
|
345 |
apply (frule vt_grant_os, frule vd_cons) |
|
346 |
unfolding s2ss_def |
|
347 |
apply (simp split:if_splits, rule conjI) |
|
348 |
apply (rule impI, (erule exE|erule conjE)+) |
|
349 |
apply (split option.splits) |
|
350 |
apply (drule current_proc_has_sp', simp, simp) |
|
351 |
apply (simp split: option.splits, (erule conjE)+) |
|
352 |
apply (rule set_eqI, rule iffI, erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
353 |
apply (rule_tac x = obj in exI) |
|
354 |
apply (simp add:co2sobj_kill tainted_eq_Tainted alive_kill split:t_object.splits if_splits) |
|
355 |
apply (erule CollectE, erule exE, erule conjE, rule CollectI) |
|
356 |
apply (erule co2sobj_some_caseD) |
|
357 |
apply (case_tac "pa = p'") |
|
358 |
apply (rule_tac x = "O_proc p''" in exI) |
|
359 |
apply (simp add:cp2sproc_kill tainted_eq_Tainted alive_kill |
|
360 |
split:t_object.splits if_splits option.splits) |
|
361 |
apply (rule_tac x = "O_proc pa" in exI) |
|
362 |
apply (clarsimp simp add:cp2sproc_kill tainted_eq_Tainted alive_kill |
|
363 |
split:t_object.splits if_splits option.splits) |
|
364 |
apply (rule_tac x = obj in exI, frule alive_kill, simp add:co2sobj_kill del:co2sobj.simps)+ |
|
365 |
||
366 |
apply (rule impI, erule conjE, frule current_proc_has_sp, simp, erule exE, simp) |
|
367 |
apply (rule set_eqI, rule iffI) |
|
368 |
apply (erule CollectE, erule exE, erule conjE, rule DiffI) |
|
369 |
apply (rule CollectI, rule_tac x = obj in exI) |
|
370 |
apply (simp add:co2sobj_kill tainted_eq_Tainted alive_kill split:t_object.splits if_splits) |
|
371 |
apply (rule notI, simp, case_tac obj) |
|
372 |
apply (erule_tac x = nat in allE) |
|
373 |
apply (simp add:co2sobj_kill cp2sproc_kill tainted_eq_Tainted split:option.splits) |
|
374 |
apply (simp split:option.splits)+ |
|
375 |
apply (erule co2sobj_some_caseD) |
|
376 |
apply (case_tac "pa = p'") |
|
377 |
apply (rule_tac x = "O_proc p''" in exI) |
|
378 |
apply (simp add:cp2sproc_kill tainted_eq_Tainted alive_kill |
|
379 |
split:t_object.splits if_splits option.splits) |
|
380 |
apply (rule_tac x = "O_proc pa" in exI) |
|
381 |
apply (clarsimp simp add:cp2sproc_kill tainted_eq_Tainted alive_kill |
|
382 |
split:t_object.splits if_splits option.splits) |
|
383 |
apply (rule_tac x = obj in exI, frule alive_kill, simp add:co2sobj_kill del:co2sobj.simps)+ |
|
384 |
done |
|
385 |
||
386 |
lemma s2ss_exit: |
|
387 |
"valid (Exit p # s) \<Longrightarrow> s2ss (Exit p # s) = ( |
|
388 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = co2sobj s (O_proc p)) |
|
389 |
then s2ss s |
|
390 |
else (case (co2sobj s (O_proc p)) of |
|
391 |
Some sp \<Rightarrow> s2ss s - {sp} |
|
392 |
| _ \<Rightarrow> {}))" |
|
393 |
apply (frule vt_grant_os, frule vd_cons) |
|
394 |
unfolding s2ss_def |
|
395 |
apply (simp split:if_splits, rule conjI) |
|
396 |
apply (rule impI, (erule exE|erule conjE)+) |
|
397 |
apply (split option.splits) |
|
398 |
apply (drule current_proc_has_sp', simp, simp) |
|
399 |
apply (simp split: option.splits, (erule conjE)+) |
|
400 |
apply (rule set_eqI, rule iffI, erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
401 |
apply (rule_tac x = obj in exI) |
|
402 |
apply (simp add:co2sobj_exit tainted_eq_Tainted alive_exit split:t_object.splits if_splits) |
|
403 |
apply (erule CollectE, erule exE, erule conjE, rule CollectI) |
|
404 |
apply (erule co2sobj_some_caseD) |
|
405 |
apply (case_tac "pa = p") |
|
406 |
apply (rule_tac x = "O_proc p'" in exI) |
|
407 |
apply (simp add:cp2sproc_exit tainted_eq_Tainted alive_exit |
|
408 |
split:t_object.splits if_splits option.splits) |
|
409 |
apply (rule_tac x = "O_proc pa" in exI) |
|
410 |
apply (clarsimp simp add:cp2sproc_exit tainted_eq_Tainted alive_exit |
|
411 |
split:t_object.splits if_splits option.splits) |
|
412 |
apply (rule_tac x = obj in exI, frule alive_exit, simp add:co2sobj_exit del:co2sobj.simps)+ |
|
413 |
||
414 |
apply (rule impI, frule current_proc_has_sp, simp, erule exE, simp) |
|
415 |
apply (rule set_eqI, rule iffI) |
|
416 |
apply (erule CollectE, erule exE, erule conjE, rule DiffI) |
|
417 |
apply (rule CollectI, rule_tac x = obj in exI) |
|
418 |
apply (simp add:co2sobj_exit tainted_eq_Tainted alive_exit split:t_object.splits if_splits) |
|
419 |
apply (rule notI, simp, case_tac obj) |
|
420 |
apply (erule_tac x = nat in allE) |
|
421 |
apply (simp add:co2sobj_exit cp2sproc_exit tainted_eq_Tainted split:option.splits) |
|
422 |
apply (simp split:option.splits)+ |
|
423 |
apply (erule co2sobj_some_caseD) |
|
424 |
apply (case_tac "pa = p") |
|
425 |
apply (rule_tac x = "O_proc p'" in exI) |
|
426 |
apply (simp add:cp2sproc_exit tainted_eq_Tainted alive_exit |
|
427 |
split:t_object.splits if_splits option.splits) |
|
428 |
apply (rule_tac x = "O_proc pa" in exI) |
|
429 |
apply (clarsimp simp add:cp2sproc_exit tainted_eq_Tainted alive_exit |
|
430 |
split:t_object.splits if_splits option.splits) |
|
431 |
apply (rule_tac x = obj in exI, frule alive_exit, simp add:co2sobj_exit del:co2sobj.simps)+ |
|
432 |
done |
|
433 |
||
434 |
lemma alive_has_sobj': |
|
435 |
"\<lbrakk>co2sobj s obj = None; valid s\<rbrakk> \<Longrightarrow> \<not> alive s obj" |
|
436 |
apply (case_tac obj) |
|
437 |
apply (auto split:option.splits) |
|
438 |
oops |
|
439 |
||
440 |
declare co2sobj.simps [simp del] |
|
441 |
||
442 |
lemma co2sobj_open_none: |
|
443 |
"\<lbrakk>valid (Open p f flag fd None # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Open p f flag fd None # s) obj = ( |
|
444 |
if (obj = O_proc p) |
|
445 |
then (case (cp2sproc (Open p f flag fd None # s) p) of |
|
446 |
Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> Tainted s)) |
|
447 |
| _ \<Rightarrow> None) |
|
448 |
else co2sobj s obj)" |
|
449 |
apply (frule vt_grant_os, frule vd_cons) |
|
450 |
apply (frule_tac obj = obj in co2sobj_open, simp add:alive_open) |
|
451 |
apply (auto split:t_object.splits option.splits dest!:current_proc_has_sp') |
|
452 |
done |
|
453 |
||
454 |
lemma co2sobj_open_some: |
|
455 |
"\<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 = ( |
|
456 |
if (obj = O_proc p) |
|
457 |
then (case (cp2sproc (Open p f flag fd (Some i) # s) p) of |
|
458 |
Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> Tainted s)) |
|
459 |
| _ \<Rightarrow> None) |
|
460 |
else if (obj = O_file f) |
|
461 |
then (case (cf2sfile (Open p f flag fd (Some i) # s) f) of |
|
462 |
Some sf \<Rightarrow> Some (S_file {sf} (O_proc p \<in> Tainted s)) |
|
463 |
| _ \<Rightarrow> None) |
|
464 |
else co2sobj s obj)" |
|
465 |
apply (frule vt_grant_os, frule vd_cons) |
|
466 |
apply (frule_tac obj = obj in co2sobj_open, simp add:alive_open) |
|
467 |
apply (auto split:t_object.splits option.splits dest!:current_proc_has_sp') |
|
468 |
done |
|
41 | 469 |
|
43 | 470 |
lemma alive_co2sobj_some_open_none: |
471 |
"\<lbrakk>co2sobj s obj = Some sobj; alive s obj; valid (Open p f flag fd None # s)\<rbrakk> |
|
472 |
\<Longrightarrow> alive (Open p f flag fd None # s) obj" |
|
473 |
by (erule co2sobj_some_caseD, auto simp:alive_simps is_file_simps is_dir_simps) |
|
474 |
||
475 |
lemma alive_co2sobj_some_open_none': |
|
476 |
"\<lbrakk>co2sobj (Open p f flag fd None # s) obj = Some sobj; alive (Open p f flag fd None # s) obj; |
|
477 |
valid (Open p f flag fd None # s)\<rbrakk> \<Longrightarrow> alive s obj" |
|
478 |
by (erule co2sobj_some_caseD, auto simp:alive_simps is_file_simps is_dir_simps) |
|
479 |
||
480 |
lemma co2sobj_proc_obj: |
|
481 |
"\<lbrakk>co2sobj s obj = Some x; co2sobj s (O_proc p) = Some x\<rbrakk> |
|
482 |
\<Longrightarrow> \<exists> p'. obj = O_proc p'" |
|
483 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits) |
|
484 |
||
485 |
lemma s2ss_open_none: |
|
486 |
"valid (Open p f flag fd None # s) \<Longrightarrow> s2ss (Open p f flag fd None # s) = ( |
|
487 |
case (co2sobj s (O_proc p), co2sobj (Open p f flag fd None # s) (O_proc p)) of |
|
488 |
(Some sp, Some sp') \<Rightarrow> |
|
489 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp) |
|
490 |
then s2ss s \<union> {sp'} |
|
491 |
else s2ss s - {sp} \<union> {sp'} |
|
492 |
| _ \<Rightarrow> {} )" |
|
493 |
unfolding s2ss_def |
|
494 |
apply (frule vt_grant_os, frule vd_cons) |
|
495 |
apply (case_tac "co2sobj s (O_proc p)", simp add:co2sobj.simps split:option.splits) |
|
496 |
apply (drule current_proc_has_sp', simp, simp) |
|
497 |
apply (case_tac "co2sobj (Open p f flag fd None # s) (O_proc p)") |
|
498 |
apply (simp add:co2sobj.simps split:option.splits) |
|
499 |
apply (drule current_proc_has_sp', simp, simp) |
|
500 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE, simp) |
|
501 |
apply (frule_tac obj = obj in alive_co2sobj_some_open_none', simp, simp) |
|
502 |
apply (rule conjI, rule impI, erule exE, (erule conjE)+) |
|
503 |
apply (rule Meson.disj_comm, rule disjCI, case_tac "obj = O_proc p", simp) |
|
504 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none) |
|
505 |
apply (rule impI) |
|
506 |
apply (case_tac "obj = O_proc p", simp) |
|
507 |
apply (rule Meson.disj_comm, rule disjCI, rule conjI) |
|
508 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none) |
|
509 |
apply (simp add:co2sobj_open_none split:option.splits) |
|
510 |
apply (rule notI) |
|
511 |
apply (frule co2sobj_proc_obj, simp, erule exE) |
|
512 |
apply (erule_tac x = p' in allE, simp) |
|
513 |
||
514 |
apply (simp split:if_splits) |
|
515 |
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp) |
|
516 |
apply (erule exE, erule conjE, case_tac "obj = O_proc p") |
|
517 |
apply (rule_tac x = "O_proc p'" in exI, simp add:co2sobj_open_none) |
|
518 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none alive_co2sobj_some_open_none) |
|
519 |
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp) |
|
520 |
apply (erule conjE, erule exE, erule conjE, case_tac "obj = O_proc p") |
|
521 |
apply (rule_tac x = "O_proc p'" in exI, simp add:co2sobj_open_none) |
|
522 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none alive_co2sobj_some_open_none) |
|
523 |
done |
|
524 |
||
525 |
lemma alive_co2sobj_some_open_some: |
|
526 |
"\<lbrakk>alive s obj; valid (Open p f flag fd (Some i) # s)\<rbrakk> |
|
527 |
\<Longrightarrow> alive (Open p f flag fd (Some i) # s) obj" |
|
528 |
by (case_tac obj, auto simp:alive_simps is_file_simps is_dir_simps) |
|
529 |
||
530 |
lemma alive_co2sobj_some_open_some': |
|
531 |
"\<lbrakk>co2sobj (Open p f flag fd (Some i) # s) obj = Some sobj; alive (Open p f flag fd (Some i) # s) obj; |
|
532 |
valid (Open p f flag fd (Some i) # s); obj \<noteq> O_file f\<rbrakk> \<Longrightarrow> alive s obj" |
|
533 |
by (erule co2sobj_some_caseD, auto simp:alive_simps is_file_simps is_dir_simps) |
|
534 |
||
535 |
lemma s2ss_open_some: |
|
536 |
"valid (Open p f flag fd (Some i) # s) \<Longrightarrow> s2ss (Open p f flag fd (Some i) # s) = ( |
|
537 |
case (co2sobj s (O_proc p), co2sobj (Open p f flag fd (Some i) # s) (O_proc p), |
|
538 |
co2sobj (Open p f flag fd (Some i) # s) (O_file f)) of |
|
539 |
(Some sp, Some sp', Some sf) \<Rightarrow> |
|
540 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp) |
|
541 |
then s2ss s \<union> {sp', sf} |
|
542 |
else s2ss s - {sp} \<union> {sp', sf} |
|
543 |
| _ \<Rightarrow> {} )" |
|
544 |
unfolding s2ss_def |
|
545 |
apply (frule vt_grant_os, frule vd_cons) |
|
546 |
apply (case_tac "co2sobj s (O_proc p)", simp add:co2sobj.simps split:option.splits) |
|
547 |
apply (drule current_proc_has_sp', simp, simp) |
|
548 |
apply (case_tac "co2sobj (Open p f flag fd (Some i) # s) (O_proc p)") |
|
549 |
apply (simp add:co2sobj.simps split:option.splits) |
|
550 |
apply (drule current_proc_has_sp', simp, simp) |
|
551 |
apply (case_tac "co2sobj (Open p f flag fd (Some i) # s) (O_file f)") |
|
552 |
apply (simp add:co2sobj.simps split:option.splits) |
|
553 |
apply (clarsimp split del:if_splits) |
|
554 |
||
555 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE) |
|
556 |
apply (split if_splits, rule conjI, rule impI, erule exE, erule conjE, erule conjE) |
|
557 |
apply (case_tac "obj = O_proc p", simp, case_tac "obj = O_file f", simp) |
|
558 |
apply (rule UnI1, rule CollectI, rule_tac x = obj in exI) |
|
559 |
apply (frule_tac obj = obj in alive_co2sobj_some_open_some', simp+) |
|
560 |
apply (simp add:co2sobj_open split:t_object.splits) |
|
561 |
apply (rule impI, case_tac "obj = O_proc p", simp, case_tac "obj = O_file f", simp) |
|
562 |
apply (rule UnI1, rule DiffI, rule CollectI, rule_tac x = obj in exI) |
|
563 |
apply (frule_tac obj = obj in alive_co2sobj_some_open_some', simp+) |
|
564 |
apply (simp add:co2sobj_open split:t_object.splits) |
|
565 |
apply (frule_tac obj = obj in co2sobj_open_some, simp+) |
|
566 |
apply (simp add:alive_co2sobj_some_open_some', simp) |
|
567 |
apply (rule notI) |
|
568 |
apply (frule_tac obj = obj and p = p in co2sobj_proc_obj, simp+, erule exE) |
|
569 |
apply (erule_tac x = p' in allE, simp) |
|
570 |
||
571 |
apply (simp split:if_splits, erule disjE) |
|
572 |
apply (rule_tac x = "O_proc p" in exI, simp) |
|
573 |
apply (erule disjE, rule_tac x = "O_file f" in exI, simp add:is_file_simps) |
|
574 |
apply (erule exE, erule conjE) |
|
575 |
apply (case_tac "obj = O_proc p", simp) |
|
576 |
apply (rule_tac x = "O_proc p'" in exI, simp add:co2sobj_open_some) |
|
577 |
apply (case_tac "obj = O_file f", simp add:is_file_in_current) |
|
578 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_some alive_co2sobj_some_open_some) |
|
579 |
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp) |
|
580 |
apply (erule disjE, rule_tac x = "O_file f" in exI, simp add:is_file_simps) |
|
581 |
apply (erule conjE, erule exE, erule conjE) |
|
582 |
apply (case_tac "obj = O_proc p", simp) |
|
583 |
apply (case_tac "obj = O_file f", simp add:is_file_in_current) |
|
584 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_some alive_co2sobj_some_open_some) |
|
585 |
done |
|
586 |
||
587 |
lemma s2ss_open: |
|
588 |
"valid (Open p f flag fd opt # s) \<Longrightarrow> s2ss (Open p f flag fd opt # s) = ( |
|
589 |
if opt = None |
|
590 |
then (case (co2sobj s (O_proc p), co2sobj (Open p f flag fd opt # s) (O_proc p)) of |
|
591 |
(Some sp, Some sp') \<Rightarrow> |
|
592 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp) |
|
593 |
then s2ss s \<union> {sp'} |
|
594 |
else s2ss s - {sp} \<union> {sp'} |
|
595 |
| _ \<Rightarrow> {} ) |
|
596 |
else (case (co2sobj s (O_proc p), co2sobj (Open p f flag fd opt # s) (O_proc p), |
|
597 |
co2sobj (Open p f flag fd opt # s) (O_file f)) of |
|
598 |
(Some sp, Some sp', Some sf) \<Rightarrow> |
|
599 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (O_proc p') = Some sp) |
|
600 |
then s2ss s \<union> {sp', sf} |
|
601 |
else s2ss s - {sp} \<union> {sp', sf} |
|
602 |
| _ \<Rightarrow> {} ) )" |
|
603 |
apply (case_tac opt) |
|
604 |
apply (simp add:s2ss_open_some s2ss_open_none)+ |
|
605 |
done |
|
606 |
||
44 | 607 |
lemma s2ss_readfile: |
608 |
"valid (ReadFile p fd # s) \<Longrightarrow> s2ss (ReadFile p fd # s) = ( |
|
609 |
case (file_of_proc_fd s p fd) of |
|
610 |
Some f \<Rightarrow> if (O_file f \<in> Tainted s) |
|
611 |
then update_s2ss_shm s p |
|
612 |
else s2ss s |
|
613 |
| _ \<Rightarrow> {})" |
|
614 |
apply (frule vt_grant_os, frule vd_cons, clarsimp split:option.splits) |
|
615 |
apply (rule conjI, rule impI, rule impI, simp) |
|
54 | 616 |
unfolding update_s2ss_shm_def s2ss_def s2ss_shm_no_backup_def |
44 | 617 |
apply (rule set_eqI, rule iffI) |
618 |
apply (drule CollectD, (erule exE|erule conjE)+) |
|
619 |
apply (erule co2sobj_some_caseD) |
|
620 |
apply (rule DiffI) |
|
621 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
622 |
apply (rule UnI1, simp, rule_tac x = "O_proc pa" in exI) |
|
623 |
apply (clarsimp simp:cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits) |
|
624 |
apply (case_tac "info_flow_shm s p pa") |
|
625 |
apply (rule UnI2, rule CollectI, simp only:co2sobj.simps split:option.splits) |
|
626 |
apply (drule current_proc_has_sp', simp, simp) |
|
627 |
apply (rule_tac x = ab in exI, rule_tac x = pa in exI) |
|
628 |
apply (clarsimp simp:cp2sproc_other tainted_eq_Tainted split:option.splits) |
|
629 |
apply (rule UnI1, simp) |
|
630 |
apply (rule_tac x = "O_proc pa" in exI) |
|
631 |
apply (clarsimp simp:cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits) |
|
632 |
apply (rule notI, clarsimp simp:cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits) |
|
633 |
apply (erule_tac x = pa in allE, simp) |
|
634 |
||
635 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI) |
|
636 |
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps) |
|
637 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI) |
|
638 |
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps split:option.splits) |
|
639 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI) |
|
640 |
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps split:option.splits) |
|
641 |
apply (rule DiffI, rule UnI1, rule CollectI, rule_tac x = obj in exI) |
|
642 |
apply (simp add:alive_simps co2sobj_readfile, rule notI, clarsimp simp:co2sobj.simps split:option.splits) |
|
643 |
||
644 |
apply (erule DiffE, drule s2ss_ptrace1_aux, erule UnE) |
|
645 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
646 |
apply (erule co2sobj_some_caseD) |
|
647 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
648 |
apply (rule_tac x = "O_proc pa" in exI) |
|
649 |
apply (clarsimp simp:tainted_eq_Tainted cp2sproc_other co2sobj.simps split:option.splits) |
|
650 |
apply (case_tac "info_flow_shm s p pa", simp only:co2sobj.simps split:option.splits) |
|
651 |
apply (drule current_proc_has_sp', simp, simp) |
|
652 |
apply (drule Meson.not_exD, erule_tac x = ab in allE, drule Meson.not_exD, erule_tac x = pa in allE) |
|
653 |
apply (simp add:tainted_eq_Tainted, (erule exE|erule conjE)+) |
|
654 |
apply (rule_tac x = "O_proc p'" in exI) |
|
655 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits) |
|
656 |
apply (rule_tac x = "O_proc pa" in exI) |
|
657 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted co2sobj.simps split:option.splits) |
|
658 |
||
659 |
apply (rule_tac x = obj in exI, |
|
660 |
auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1] |
|
661 |
apply (rule_tac x = obj in exI, |
|
662 |
auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1] |
|
663 |
apply (rule_tac x = obj in exI, |
|
664 |
auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1] |
|
665 |
apply (rule_tac x = obj in exI, |
|
666 |
auto split:option.splits simp:co2sobj_readfile alive_simps simp del:co2sobj.simps)[1] |
|
667 |
||
668 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI) |
|
669 |
apply (rule_tac x = "O_proc pa" in exI) |
|
670 |
apply (clarsimp simp:Tainted_ptrace' cp2sproc_other tainted_eq_Tainted info_shm_flow_in_procs co2sobj.simps) |
|
671 |
||
672 |
||
673 |
apply (rule impI, rule impI) |
|
674 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE, rule CollectI) |
|
675 |
apply (rule_tac x = obj in exI, simp add:alive_simps co2sobj_readfile split:t_object.splits) |
|
676 |
apply (erule CollectE, erule exE, erule conjE, rule CollectI) |
|
677 |
apply (rule_tac x = obj in exI, simp add:alive_simps) |
|
678 |
apply (drule_tac obj = obj in co2sobj_readfile, simp) |
|
679 |
apply (simp split:t_object.splits) |
|
680 |
done |
|
41 | 681 |
|
45 | 682 |
lemma same_inode_files_prop9: |
683 |
"is_file s f \<Longrightarrow> f \<in> same_inode_files s f" |
|
684 |
by (simp add:same_inode_files_def) |
|
685 |
||
686 |
lemma cf2sfiles_prop: |
|
687 |
"\<lbrakk>f \<in> same_inode_files s f'; valid s\<rbrakk> \<Longrightarrow> cf2sfiles s f = cf2sfiles s f'" |
|
688 |
apply (auto simp:cf2sfiles_def) |
|
689 |
apply (rule_tac x = f'a in bexI, simp) |
|
690 |
apply (erule same_inode_files_prop4, simp) |
|
691 |
apply (rule_tac x = f'a in bexI, simp) |
|
692 |
apply (drule same_inode_files_prop5) |
|
693 |
apply (erule same_inode_files_prop4, simp) |
|
694 |
done |
|
695 |
||
696 |
lemma co2sobj_writefile_unchange: |
|
697 |
"\<lbrakk>valid (WriteFile p fd # s); alive s obj; file_of_proc_fd s p fd = Some f; |
|
698 |
O_proc p \<in> Tainted s \<longrightarrow> O_file f \<in> Tainted s\<rbrakk> |
|
699 |
\<Longrightarrow> co2sobj (WriteFile p fd # s) obj = co2sobj s obj" |
|
700 |
apply (frule vd_cons, frule co2sobj_writefile, simp, simp split:t_object.splits if_splits) |
|
701 |
apply (simp add:co2sobj.simps) |
|
702 |
apply (case_tac "O_proc p \<in> Tainted s") |
|
703 |
apply (simp add:tainted_eq_Tainted same_inodes_Tainted)+ |
|
704 |
done |
|
705 |
||
706 |
lemma s2ss_writefile: |
|
707 |
"valid (WriteFile p fd # s) \<Longrightarrow> s2ss (WriteFile p fd # s) = ( |
|
708 |
case (file_of_proc_fd s p fd) of |
|
709 |
Some f \<Rightarrow> if (O_proc p \<in> Tainted s \<and> O_file f \<notin> Tainted s) |
|
710 |
then (if (\<exists> f'. f' \<notin> same_inode_files s f \<and> is_file s f' \<and> |
|
711 |
co2sobj s (O_file f') = co2sobj s (O_file f)) |
|
712 |
then s2ss s \<union> {S_file (cf2sfiles s f) True} |
|
713 |
else s2ss s - {S_file (cf2sfiles s f) False} |
|
714 |
\<union> {S_file (cf2sfiles s f) True}) |
|
715 |
else s2ss s |
|
716 |
| _ \<Rightarrow> {})" |
|
717 |
apply (frule vd_cons, frule vt_grant_os) |
|
718 |
apply (clarsimp split:option.splits) |
|
719 |
unfolding s2ss_def |
|
720 |
apply (rule conjI|rule impI|erule exE|erule conjE)+ |
|
721 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE) |
|
722 |
apply (frule_tac obj = obj in co2sobj_writefile, simp add:alive_other) |
|
723 |
apply (simp split:t_object.splits if_splits) |
|
724 |
apply (rule disjI2, rule_tac x= "O_proc nat" in exI, simp) |
|
725 |
apply (rule disjI1, simp add:cf2sfiles_prop) |
|
726 |
apply (rule disjI2, rule_tac x = obj in exI, simp add:is_file_simps) |
|
727 |
apply (simp add:co2sobj.simps) |
|
728 |
apply (rule disjI2, rule_tac x = obj in exI, simp add:is_dir_simps) |
|
729 |
apply (simp add:co2sobj.simps) |
|
730 |
apply (simp add:co2sobj.simps) |
|
731 |
apply (simp add:co2sobj.simps) |
|
732 |
apply (rule disjI2, rule_tac x = obj in exI, simp) |
|
733 |
apply (rule disjI2, rule_tac x = obj in exI, simp) |
|
734 |
apply (simp add:co2sobj.simps) |
|
735 |
||
736 |
apply (simp, erule disjE) |
|
737 |
apply (rule_tac x = "O_file aa" in exI, simp add:is_file_simps file_of_pfd_is_file) |
|
738 |
apply (frule_tac obj = "O_file aa" in co2sobj_writefile, simp add:file_of_pfd_is_file) |
|
739 |
apply (simp split:if_splits add:same_inode_files_def file_of_pfd_is_file) |
|
740 |
apply (erule exE, erule conjE) |
|
741 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
742 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile) |
|
743 |
apply (case_tac "fa \<in> same_inode_files s aa") |
|
744 |
apply (frule_tac f = fa and f' = aa in cf2sfiles_prop, simp) |
|
745 |
apply (rule_tac x = "O_file f'" in exI, simp add:co2sobj_writefile is_file_simps) |
|
746 |
apply (rule conjI, rule impI, simp add:same_inode_files_prop5) |
|
747 |
apply (rule impI, simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted) |
|
748 |
apply (rule_tac x = "O_file fa" in exI, simp add:co2sobj_writefile is_file_simps) |
|
749 |
apply (rule impI, simp add:same_inode_files_prop5) |
|
750 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile) |
|
751 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile is_dir_simps) |
|
752 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile) |
|
753 |
||
754 |
apply (rule impI, rule impI, simp, rule set_eqI, rule iffI, erule CollectE, (erule conjE|erule exE)+) |
|
755 |
apply (rule CollectI, rule_tac x = obj in exI, simp add:alive_simps) |
|
756 |
apply (simp add:co2sobj_writefile split:t_object.splits if_splits) |
|
757 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted) |
|
758 |
apply (case_tac "O_proc p \<in> Tainted s", simp, simp) |
|
759 |
apply (erule CollectE, (erule conjE|erule exE)+, rule CollectI) |
|
760 |
apply (rule_tac x = obj in exI) |
|
761 |
apply (simp add:co2sobj_writefile_unchange alive_simps) |
|
762 |
||
763 |
apply (rule impI| rule conjI|erule conjE)+ |
|
764 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE) |
|
765 |
apply (simp add:alive_simps co2sobj_writefile split:t_object.splits) |
|
766 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp, |
|
767 |
rule notI, simp add:co2sobj.simps split:option.splits) |
|
768 |
apply (simp split:if_splits) |
|
769 |
apply (rule disjI1, simp add:cf2sfiles_prop) |
|
770 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp) |
|
771 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
772 |
apply (erule_tac x = list in allE, simp add:tainted_eq_Tainted same_inode_files_prop5) |
|
773 |
apply (simp add:co2sobj.simps) |
|
774 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp, |
|
775 |
rule notI, simp add:co2sobj.simps split:option.splits) |
|
776 |
apply (simp add:co2sobj.simps) |
|
777 |
apply (simp add:co2sobj.simps) |
|
778 |
apply (simp add:co2sobj.simps) |
|
779 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp, |
|
780 |
rule notI, simp add:co2sobj.simps split:option.splits) |
|
781 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp, |
|
782 |
rule notI, simp add:co2sobj.simps split:option.splits) |
|
783 |
apply (simp add:co2sobj.simps) |
|
784 |
apply (simp) |
|
785 |
apply (erule disjE) |
|
786 |
apply (rule_tac x= "O_file aa" in exI, simp add:co2sobj_writefile alive_simps file_of_pfd_is_file) |
|
787 |
apply (rule impI, simp add:same_inode_files_def file_of_pfd_is_file) |
|
788 |
apply (erule exE|erule conjE)+ |
|
789 |
apply (erule co2sobj_some_caseD) |
|
790 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile) |
|
791 |
apply (case_tac "fa \<in> same_inode_files s aa") |
|
792 |
apply (frule cf2sfiles_prop, simp, simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted) |
|
793 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile is_file_simps) |
|
794 |
apply (rule impI, simp add:same_inode_files_prop5) |
|
795 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile) |
|
796 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile is_dir_simps) |
|
797 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile) |
|
798 |
apply (rule impI, rule impI) |
|
799 |
||
800 |
apply (rule set_eqI, rule iffI, erule CollectE,erule exE,erule conjE,rule CollectI) |
|
801 |
apply (rule_tac x = obj in exI) |
|
802 |
apply (simp add:co2sobj_writefile_unchange alive_simps) |
|
803 |
apply (erule CollectE, erule exE, erule conjE) |
|
804 |
apply (rule CollectI, rule_tac x = obj in exI) |
|
805 |
apply (simp add:co2sobj_writefile_unchange alive_simps) |
|
806 |
done |
|
807 |
||
47 | 808 |
|
809 |
definition update_s2ss_obj :: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_object \<Rightarrow> t_sobject \<Rightarrow> t_sobject \<Rightarrow> t_static_state" |
|
810 |
where |
|
811 |
"update_s2ss_obj s ss obj sobj sobj' = |
|
812 |
(if (\<exists> obj'. alive s obj' \<and> obj' \<noteq> obj \<and> co2sobj s obj' = Some sobj) |
|
813 |
then ss \<union> {sobj'} |
|
814 |
else ss - {sobj} \<union> {sobj'})" |
|
815 |
||
53 | 816 |
definition update_s2ss_sfile_del :: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> t_sfile \<Rightarrow> t_static_state" |
47 | 817 |
where |
53 | 818 |
"update_s2ss_sfile_del s ss f sf \<equiv> |
47 | 819 |
if (same_inode_files s f = {f}) |
820 |
then ss |
|
821 |
else ss \<union> {S_file (cf2sfiles s f - {sf}) (O_file f \<in> Tainted s)}" |
|
822 |
||
823 |
definition del_s2ss_file:: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> t_sfile \<Rightarrow> t_static_state" |
|
824 |
where |
|
825 |
"del_s2ss_file s ss f sf = |
|
826 |
(if (\<exists> f' \<in> same_inode_files s f. f' \<noteq> f \<and> cf2sfile s f' = Some sf) |
|
827 |
then ss |
|
828 |
else if (\<exists> f'. is_file s f' \<and> f' \<notin> same_inode_files s f \<and> co2sobj s (O_file f') = co2sobj s (O_file f)) |
|
53 | 829 |
then update_s2ss_sfile_del s ss f sf |
830 |
else update_s2ss_sfile_del s (ss - {S_file (cf2sfiles s f) (O_file f \<in> Tainted s)}) f sf)" |
|
47 | 831 |
|
832 |
lemma alive_co2sobj_closefd1: |
|
833 |
"\<lbrakk>alive s obj; valid (CloseFd p fd # s); co2sobj s obj = Some sobj; |
|
834 |
file_of_proc_fd s p fd = Some f; \<not> (f \<in> files_hung_by_del s \<and> proc_fd_of_file s f = {(p, fd)})\<rbrakk> |
|
835 |
\<Longrightarrow> alive (CloseFd p fd # s) obj" |
|
836 |
apply (erule co2sobj_some_caseD) |
|
837 |
by (auto simp:alive_simps is_file_simps is_dir_simps split:option.splits) |
|
838 |
||
839 |
lemma alive_co2sobj_closefd3: |
|
840 |
"\<lbrakk>alive s obj; valid (CloseFd p fd # s); co2sobj s obj = Some sobj; obj \<noteq> O_file f; |
|
841 |
file_of_proc_fd s p fd = Some f; f \<in> files_hung_by_del s; proc_fd_of_file s f = {(p, fd)}\<rbrakk> |
|
842 |
\<Longrightarrow> alive (CloseFd p fd # s) obj" |
|
843 |
apply (erule co2sobj_some_caseD) |
|
844 |
by (auto simp:alive_simps is_file_simps is_dir_simps split:option.splits) |
|
845 |
||
846 |
lemma alive_co2sobj_closefd2: |
|
847 |
"\<lbrakk>alive s obj; valid (CloseFd p fd # s); co2sobj s obj = Some sobj; file_of_proc_fd s p fd = None\<rbrakk> |
|
848 |
\<Longrightarrow> alive (CloseFd p fd # s) obj" |
|
849 |
apply (erule co2sobj_some_caseD) |
|
850 |
by (auto simp:alive_simps is_file_simps is_dir_simps split:option.splits) |
|
851 |
||
852 |
lemma alive_co2sobj_closefd': |
|
853 |
"\<lbrakk>co2sobj (CloseFd p fd # s) obj = Some sobj; alive (CloseFd p fd # s) obj; |
|
854 |
valid (CloseFd p fd # s)\<rbrakk> \<Longrightarrow> alive s obj" |
|
855 |
apply (erule co2sobj_some_caseD) |
|
856 |
by (auto simp:alive_simps is_file_simps is_dir_simps split:option.splits if_splits) |
|
857 |
||
858 |
ML {*asm_full_simp_tac*} |
|
859 |
||
860 |
ML {* |
|
861 |
fun my_setiff_tac i = |
|
862 |
(etac @{thm CollectE} i |
|
863 |
ORELSE ( asm_full_simp_tac (HOL_ss addsimps @{thms Set.insert_iff}) i |
|
864 |
THEN etac @{thm disjE} i) |
|
865 |
ORELSE ( asm_full_simp_tac (HOL_ss addsimps @{thms Set.Diff_iff}) i |
|
866 |
THEN etac @{thm conjE} i |
|
867 |
THEN (REPEAT (etac @{thm CollectE} i)))) |
|
868 |
THEN (REPEAT (( etac @{thm exE} |
|
869 |
ORELSE' etac @{thm conjE} |
|
870 |
ORELSE' etac @{thm bexE}) i)) |
|
871 |
THEN (rtac @{thm CollectI} i |
|
872 |
ORELSE ( asm_full_simp_tac (HOL_ss addsimps @{thms Set.insert_iff}) i)) |
|
873 |
||
874 |
*} |
|
875 |
||
876 |
ML {* |
|
877 |
fun my_seteq_tac i = |
|
878 |
(simp_tac (HOL_ss addsimps @{thms s2ss_def}) 1) |
|
879 |
THEN (rtac @{thm set_eqI} i) |
|
880 |
THEN (rtac @{thm iffI} i) |
|
881 |
THEN my_setiff_tac i |
|
882 |
*} |
|
883 |
||
884 |
lemma co2sobj_sproc_imp: |
|
885 |
"co2sobj s obj = Some (S_proc sp tag) \<Longrightarrow> \<exists> p. obj = O_proc p" |
|
886 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits) |
|
887 |
||
888 |
lemma co2sobj_sfile_imp: |
|
889 |
"co2sobj s obj = Some (S_file sfs tag) \<Longrightarrow> \<exists> f. obj = O_file f" |
|
890 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits) |
|
891 |
||
892 |
lemma co2sobj_sdir_imp: |
|
893 |
"co2sobj s obj = Some (S_dir sf) \<Longrightarrow> \<exists> f. obj = O_dir f" |
|
894 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits) |
|
895 |
||
896 |
lemma co2sobj_sshm_imp: |
|
897 |
"co2sobj s obj = Some (S_shm sh) \<Longrightarrow> \<exists> h. obj = O_shm h" |
|
898 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits) |
|
899 |
||
900 |
lemma co2sobj_smsgq_imp: |
|
901 |
"co2sobj s obj = Some (S_msgq sq) \<Longrightarrow> \<exists> q. obj = O_msgq q" |
|
902 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits) |
|
903 |
||
48 | 904 |
lemma same_inode_files_prop10: |
905 |
"\<lbrakk>same_inode_files s f \<noteq> {f}; is_file s f\<rbrakk> \<Longrightarrow> \<exists> f'. f' \<in> same_inode_files s f \<and> f' \<noteq> f" |
|
906 |
by (auto simp:same_inode_files_def split:if_splits) |
|
907 |
||
908 |
lemma same_inode_files_prop11: |
|
909 |
"f \<in> same_inode_files s f' \<Longrightarrow> is_file s f" |
|
910 |
by (auto simp:same_inode_files_def is_file_def split:if_splits) |
|
911 |
||
912 |
lemma same_inode_files_prop11': |
|
913 |
"f \<in> same_inode_files s f' \<Longrightarrow> is_file s f'" |
|
914 |
by (auto simp:same_inode_files_def is_file_def split:if_splits) |
|
915 |
||
46 | 916 |
lemma s2ss_closefd: |
917 |
"valid (CloseFd p fd # s) \<Longrightarrow> s2ss (CloseFd p fd # s) = ( |
|
918 |
case (file_of_proc_fd s p fd) of |
|
47 | 919 |
Some f \<Rightarrow> if (f \<in> files_hung_by_del s \<and> proc_fd_of_file s f = {(p, fd)}) |
920 |
then (case (cf2sfile s f, cp2sproc s p, cp2sproc (CloseFd p fd # s) p) of |
|
921 |
(Some sf, Some sp, Some sp') \<Rightarrow> |
|
922 |
(del_s2ss_file s ( |
|
923 |
update_s2ss_obj s (s2ss s) (O_proc p) |
|
924 |
(S_proc sp (O_proc p \<in> Tainted s)) |
|
925 |
(S_proc sp' (O_proc p \<in> Tainted s))) f sf) |
|
926 |
| _ \<Rightarrow> {}) |
|
927 |
else (case (cp2sproc s p, cp2sproc (CloseFd p fd # s) p) of |
|
928 |
(Some sp, Some sp') \<Rightarrow> |
|
929 |
(update_s2ss_obj s (s2ss s) (O_proc p) |
|
930 |
(S_proc sp (O_proc p \<in> Tainted s)) |
|
931 |
(S_proc sp' (O_proc p \<in> Tainted s))) |
|
932 |
| _ \<Rightarrow> {}) |
|
933 |
| _ \<Rightarrow> s2ss s)" |
|
934 |
apply (frule vd_cons, frule vt_grant_os) |
|
935 |
apply (clarsimp simp only:os_grant.simps) |
|
936 |
apply (frule current_proc_has_sp, simp, erule exE) |
|
937 |
apply (case_tac "file_of_proc_fd s p fd") |
|
938 |
||
939 |
apply (simp add:s2ss_def) |
|
940 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE, rule CollectI) |
|
941 |
apply (rule_tac x = obj in exI, simp add:alive_co2sobj_closefd') |
|
942 |
apply (frule co2sobj_closefd, simp) |
|
943 |
apply (frule cp2sproc_closefd, simp) |
|
944 |
apply (simp add:proc_file_fds_def split:t_object.splits) |
|
945 |
apply (simp split:if_splits add:co2sobj.simps tainted_eq_Tainted) |
|
946 |
apply (erule CollectE, erule exE, erule conjE, rule CollectI) |
|
947 |
apply (rule_tac x = obj in exI, simp add:alive_co2sobj_closefd2) |
|
948 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:alive_co2sobj_closefd2) |
|
949 |
apply (frule cp2sproc_closefd, simp) |
|
950 |
apply (auto simp add:proc_file_fds_def co2sobj.simps tainted_eq_Tainted |
|
951 |
split:t_object.splits option.splits if_splits)[1] |
|
952 |
||
953 |
apply (case_tac "cp2sproc (CloseFd p fd # s) p") |
|
954 |
apply (drule current_proc_has_sp', simp, simp) |
|
955 |
apply (case_tac "cf2sfile s a") |
|
956 |
apply (drule current_file_has_sfile', simp, simp add:file_of_pfd_in_current) |
|
957 |
apply (simp) |
|
958 |
||
959 |
apply (rule conjI, rule impI, erule conjE) |
|
960 |
apply (simp add:del_s2ss_file_def) |
|
961 |
apply (rule conjI|rule impI|erule exE|erule conjE|erule bexE)+ |
|
962 |
||
963 |
apply (simp add:update_s2ss_obj_def) |
|
964 |
apply (rule conjI|rule impI|erule exE|erule conjE|erule bexE)+ |
|
965 |
apply (tactic {*my_seteq_tac 1*}) |
|
966 |
apply simp |
|
967 |
apply (case_tac "obj = O_proc p") |
|
968 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
969 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
970 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:alive_simps) |
|
971 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
972 |
apply (tactic {*my_setiff_tac 1*}) |
|
973 |
apply (rule_tac x = "O_proc p" in exI) |
|
974 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
975 |
apply (tactic {*my_setiff_tac 1*}) |
|
976 |
apply (case_tac "obj = O_proc p") |
|
977 |
apply (rule_tac x = obj' in exI) |
|
978 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd) |
|
979 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
980 |
apply (case_tac "obj = O_file a") |
|
981 |
apply (rule_tac x = "O_file f'" in exI) |
|
982 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file) |
|
983 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd, simp add:alive_simps) |
|
984 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
985 |
apply (rule_tac x = obj in exI) |
|
986 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
987 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
988 |
apply (auto simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
989 |
||
990 |
apply (rule impI)+ |
|
991 |
apply (tactic {*my_seteq_tac 1*}) |
|
992 |
apply (case_tac "obj = O_proc p", rule disjI1, simp add:co2sobj.simps tainted_eq_Tainted) |
|
993 |
apply (rule disjI2) |
|
994 |
apply (case_tac "obj = O_file a", simp add:alive_simps) |
|
995 |
apply (rule DiffI, simp) |
|
996 |
apply (rule_tac x = obj in exI) |
|
997 |
apply (frule_tac obj = obj in alive_co2sobj_closefd', simp+) |
|
998 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
999 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
1000 |
apply (simp, rule notI, simp, frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd) |
|
1001 |
apply (erule_tac x = "O_proc pa" in allE, simp) |
|
1002 |
apply (tactic {*my_setiff_tac 1*}) |
|
1003 |
apply (rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1004 |
apply (tactic {*my_setiff_tac 1*}) |
|
1005 |
apply (case_tac "obj = O_proc p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1006 |
apply (case_tac "obj = O_file a", rule_tac x = "O_file f'" in exI) |
|
1007 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file) |
|
1008 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd, simp add:alive_simps) |
|
1009 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
1010 |
apply (rule_tac x = obj in exI) |
|
1011 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
1012 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1013 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1014 |
||
1015 |
apply (rule impI, tactic {*my_seteq_tac 1*}) |
|
53 | 1016 |
apply (simp add:update_s2ss_obj_def update_s2ss_sfile_del_def) |
48 | 1017 |
apply (rule conjI| rule impI|erule exE|erule conjE)+ |
1018 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1019 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1020 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1021 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1022 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1023 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1024 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1025 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1026 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1027 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1028 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1029 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1030 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1031 |
apply (rule conjI| rule impI|erule exE|erule conjE)+ |
|
47 | 1032 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
1033 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1034 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI) |
|
1035 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1036 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1037 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1038 |
apply (case_tac "f \<in> same_inode_files s a", rule disjI1) |
|
1039 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits) |
|
1040 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop) |
|
1041 |
apply (erule bexE, erule conjE) |
|
1042 |
apply (erule_tac x = f'' in ballE, simp, simp) |
|
1043 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI) |
|
1044 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1045 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI) |
|
1046 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1047 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI) |
|
1048 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1049 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI) |
|
1050 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
48 | 1051 |
apply (rule impI, rule conjI, rule impI) |
1052 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1053 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1054 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1055 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1056 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_file_simps) |
|
1057 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1058 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1059 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1060 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_file_simps) |
|
1061 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1062 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1063 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp) |
|
1064 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1065 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1066 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_dir_simps) |
|
1067 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1068 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1069 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp) |
|
47 | 1070 |
apply (rule impI) |
1071 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1072 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1073 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1074 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1075 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1076 |
apply (rule notI, simp add:co2sobj_closefd) |
|
1077 |
apply (erule_tac x = obj in allE, simp) |
|
1078 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1079 |
apply (case_tac "f \<in> same_inode_files s a", rule disjI1) |
|
1080 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits) |
|
1081 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop) |
|
1082 |
apply (erule bexE, erule conjE) |
|
1083 |
apply (erule_tac x = f'' in ballE, simp, simp) |
|
1084 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1085 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1086 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_file_simps) |
|
1087 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1088 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1089 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp) |
|
1090 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1091 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1092 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_dir_simps) |
|
1093 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1094 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1095 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp) |
|
48 | 1096 |
|
53 | 1097 |
apply (simp add:update_s2ss_sfile_del_def update_s2ss_obj_def split:if_splits) |
48 | 1098 |
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
1099 |
apply (erule exE, erule conjE) |
|
1100 |
apply (case_tac "obj = O_proc p") |
|
1101 |
apply (rule_tac x = obj' in exI) |
|
1102 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd) |
|
1103 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1104 |
apply (case_tac "obj = O_file a") |
|
1105 |
apply (rule_tac x = "O_file f'" in exI) |
|
1106 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file) |
|
1107 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd, simp add:alive_simps) |
|
1108 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
1109 |
apply (rule_tac x = obj in exI) |
|
1110 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
1111 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1112 |
apply (auto simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1113 |
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1114 |
apply (erule conjE, erule exE, erule conjE) |
|
1115 |
apply (case_tac "obj = O_proc p") |
|
1116 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1117 |
apply (case_tac "obj = O_file a") |
|
1118 |
apply (rule_tac x = "O_file f'" in exI) |
|
1119 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file) |
|
1120 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd, simp add:alive_simps) |
|
1121 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
1122 |
apply (rule_tac x = obj in exI) |
|
1123 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
1124 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1125 |
apply (auto simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1126 |
apply (erule disjE) |
|
1127 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE) |
|
1128 |
apply (rule_tac x = "O_file f'a" in exI) |
|
1129 |
apply (frule same_inode_files_prop11) |
|
1130 |
apply (frule_tac obj = "O_file f'a" in co2sobj_closefd) |
|
1131 |
apply (simp add:alive_simps)+ |
|
1132 |
apply (frule_tac f = "f'a" in is_file_has_sfile', simp, erule exE) |
|
1133 |
apply (simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted split:if_splits) |
|
1134 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1135 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1136 |
apply (erule disjE) |
|
1137 |
apply (rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1138 |
apply (erule exE, erule conjE) |
|
1139 |
apply (case_tac "obj = O_proc p") |
|
1140 |
apply (rule_tac x = obj' in exI) |
|
1141 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd) |
|
1142 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1143 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1144 |
apply (rule_tac x = obj in exI) |
|
1145 |
apply (simp add:co2sobj_closefd) |
|
1146 |
apply (case_tac "f \<in> same_inode_files s a") |
|
1147 |
apply (rule_tac x = "O_file f'" in exI) |
|
1148 |
apply (simp add:co2sobj_simps is_file_simps split:if_splits option.splits t_sobject.splits) |
|
1149 |
apply (rule conjI, rule notI, simp add:same_inode_files_prop9) |
|
1150 |
apply (rule impI, simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted) |
|
1151 |
apply (rule_tac x = obj in exI) |
|
1152 |
apply (simp add:co2sobj_closefd is_file_simps) |
|
1153 |
apply (rule notI, simp add:same_inode_files_prop9) |
|
1154 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1155 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_dir_simps) |
|
1156 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1157 |
||
1158 |
apply (erule disjE) |
|
1159 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE) |
|
1160 |
apply (rule_tac x = "O_file f'a" in exI) |
|
1161 |
apply (frule same_inode_files_prop11) |
|
1162 |
apply (frule_tac obj = "O_file f'a" in co2sobj_closefd) |
|
1163 |
apply (simp add:alive_simps)+ |
|
1164 |
apply (frule_tac f = "f'a" in is_file_has_sfile', simp, erule exE) |
|
1165 |
apply (simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted split:if_splits) |
|
1166 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1167 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1168 |
apply (erule disjE) |
|
1169 |
apply (rule_tac x = "O_proc p" in exI) |
|
1170 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1171 |
apply (erule conjE, erule exE, erule conjE) |
|
1172 |
apply (case_tac "obj = O_proc p") |
|
1173 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1174 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1175 |
apply (rule_tac x = obj in exI) |
|
1176 |
apply (simp add:co2sobj_closefd) |
|
1177 |
apply (case_tac "f \<in> same_inode_files s a") |
|
1178 |
apply (rule_tac x = "O_file f'" in exI) |
|
1179 |
apply (simp add:co2sobj_simps is_file_simps split:if_splits option.splits t_sobject.splits) |
|
1180 |
apply (rule conjI, rule notI, simp add:same_inode_files_prop9) |
|
1181 |
apply (rule impI, simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted) |
|
1182 |
apply (rule_tac x = obj in exI) |
|
1183 |
apply (simp add:co2sobj_closefd is_file_simps) |
|
1184 |
apply (rule notI, simp add:same_inode_files_prop9) |
|
1185 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1186 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_dir_simps) |
|
1187 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1188 |
||
1189 |
apply (rule impI, rule conjI, rule impI) |
|
1190 |
apply (tactic {*my_seteq_tac 1*}) |
|
53 | 1191 |
apply (simp add:update_s2ss_obj_def update_s2ss_sfile_del_def) |
48 | 1192 |
apply (rule conjI| rule impI|erule exE|erule conjE)+ |
1193 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1194 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1195 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1196 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1197 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1198 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1199 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, clarsimp simp:alive_simps split:if_splits) |
|
1200 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1201 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1202 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1203 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1204 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1205 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1206 |
apply (rule conjI| rule impI|erule exE|erule conjE)+ |
|
1207 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1208 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1209 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1210 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1211 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1212 |
apply (rule notI, simp, erule_tac x = "O_proc pa" in allE, simp add:co2sobj_closefd) |
|
1213 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1214 |
apply (case_tac "f \<in> same_inode_files s a", rule disjI2) |
|
1215 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits) |
|
1216 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop) |
|
1217 |
apply (erule bexE, erule conjE) |
|
1218 |
apply (rule conjI, rule_tac x = "O_file f''" in exI) |
|
1219 |
apply (simp add:same_inode_files_prop11 co2sobj.simps tainted_eq_Tainted cf2sfiles_prop same_inodes_Tainted) |
|
1220 |
apply (rule notI, simp) |
|
1221 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1222 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1223 |
apply (rule notI, simp add:co2sobj.simps) |
|
1224 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1225 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1226 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1227 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1228 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1229 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1230 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1231 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1232 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1233 |
||
1234 |
apply (erule bexE, erule conjE) |
|
1235 |
apply (simp add:update_s2ss_obj_def split:if_splits) |
|
1236 |
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1237 |
apply (erule exE, erule conjE) |
|
1238 |
apply (case_tac "obj = O_proc p") |
|
1239 |
apply (rule_tac x = obj' in exI) |
|
1240 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd) |
|
1241 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1242 |
apply (case_tac "obj = O_file a") |
|
1243 |
apply (rule_tac x = "O_file f'" in exI) |
|
1244 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd, simp add:alive_simps same_inode_files_prop11) |
|
1245 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
1246 |
apply (rule conjI) |
|
1247 |
apply (rule impI) |
|
1248 |
apply (rule_tac x = f' in ballE, simp, simp, simp) |
|
1249 |
apply (simp add:same_inode_files_prop11 co2sobj.simps cf2sfiles_prop same_inodes_Tainted) |
|
1250 |
apply (rule_tac x = obj in exI) |
|
1251 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
1252 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1253 |
apply (auto simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1254 |
apply (erule disjE, rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1255 |
apply (erule conjE, erule exE, erule conjE) |
|
1256 |
apply (case_tac "obj = O_proc p") |
|
1257 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1258 |
apply (case_tac "obj = O_file a") |
|
1259 |
apply (rule_tac x = "O_file f'" in exI) |
|
1260 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd, simp add:alive_simps same_inode_files_prop11) |
|
1261 |
apply (simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
1262 |
apply (rule conjI) |
|
1263 |
apply (rule impI) |
|
1264 |
apply (rule_tac x = f' in ballE, simp, simp, simp) |
|
1265 |
apply (simp add:same_inode_files_prop11 co2sobj.simps cf2sfiles_prop same_inodes_Tainted) |
|
1266 |
apply (rule_tac x = obj in exI) |
|
1267 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
1268 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1269 |
apply (auto simp add:alive_simps co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1270 |
||
1271 |
apply (rule impI) |
|
1272 |
apply (tactic {*my_seteq_tac 1*}) |
|
53 | 1273 |
apply (simp add:update_s2ss_obj_def update_s2ss_sfile_del_def) |
48 | 1274 |
apply (rule conjI| rule impI|erule exE|erule conjE)+ |
1275 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1276 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1277 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1278 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1279 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1280 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1281 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, clarsimp simp:alive_simps split:if_splits) |
|
1282 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1283 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1284 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1285 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1286 |
apply (rule disjI2, rule_tac x = obj in exI) |
|
1287 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1288 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, rule notI, simp) |
|
1289 |
apply (frule_tac obj = obj in co2sobj_sfile_imp, erule exE, simp add:is_file_simps split:if_splits) |
|
1290 |
apply (erule_tac x= f in allE, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1291 |
apply (rule conjI| rule impI|erule exE|erule conjE)+ |
|
1292 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1293 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1294 |
apply (rule disjI2, rule notI, simp) |
|
1295 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI) |
|
1296 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1297 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1298 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1299 |
apply (case_tac "f = a", simp add:alive_simps) |
|
49 | 1300 |
apply (case_tac "f \<in> same_inode_files s a", rule disjI1) |
48 | 1301 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits) |
1302 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop) |
|
1303 |
apply (erule bexE, erule conjE) |
|
49 | 1304 |
apply (erule_tac x = f'' in ballE, simp, simp) |
1305 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI) |
|
1306 |
apply (simp add:is_file_simps co2sobj_closefd tainted_eq_Tainted) |
|
1307 |
apply (rule notI, simp add:co2sobj_closefd) |
|
1308 |
apply (erule_tac x = f in allE, simp add:is_file_simps co2sobj.simps tainted_eq_Tainted) |
|
1309 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI) |
|
48 | 1310 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
49 | 1311 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
1312 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI) |
|
1313 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1314 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1315 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI) |
|
48 | 1316 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
1317 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
49 | 1318 |
apply (rule impI, rule conjI, rule impI) |
1319 |
||
1320 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1321 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1322 |
apply (rule notI, simp) |
|
1323 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1324 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1325 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1326 |
apply (erule_tac x = obj in allE, simp add:co2sobj_closefd) |
|
1327 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1328 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1329 |
apply (case_tac "f \<in> same_inode_files s a", rule conjI, rule disjI2, rule conjI) |
|
1330 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits) |
|
1331 |
apply (simp add:co2sobj.simps) |
|
1332 |
apply (rule notI, simp add:co2sobj.simps) |
|
1333 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1334 |
apply (simp add:is_file_simps co2sobj_closefd tainted_eq_Tainted) |
|
1335 |
apply (rule notI, simp add:co2sobj.simps) |
|
1336 |
apply (rule notI, simp add:co2sobj_closefd tainted_eq_Tainted) |
|
1337 |
apply (erule_tac x = f in allE, simp add:is_file_simps co2sobj.simps tainted_eq_Tainted) |
|
1338 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
48 | 1339 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
49 | 1340 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+ |
1341 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1342 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1343 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+ |
|
1344 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
48 | 1345 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
49 | 1346 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+ |
1347 |
apply (rule impI) |
|
1348 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1349 |
apply (case_tac "pa = p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1350 |
apply (rule disjI2, rule notI, simp) |
|
1351 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1352 |
apply (frule_tac obj = obj in co2sobj_closefd, simp) |
|
1353 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1354 |
apply (erule_tac x = obj in allE, simp add:co2sobj_closefd) |
|
48 | 1355 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
49 | 1356 |
apply (case_tac "f = a", simp add:alive_simps) |
1357 |
apply (case_tac "f \<in> same_inode_files s a", rule disjI1) |
|
1358 |
apply (simp add:co2sobj_closefd split:if_splits option.splits t_sobject.splits) |
|
1359 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_Tainted tainted_eq_Tainted) |
|
1360 |
apply (erule bexE, erule conjE, erule_tac x = "f''" in ballE, simp, simp) |
|
1361 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1362 |
apply (simp add:is_file_simps co2sobj_closefd tainted_eq_Tainted) |
|
1363 |
apply (rule notI, simp add:co2sobj.simps) |
|
1364 |
apply (rule notI, simp add:co2sobj_closefd tainted_eq_Tainted) |
|
1365 |
apply (erule_tac x = f in allE, simp add:is_file_simps co2sobj.simps tainted_eq_Tainted) |
|
1366 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1367 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1368 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+ |
|
1369 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1370 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1371 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+ |
|
1372 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1373 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:alive_simps) |
|
1374 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+ |
|
48 | 1375 |
|
53 | 1376 |
apply (simp add:update_s2ss_sfile_del_def update_s2ss_obj_def split:if_splits) |
49 | 1377 |
apply (erule conjE, erule disjE) |
1378 |
apply (rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1379 |
apply (erule exE, erule conjE) |
|
1380 |
apply (case_tac "obj = O_file a", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1381 |
apply (case_tac "obj = O_proc p") |
|
1382 |
apply (rule_tac x = obj' in exI, frule_tac obj = obj' in co2sobj_sproc_imp, erule exE) |
|
1383 |
apply (frule_tac obj = obj' in alive_co2sobj_closefd3, simp+) |
|
1384 |
apply (simp add:co2sobj_closefd) |
|
1385 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1386 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
1387 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1388 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1389 |
apply (erule conjE|erule exE|erule disjE)+ |
|
1390 |
apply (rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1391 |
apply (erule conjE, erule exE, erule conjE) |
|
1392 |
apply (case_tac "obj = O_file a", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1393 |
apply (case_tac "obj = O_proc p") |
|
1394 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1395 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
|
1396 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1397 |
apply (auto simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits)[1] |
|
1398 |
apply (erule conjE|erule exE|erule disjE)+ |
|
1399 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE) |
|
1400 |
apply (rule_tac x = "O_file f'" in exI) |
|
1401 |
apply (frule same_inode_files_prop11) |
|
1402 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd) |
|
1403 |
apply (simp add:alive_simps)+ |
|
1404 |
apply (frule_tac f = "f'" in is_file_has_sfile', simp, erule exE) |
|
1405 |
apply (simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted split:if_splits) |
|
1406 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1407 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1408 |
apply (erule conjE, erule disjE) |
|
1409 |
apply (rule_tac x = "O_proc p" in exI) |
|
1410 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
48 | 1411 |
apply (erule exE, erule conjE) |
1412 |
apply (case_tac "obj = O_proc p") |
|
49 | 1413 |
apply (rule_tac x = "obj'" in exI, simp, frule_tac obj = obj' in co2sobj_sproc_imp, erule exE) |
1414 |
apply (frule_tac obj = obj' in alive_co2sobj_closefd3, simp+) |
|
1415 |
apply (simp add:co2sobj_closefd tainted_eq_Tainted) |
|
48 | 1416 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
49 | 1417 |
apply (case_tac "obj = O_file a", simp add:co2sobj.simps tainted_eq_Tainted) |
48 | 1418 |
apply (frule_tac obj = obj in alive_co2sobj_closefd3, simp+) |
49 | 1419 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
1420 |
apply (rule_tac x = obj in exI) |
|
1421 |
apply (simp add:co2sobj_closefd) |
|
1422 |
apply (case_tac "f = a", simp add:alive_simps) |
|
1423 |
apply (case_tac "f \<in> same_inode_files s a") |
|
1424 |
apply (simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted) |
|
1425 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1426 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1427 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1428 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1429 |
apply (erule disjE) |
|
1430 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE) |
|
1431 |
apply (rule_tac x = "O_file f'" in exI) |
|
1432 |
apply (frule same_inode_files_prop11) |
|
1433 |
apply (frule_tac obj = "O_file f'" in co2sobj_closefd) |
|
1434 |
apply (simp add:alive_simps)+ |
|
1435 |
apply (frule_tac f = "f'" in is_file_has_sfile', simp, erule exE) |
|
1436 |
apply (simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted split:if_splits) |
|
1437 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1438 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp) |
|
1439 |
apply (erule conjE, erule disjE) |
|
1440 |
apply (rule_tac x = "O_proc p" in exI) |
|
1441 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1442 |
apply (erule conjE, erule exE, erule conjE) |
|
1443 |
apply (case_tac "obj = O_proc p", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1444 |
apply (case_tac "obj = O_file a", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1445 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1446 |
apply (rule_tac x = obj in exI) |
|
1447 |
apply (simp add:co2sobj_closefd) |
|
1448 |
apply (case_tac "f \<in> same_inode_files s a") |
|
1449 |
apply (simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted) |
|
1450 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_file_simps) |
|
1451 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
1452 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_dir_simps) |
|
1453 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd) |
|
47 | 1454 |
|
1455 |
apply (rule impI) |
|
1456 |
apply (simp add:update_s2ss_obj_def) |
|
1457 |
apply (rule conjI, rule impI, erule exE, erule conjE) |
|
1458 |
apply (simp add:s2ss_def) |
|
1459 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE) |
|
1460 |
apply (simp) |
|
1461 |
apply (case_tac "obj = O_proc p") |
|
1462 |
apply (simp add:co2sobj.simps tainted_eq_Tainted split:if_splits) |
|
1463 |
apply (rule disjI2, rule_tac x = obj in exI, erule conjE) |
|
1464 |
apply (simp add:alive_co2sobj_closefd') |
|
1465 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp split:t_object.splits if_splits) |
|
1466 |
apply (simp, erule disjE) |
|
1467 |
apply (rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1468 |
apply (erule exE, erule conjE) |
|
1469 |
apply (case_tac "obj = O_proc p") |
|
1470 |
apply (rule_tac x = obj' in exI, simp add:alive_co2sobj_closefd1) |
|
1471 |
apply (frule_tac obj = obj' in co2sobj_closefd, simp add:alive_co2sobj_closefd1) |
|
1472 |
apply (clarsimp split:t_object.splits if_splits option.splits simp:tainted_eq_Tainted co2sobj.simps) |
|
1473 |
apply (rule_tac x = obj in exI, simp add:alive_co2sobj_closefd1) |
|
1474 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:alive_co2sobj_closefd1) |
|
1475 |
apply (clarsimp split:t_object.splits if_splits option.splits simp:tainted_eq_Tainted co2sobj.simps) |
|
1476 |
apply (rule impI) |
|
1477 |
apply (simp add:s2ss_def) |
|
1478 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE) |
|
1479 |
apply (simp) |
|
1480 |
apply (case_tac "obj = O_proc p") |
|
1481 |
apply (rule disjI1, simp add:co2sobj.simps tainted_eq_Tainted split:if_splits) |
|
1482 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp add:alive_co2sobj_closefd') |
|
1483 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:alive_co2sobj_closefd1) |
|
1484 |
apply (clarsimp split:t_object.splits if_splits option.splits simp:tainted_eq_Tainted co2sobj.simps) |
|
1485 |
apply (rule notI, erule_tac x = obj in allE, simp add:alive_co2sobj_closefd') |
|
1486 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:alive_co2sobj_closefd1) |
|
1487 |
apply (clarsimp split:t_object.splits if_splits option.splits) |
|
1488 |
apply (simp) |
|
1489 |
apply (erule disjE) |
|
1490 |
apply (rule_tac x = "O_proc p" in exI, simp add:co2sobj.simps tainted_eq_Tainted) |
|
1491 |
apply (erule exE|erule conjE)+ |
|
1492 |
apply (rule_tac x = obj in exI) |
|
1493 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:alive_co2sobj_closefd1) |
|
1494 |
apply (clarsimp split:t_object.splits if_splits option.splits |
|
1495 |
simp:tainted_eq_Tainted co2sobj.simps alive_co2sobj_closefd1) |
|
1496 |
done |
|
1497 |
||
50 | 1498 |
lemma alive_co2sobj_unlink: |
1499 |
"\<lbrakk>alive s obj; valid (UnLink p f # s); obj \<noteq> O_file f\<rbrakk> |
|
1500 |
\<Longrightarrow> alive (UnLink p f # s) obj" |
|
1501 |
by (auto simp add:alive_simps split:t_object.splits) |
|
1502 |
||
1503 |
lemma s2ss_unlink: |
|
1504 |
"valid (UnLink p f # s) \<Longrightarrow> s2ss (UnLink p f # s) = ( |
|
1505 |
if (proc_fd_of_file s f = {}) |
|
1506 |
then (case (cf2sfile s f) of |
|
1507 |
Some sf \<Rightarrow> del_s2ss_file s (s2ss s) f sf |
|
1508 |
| _ \<Rightarrow> {}) |
|
1509 |
else s2ss s)" |
|
1510 |
apply (frule vd_cons, frule vt_grant_os, clarsimp split:if_splits) |
|
1511 |
apply (frule is_file_has_sfile', simp, erule exE, simp) |
|
1512 |
apply (rule conjI, rule impI) |
|
53 | 1513 |
apply (simp add:update_s2ss_sfile_del_def del_s2ss_file_def) |
50 | 1514 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ defer |
1515 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ |
|
1516 |
||
1517 |
apply (simp add:s2ss_def) |
|
1518 |
apply (tactic {*my_seteq_tac 1*}) |
|
1519 |
apply (case_tac "obj = O_file f", simp add:is_file_simps) |
|
1520 |
apply simp |
|
1521 |
apply (rule conjI) |
|
1522 |
apply (rule_tac x = obj in exI,simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits) |
|
1523 |
apply (simp add:co2sobj.simps) |
|
1524 |
apply (simp add:co2sobj.simps) |
|
1525 |
apply (rule notI, simp, frule_tac obj = obj in co2sobj_sfile_imp, erule exE, simp) |
|
1526 |
apply (frule_tac obj = obj in co2sobj_unlink, simp) |
|
1527 |
apply (erule_tac x = fa in allE, simp add:is_file_simps) |
|
1528 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1529 |
apply (tactic {*my_setiff_tac 1*}) |
|
1530 |
apply (case_tac "obj = O_file f", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1531 |
apply (frule_tac alive_co2sobj_unlink, simp, simp) |
|
1532 |
apply (frule_tac obj = obj in co2sobj_unlink, simp) |
|
1533 |
apply (rule_tac x = obj in exI) |
|
1534 |
apply (simp add:co2sobj.simps tainted_eq_Tainted split:t_object.splits if_splits) |
|
1535 |
||
1536 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ defer |
|
1537 |
||
1538 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ |
|
1539 |
apply (simp add:s2ss_def) |
|
1540 |
apply (tactic {*my_seteq_tac 1*}) |
|
1541 |
apply (case_tac "obj = O_file f", simp add:alive_simps) |
|
1542 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1543 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1544 |
apply (simp add:co2sobj_unlink) |
|
1545 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1546 |
apply (rule disjI1) |
|
1547 |
apply (simp add:co2sobj_unlink) |
|
1548 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop split:if_splits) |
|
1549 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp) |
|
1550 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1551 |
apply (simp add:co2sobj_unlink is_file_simps) |
|
1552 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1553 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps) |
|
1554 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1555 |
apply (tactic {*my_setiff_tac 1*}) |
|
1556 |
apply (drule same_inode_files_prop10, simp, erule exE, erule conjE) |
|
1557 |
apply (rule_tac x = "O_file f'a" in exI, simp add:is_file_simps) |
|
1558 |
apply (frule_tac obj = "O_file f'a" in co2sobj_unlink, simp add:same_inode_files_prop11 is_file_simps) |
|
1559 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop |
|
1560 |
is_file_simps same_inode_files_prop11 split:if_splits) |
|
1561 |
apply (rule impI, erule bexE, erule_tac x = f'' in ballE, simp, simp) |
|
1562 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp) |
|
1563 |
||
1564 |
apply (tactic {*my_setiff_tac 1*}) |
|
1565 |
apply (case_tac "f' = f", simp add:same_inode_files_prop9) |
|
1566 |
apply (case_tac "obj= O_file f") |
|
1567 |
apply (rule_tac x = "O_file f'" in exI, simp add:is_file_simps) |
|
1568 |
apply (frule_tac f' = f' in cf2sfiles_unlink, simp add:current_files_simps is_file_in_current) |
|
1569 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1570 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1571 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1572 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1573 |
apply (rule_tac x = "O_file f'" in exI) |
|
1574 |
apply (frule_tac f' = f' in cf2sfiles_unlink, simp add:current_files_simps is_file_in_current) |
|
1575 |
apply (simp add:co2sobj.simps tainted_eq_Tainted is_file_simps cf2sfiles_prop same_inodes_Tainted) |
|
1576 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps) |
|
1577 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1578 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps) |
|
1579 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1580 |
||
1581 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ defer |
|
1582 |
||
1583 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ |
|
1584 |
apply (simp add:s2ss_def) |
|
1585 |
apply (tactic {*my_seteq_tac 1*}) |
|
1586 |
apply (case_tac "obj = O_file f", simp add:alive_simps, simp) |
|
1587 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1588 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI) |
|
1589 |
apply (simp add:co2sobj_unlink) |
|
1590 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1591 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1592 |
apply (rule disjI1) |
|
1593 |
apply (simp add:co2sobj_unlink) |
|
1594 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop split:if_splits) |
|
1595 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp) |
|
1596 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI) |
|
1597 |
apply (simp add:co2sobj_unlink is_file_simps) |
|
1598 |
apply (rule notI, simp add:co2sobj_unlink tainted_eq_Tainted) |
|
1599 |
apply (erule_tac x = fa in allE, simp add:co2sobj.simps is_file_simps tainted_eq_Tainted) |
|
1600 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1601 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1602 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps) |
|
1603 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1604 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1605 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1606 |
apply (tactic {*my_setiff_tac 1*}) |
|
1607 |
apply (drule same_inode_files_prop10, simp, erule exE, erule conjE) |
|
1608 |
apply (rule_tac x = "O_file f'" in exI, simp add:is_file_simps) |
|
1609 |
apply (frule_tac obj = "O_file f'" in co2sobj_unlink, simp add:same_inode_files_prop11 is_file_simps) |
|
1610 |
apply (simp add:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop |
|
1611 |
is_file_simps same_inode_files_prop11 split:if_splits) |
|
1612 |
apply (rule impI, erule bexE, erule_tac x = f'' in ballE, simp, simp) |
|
1613 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp) |
|
1614 |
apply (tactic {*my_setiff_tac 1*}, simp) |
|
1615 |
apply (case_tac "obj = O_file f", simp add:co2sobj.simps tainted_eq_Tainted) |
|
1616 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1617 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1618 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1619 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_Tainted tainted_eq_Tainted) |
|
1620 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps) |
|
1621 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1622 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps) |
|
1623 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1624 |
||
51 | 1625 |
apply (rule impI) |
1626 |
apply (simp add:s2ss_def) |
|
1627 |
apply (tactic {*my_seteq_tac 1*}) |
|
1628 |
apply (rule_tac x = obj in exI) |
|
1629 |
apply (simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits) |
|
1630 |
apply (simp add:co2sobj.simps) |
|
1631 |
apply (simp add:co2sobj.simps) |
|
1632 |
apply (tactic {*my_setiff_tac 1*}) |
|
1633 |
apply (rule_tac x = obj in exI) |
|
1634 |
apply (subgoal_tac "alive (UnLink p f # s) obj") |
|
1635 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits)[1] |
|
1636 |
apply (auto simp add:co2sobj_unlink alive_simps split:t_object.splits)[1] |
|
50 | 1637 |
|
51 | 1638 |
apply (simp add:s2ss_def) |
1639 |
apply (tactic {*my_seteq_tac 1*}) |
|
1640 |
apply (case_tac "obj = O_file f", simp add:alive_simps) |
|
1641 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits) |
|
1642 |
apply (simp add:co2sobj.simps) |
|
1643 |
apply (simp add:co2sobj.simps) |
|
1644 |
apply (tactic {*my_setiff_tac 1*}) |
|
1645 |
apply (case_tac "obj = O_file f") |
|
1646 |
apply (rule_tac x = "O_file f'" in exI) |
|
1647 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits)[1] |
|
1648 |
apply (rule_tac x =obj in exI) |
|
1649 |
apply (subgoal_tac "alive (UnLink p f # s) obj") |
|
1650 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits)[1] |
|
1651 |
apply (auto simp add:co2sobj_unlink alive_simps split:t_object.splits)[1] |
|
1652 |
||
1653 |
apply (simp add:s2ss_def) |
|
1654 |
apply (tactic {*my_seteq_tac 1*}) |
|
1655 |
apply (case_tac "obj = O_file f", simp add:alive_simps) |
|
1656 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits if_splits) |
|
1657 |
apply (simp add:co2sobj.simps) |
|
1658 |
apply (simp add:co2sobj.simps) |
|
1659 |
apply (tactic {*my_setiff_tac 1*}) |
|
1660 |
apply (case_tac "obj = O_file f") |
|
1661 |
apply (rule_tac x = "O_file f'" in exI) |
|
1662 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps same_inode_files_prop9 split:t_object.splits)[1] |
|
1663 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1664 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1665 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1666 |
apply (rule_tac x = "O_file f'" in exI) |
|
1667 |
apply (simp add:alive_simps co2sobj.simps) |
|
1668 |
apply (rule conjI, rule notI, simp add:same_inode_files_prop9) |
|
1669 |
apply (rule impI, frule_tac f' = f' in cf2sfiles_unlink) |
|
1670 |
apply (simp add:current_files_simps is_file_simps is_file_in_current) |
|
1671 |
apply (simp add:tainted_eq_Tainted same_inodes_Tainted cf2sfiles_prop) |
|
1672 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps) |
|
1673 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1674 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps) |
|
1675 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1676 |
||
1677 |
apply (simp add:s2ss_def) |
|
1678 |
apply (tactic {*my_seteq_tac 1*}) |
|
1679 |
apply (case_tac "obj = O_file f", simp add:alive_simps) |
|
1680 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_object.splits if_splits) |
|
1681 |
apply (simp add:co2sobj.simps) |
|
1682 |
apply (simp add:co2sobj.simps) |
|
1683 |
apply (tactic {*my_setiff_tac 1*}) |
|
1684 |
apply (case_tac "obj = O_file f") |
|
1685 |
apply (rule_tac x = "O_file f'" in exI) |
|
1686 |
apply (subgoal_tac "alive (UnLink p f # s) (O_file f')") |
|
1687 |
apply (frule same_inode_files_prop11, frule_tac f = f' in is_file_has_sfile', simp add:vd_cons, erule exE) |
|
1688 |
apply (frule_tac obj = "O_file f'" in co2sobj_unlink, simp) |
|
1689 |
apply (simp split:if_splits option.splits add:is_file_simps) |
|
1690 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_Tainted tainted_eq_Tainted) |
|
1691 |
apply (auto split:t_sobject.splits)[1] |
|
1692 |
apply (simp add:is_file_simps same_inode_files_prop11) |
|
1693 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1694 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1695 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1696 |
apply (rule_tac x = "O_file f'" in exI) |
|
1697 |
apply (subgoal_tac "alive (UnLink p f # s) (O_file f')") |
|
1698 |
apply (frule same_inode_files_prop11, frule_tac f = f' in is_file_has_sfile', simp add:vd_cons, erule exE) |
|
1699 |
apply (frule_tac obj = "O_file f'" in co2sobj_unlink, simp) |
|
1700 |
apply (simp split:if_splits option.splits add:is_file_simps) |
|
1701 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_Tainted tainted_eq_Tainted) |
|
1702 |
apply (auto split:t_sobject.splits)[1] |
|
1703 |
apply (simp add:is_file_simps same_inode_files_prop11) |
|
1704 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps) |
|
1705 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1706 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps) |
|
1707 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink) |
|
1708 |
done |
|
1709 |
||
1710 |
definition del_s2ss_obj :: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_object \<Rightarrow> t_sobject \<Rightarrow> t_static_state" |
|
1711 |
where |
|
1712 |
"del_s2ss_obj s ss obj sobj \<equiv> |
|
1713 |
if (\<exists> obj'. alive s obj' \<and> obj' \<noteq> obj \<and> co2sobj s obj' = Some sobj) |
|
1714 |
then ss |
|
1715 |
else ss - {sobj}" |
|
1716 |
||
1717 |
lemma del_update_s2ss_obj: |
|
1718 |
"update_s2ss_obj s ss obj sobj sobj' = del_s2ss_obj s ss obj sobj \<union> {sobj'}" |
|
1719 |
by (auto simp:update_s2ss_obj_def del_s2ss_obj_def split:if_splits) |
|
1720 |
||
1721 |
lemma s2ss_rmdir: "valid (Rmdir p f # s) \<Longrightarrow> s2ss (Rmdir p f # s) = ( |
|
1722 |
case (co2sobj s (O_dir f)) of |
|
1723 |
Some sdir \<Rightarrow> del_s2ss_obj s (s2ss s) (O_dir f) sdir |
|
1724 |
| _ \<Rightarrow> {})" |
|
1725 |
apply (frule vd_cons, frule vt_grant_os) |
|
1726 |
apply (clarsimp simp:dir_is_empty_def) |
|
1727 |
apply (frule is_dir_has_sdir', simp, erule exE) |
|
1728 |
apply (simp split:option.splits, rule conjI, rule impI, simp add:co2sobj.simps) |
|
1729 |
apply (rule allI, rule impI) |
|
1730 |
||
1731 |
apply (simp add:del_s2ss_obj_def) |
|
1732 |
apply (rule conjI|rule impI|erule exE|erule conjE)+ |
|
1733 |
apply (simp add:s2ss_def) |
|
1734 |
apply (tactic {*my_seteq_tac 1*}) |
|
1735 |
apply (rule_tac x = obj in exI) |
|
1736 |
apply (simp add:co2sobj_rmdir is_file_simps is_dir_simps alive_simps split:t_object.splits if_splits) |
|
1737 |
apply (tactic {*my_setiff_tac 1*}) |
|
1738 |
apply (case_tac "obj = O_dir f") |
|
1739 |
apply (rule_tac x = obj' in exI) |
|
1740 |
apply (subgoal_tac "alive (Rmdir p f # s) obj'") |
|
1741 |
apply (auto simp add:co2sobj_rmdir is_file_simps is_dir_simps split:t_object.splits)[1] |
|
1742 |
apply (simp add:alive_rmdir) |
|
1743 |
apply (rule_tac x = obj in exI) |
|
1744 |
apply (subgoal_tac "alive (Rmdir p f # s) obj") |
|
1745 |
apply (auto simp add:co2sobj_rmdir is_file_simps is_dir_simps split:t_object.splits)[1] |
|
1746 |
apply (simp add:alive_rmdir) |
|
1747 |
||
1748 |
apply (rule conjI|rule impI|erule exE|erule conjE)+ |
|
1749 |
apply (simp add:s2ss_def) |
|
1750 |
apply (tactic {*my_seteq_tac 1*}) |
|
1751 |
apply simp |
|
1752 |
apply (case_tac "obj = O_dir f", simp add:alive_rmdir) |
|
1753 |
apply (rule conjI) |
|
1754 |
apply (rule_tac x = obj in exI, simp add:co2sobj_rmdir alive_rmdir) |
|
1755 |
apply (simp add:co2sobj_rmdir) |
|
1756 |
apply (simp add:alive_rmdir, erule_tac x = obj in allE, simp) |
|
1757 |
apply (tactic {*my_setiff_tac 1*}, simp) |
|
1758 |
apply (case_tac "obj = O_dir f", simp) |
|
1759 |
apply (rule_tac x = obj in exI, simp add:co2sobj_rmdir alive_rmdir) |
|
1760 |
done |
|
50 | 1761 |
|
52 | 1762 |
lemma s2ss_mkdir: "valid (Mkdir p f inum # s) \<Longrightarrow> s2ss (Mkdir p f inum # s) = ( |
1763 |
case (cf2sfile (Mkdir p f inum # s) f) of |
|
1764 |
Some sf \<Rightarrow> (s2ss s) \<union> {S_dir sf} |
|
1765 |
| _ \<Rightarrow> {})" |
|
1766 |
apply (frule vt_grant_os, frule vd_cons, clarsimp) |
|
1767 |
apply (case_tac "cf2sfile (Mkdir p f inum # s) f") |
|
1768 |
apply (drule current_file_has_sfile', simp, simp add:current_files_simps, simp) |
|
50 | 1769 |
|
52 | 1770 |
apply (simp add:s2ss_def) |
1771 |
apply (tactic {*my_seteq_tac 1*}, simp) |
|
1772 |
apply (case_tac "obj = O_dir f") |
|
1773 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
1774 |
apply (rule disjI2, rule_tac x = obj in exI, simp add:co2sobj_mkdir alive_simps) |
|
1775 |
apply (tactic {*my_setiff_tac 1*}, simp) |
|
1776 |
apply (rule_tac x = "O_dir f" in exI, simp add:alive_mkdir co2sobj.simps) |
|
1777 |
apply (tactic {*my_setiff_tac 1*}) |
|
1778 |
apply (case_tac "obj = O_dir f", simp add:is_dir_in_current) |
|
1779 |
apply (rule_tac x = obj in exI, simp add:co2sobj_mkdir alive_mkdir) |
|
1780 |
done |
|
1781 |
||
53 | 1782 |
definition update_s2ss_sfile:: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> t_sfile \<Rightarrow> t_static_state" |
52 | 1783 |
where |
53 | 1784 |
"update_s2ss_sfile s ss f sf \<equiv> |
52 | 1785 |
if (\<exists> f'. is_file s f' \<and> f' \<notin> same_inode_files s f \<and> co2sobj s (O_file f') = co2sobj s (O_file f)) |
1786 |
then ss \<union> {S_file (cf2sfiles s f \<union> {sf}) (O_file f \<in> Tainted s)} |
|
1787 |
else ss - {S_file (cf2sfiles s f) (O_file f \<in> Tainted s)} |
|
1788 |
\<union> {S_file (cf2sfiles s f \<union> {sf}) (O_file f \<in> Tainted s)}" |
|
1789 |
||
1790 |
lemma s2ss_linkhard: "valid (LinkHard p f f' # s) \<Longrightarrow> s2ss (LinkHard p f f' # s) = ( |
|
1791 |
case (cf2sfile (LinkHard p f f' # s) f') of |
|
53 | 1792 |
Some sf \<Rightarrow> update_s2ss_sfile s (s2ss s) f sf |
52 | 1793 |
| _ \<Rightarrow> {})" |
1794 |
apply (frule vt_grant_os, frule vd_cons, clarsimp) |
|
1795 |
apply (split option.splits) |
|
1796 |
apply (rule conjI, rule impI, drule current_file_has_sfile', simp, simp add:current_files_simps) |
|
1797 |
apply (rule allI, rule impI) |
|
47 | 1798 |
|
53 | 1799 |
apply (simp add:update_s2ss_sfile_def) |
52 | 1800 |
apply (rule conjI, rule impI, erule exE, erule conjE, erule conjE) |
1801 |
apply (simp add:s2ss_def) |
|
1802 |
apply (tactic {*my_seteq_tac 1*}) |
|
1803 |
apply (case_tac "obj = O_file f'") |
|
1804 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard tainted_eq_Tainted |
|
1805 |
same_inode_files_linkhard split:if_splits) |
|
1806 |
apply (case_tac "O_file f' \<in> Tainted s") |
|
1807 |
apply (drule Tainted_in_current, simp, simp add:is_file_in_current alive.simps, simp) |
|
1808 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1809 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1810 |
apply (simp add:co2sobj_linkhard alive_linkhard) |
|
1811 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1812 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard tainted_eq_Tainted |
|
1813 |
same_inodes_Tainted split:if_splits) |
|
1814 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_file_simps) |
|
1815 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_linkhard) |
|
1816 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_dir_simps) |
|
1817 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_linkhard) |
|
1818 |
apply (tactic {*my_setiff_tac 1*}) |
|
1819 |
apply (rule_tac x = "O_file f" in exI) |
|
1820 |
apply (frule_tac obj = "O_file f" in co2sobj_linkhard) |
|
1821 |
apply (simp add:alive_linkhard) |
|
1822 |
apply (simp add:alive_linkhard same_inode_files_prop9 split:t_object.splits) |
|
1823 |
apply (tactic {*my_setiff_tac 1*}) |
|
1824 |
apply (case_tac "obj = O_file f'", simp add:alive_linkhard is_file_in_current) |
|
1825 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1826 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1827 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1828 |
apply (rule_tac x = "O_file f'a" in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1829 |
apply (rule conjI, rule impI, simp add:is_file_in_current) |
|
1830 |
apply (rule impI, simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted) |
|
1831 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1832 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1833 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1834 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
47 | 1835 |
|
52 | 1836 |
apply (rule impI) |
1837 |
apply (simp add:s2ss_def) |
|
1838 |
apply (tactic {*my_seteq_tac 1*}) |
|
1839 |
apply (case_tac "obj = O_file f'", simp) |
|
1840 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard tainted_eq_Tainted |
|
1841 |
same_inode_files_linkhard split:if_splits) |
|
1842 |
apply (case_tac "O_file f' \<in> Tainted s") |
|
1843 |
apply (drule Tainted_in_current, simp, simp add:is_file_in_current alive.simps, simp) |
|
1844 |
apply (erule_tac obj = obj in co2sobj_some_caseD, simp) |
|
1845 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI) |
|
1846 |
apply (simp add:co2sobj_linkhard alive_linkhard) |
|
1847 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1848 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1849 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard tainted_eq_Tainted |
|
1850 |
same_inodes_Tainted split:if_splits) |
|
1851 |
apply (simp, rule disjI2, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_file_simps) |
|
1852 |
apply (erule_tac x = fa in allE, rule notI) |
|
1853 |
apply (simp add:co2sobj_linkhard is_file_simps) |
|
1854 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
1855 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_linkhard) |
|
1856 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1857 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_dir_simps) |
|
1858 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1859 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_linkhard) |
|
1860 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1861 |
apply (tactic {*my_setiff_tac 1*}) |
|
1862 |
apply (rule_tac x = "O_file f" in exI) |
|
1863 |
apply (frule_tac obj = "O_file f" in co2sobj_linkhard) |
|
1864 |
apply (simp add:alive_linkhard) |
|
1865 |
apply (simp add:alive_linkhard same_inode_files_prop9 split:t_object.splits) |
|
1866 |
apply (tactic {*my_setiff_tac 1*}) |
|
1867 |
apply (case_tac "obj = O_file f'", simp add:alive_linkhard is_file_in_current) |
|
1868 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1869 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1870 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1871 |
apply (simp add:co2sobj.simps cf2sfiles_prop tainted_eq_Tainted same_inodes_Tainted) |
|
1872 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1873 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1874 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1875 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard alive_linkhard) |
|
1876 |
done |
|
47 | 1877 |
|
65 | 1878 |
lemma same_inode_files_prop12: |
1879 |
"is_file s f \<Longrightarrow> f \<in> same_inode_files s f " |
|
1880 |
by (auto simp:is_file_def same_inode_files_def split:option.splits) |
|
53 | 1881 |
|
1882 |
definition update_s2ss_sfile_tainted:: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> bool \<Rightarrow> t_static_state" |
|
1883 |
where |
|
1884 |
"update_s2ss_sfile_tainted s ss f tag \<equiv> |
|
1885 |
if (\<exists> f'. is_file s f' \<and> f' \<notin> same_inode_files s f \<and> |
|
1886 |
co2sobj s (O_file f') = Some (S_file (cf2sfiles s f) False)) |
|
1887 |
then ss \<union> {S_file (cf2sfiles s f) True} |
|
1888 |
else ss - {S_file (cf2sfiles s f) False} |
|
1889 |
\<union> {S_file (cf2sfiles s f) True}" |
|
1890 |
||
1891 |
lemma s2ss_truncate: "valid (Truncate p f len # s) \<Longrightarrow> s2ss (Truncate p f len # s) = ( |
|
1892 |
if (O_file f \<notin> Tainted s \<and> O_proc p \<in> Tainted s \<and> len > 0) |
|
1893 |
then update_s2ss_sfile_tainted s (s2ss s) f True |
|
1894 |
else s2ss s)" |
|
1895 |
apply (frule vt_grant_os, frule vd_cons, simp split:if_splits) |
|
1896 |
apply (rule conjI, rule impI, (erule conjE)+) |
|
1897 |
||
1898 |
apply (simp add:update_s2ss_sfile_tainted_def) |
|
1899 |
apply (rule conjI|rule impI|erule exE|erule conjE)+ |
|
1900 |
apply (simp add:s2ss_def) |
|
1901 |
apply (tactic {*my_seteq_tac 1*}) |
|
1902 |
apply (case_tac "obj = O_file f") |
|
65 | 1903 |
apply (rule disjI1, simp add:co2sobj.simps tainted_eq_Tainted same_inode_files_prop12 cf2sfiles_other) |
53 | 1904 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
1905 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_truncate alive_simps) |
|
1906 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1907 |
apply (rule disjI1, simp add:co2sobj.simps tainted_eq_Tainted cf2sfiles_prop cf2sfiles_other) |
|
1908 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1909 |
apply (simp add:co2sobj_truncate is_file_simps) |
|
1910 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1911 |
apply (simp add:co2sobj_truncate) |
|
1912 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1913 |
apply (simp add:co2sobj_truncate is_dir_simps) |
|
1914 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1915 |
apply (simp add:co2sobj_truncate) |
|
1916 |
apply (tactic {*my_setiff_tac 1*}) |
|
1917 |
apply (rule_tac x = "O_file f" in exI) |
|
65 | 1918 |
apply (simp add:co2sobj.simps is_file_simps tainted_eq_Tainted cf2sfiles_other same_inode_files_prop12) |
53 | 1919 |
apply (tactic {*my_setiff_tac 1*}) |
1920 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1921 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate) |
|
1922 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1923 |
apply (rule_tac x = "O_file f'" in exI) |
|
1924 |
apply (auto simp:co2sobj_truncate is_file_simps is_dir_simps split:t_object.splits)[1] |
|
1925 |
apply (simp add:co2sobj.simps same_inodes_Tainted tainted_eq_Tainted cf2sfiles_prop) |
|
1926 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_file_simps) |
|
1927 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate) |
|
1928 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_dir_simps) |
|
1929 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate) |
|
1930 |
||
1931 |
apply (rule conjI|rule impI|erule exE|erule conjE)+ |
|
1932 |
apply (simp add:s2ss_def) |
|
1933 |
apply (tactic {*my_seteq_tac 1*}) |
|
1934 |
apply (case_tac "obj = O_file f") |
|
65 | 1935 |
apply (rule disjI1, simp add:co2sobj.simps tainted_eq_Tainted same_inode_files_prop12 cf2sfiles_other) |
53 | 1936 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
1937 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_truncate alive_simps) |
|
1938 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1939 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1940 |
apply (rule disjI1, simp add:co2sobj.simps tainted_eq_Tainted cf2sfiles_prop cf2sfiles_other) |
|
1941 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI) |
|
1942 |
apply (simp add:co2sobj_truncate is_file_simps) |
|
1943 |
apply (rule notI, simp add:co2sobj_truncate is_file_simps) |
|
1944 |
apply (erule_tac x = fa in allE) |
|
1945 |
apply (simp add:co2sobj.simps) |
|
1946 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI) |
|
1947 |
apply (simp add:co2sobj_truncate) |
|
1948 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1949 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI) |
|
1950 |
apply (simp add:co2sobj_truncate is_dir_simps) |
|
1951 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1952 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI) |
|
1953 |
apply (simp add:co2sobj_truncate) |
|
1954 |
apply (rule notI, simp add:co2sobj.simps split:option.splits) |
|
1955 |
apply (tactic {*my_setiff_tac 1*}) |
|
1956 |
apply (rule_tac x = "O_file f" in exI) |
|
65 | 1957 |
apply (simp add:co2sobj.simps is_file_simps tainted_eq_Tainted cf2sfiles_other same_inode_files_prop12) |
53 | 1958 |
apply (tactic {*my_setiff_tac 1*}) |
1959 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
1960 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate) |
|
1961 |
apply (case_tac "fa \<in> same_inode_files s f") |
|
1962 |
apply (simp add:co2sobj.simps same_inodes_Tainted tainted_eq_Tainted cf2sfiles_prop) |
|
1963 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_file_simps) |
|
1964 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate) |
|
1965 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_dir_simps) |
|
1966 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate) |
|
1967 |
||
1968 |
apply (rule impI, simp add:s2ss_def) |
|
1969 |
apply (tactic {*my_seteq_tac 1*}) |
|
1970 |
apply (rule_tac x = obj in exI) |
|
1971 |
apply (simp add:alive_simps co2sobj_truncate) |
|
1972 |
apply (simp split:t_object.splits if_splits add:co2sobj.simps tainted_eq_Tainted) |
|
1973 |
apply (case_tac "O_proc p \<in> Tainted s", simp add:same_inodes_Tainted) |
|
1974 |
apply simp |
|
1975 |
apply (tactic {*my_setiff_tac 1*}) |
|
1976 |
apply (rule_tac x = obj in exI) |
|
1977 |
apply (simp add:alive_simps co2sobj_truncate) |
|
1978 |
apply (auto split:t_object.splits if_splits simp:co2sobj.simps tainted_eq_Tainted same_inodes_Tainted) |
|
1979 |
done |
|
1980 |
||
1981 |
lemma s2ss_createmsgq: "valid (CreateMsgq p q # s) \<Longrightarrow> s2ss (CreateMsgq p q # s) = |
|
1982 |
(case (cq2smsgq (CreateMsgq p q # s) q) of |
|
1983 |
Some sq \<Rightarrow> s2ss s \<union> {S_msgq sq} |
|
1984 |
| _ \<Rightarrow> {})" |
|
1985 |
apply (frule vd_cons, frule vt_grant_os, clarsimp) |
|
1986 |
apply (case_tac "cq2smsgq (CreateMsgq p q # s) q") |
|
1987 |
apply (drule current_has_smsgq', simp+) |
|
1988 |
apply (simp add:s2ss_def) |
|
1989 |
apply (tactic {*my_seteq_tac 1*}) |
|
1990 |
apply (case_tac "obj = O_msgq q") |
|
1991 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
1992 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
1993 |
apply (simp add:co2sobj_createmsgq is_file_simps is_dir_simps split:t_object.splits if_splits) |
|
1994 |
apply (simp add:co2sobj.simps) |
|
1995 |
apply (simp add:co2sobj.simps) |
|
1996 |
apply (tactic {*my_setiff_tac 1*}) |
|
1997 |
apply (rule_tac x = "O_msgq q" in exI, simp add:co2sobj.simps) |
|
1998 |
apply (tactic {*my_setiff_tac 1*}) |
|
1999 |
apply (case_tac "obj = O_msgq q") |
|
2000 |
apply simp |
|
2001 |
apply (rule_tac x = obj in exI) |
|
2002 |
apply (auto simp add:co2sobj_createmsgq alive_simps split:t_object.splits if_splits) |
|
2003 |
done |
|
2004 |
||
54 | 2005 |
ML {*fun my_clarify_tac i = |
2006 |
REPEAT (( rtac @{thm impI} |
|
2007 |
ORELSE' rtac @{thm allI} |
|
2008 |
ORELSE' rtac @{thm ballI} |
|
2009 |
ORELSE' rtac @{thm conjI} |
|
2010 |
ORELSE' etac @{thm conjE} |
|
2011 |
ORELSE' etac @{thm exE} |
|
2012 |
ORELSE' etac @{thm bexE} |
|
2013 |
ORELSE' etac @{thm disjE}) i) |
|
2014 |
*} |
|
2015 |
||
2016 |
lemma s2ss_sendmsg: "valid (SendMsg p q m # s) \<Longrightarrow> s2ss (SendMsg p q m # s) = ( |
|
2017 |
case (cq2smsgq s q, cq2smsgq (SendMsg p q m # s) q) of |
|
2018 |
(Some sq, Some sq') \<Rightarrow> update_s2ss_obj s (s2ss s) (O_msgq q) (S_msgq sq) (S_msgq sq') |
|
2019 |
| _ \<Rightarrow> {})" |
|
2020 |
apply (frule vd_cons, frule vt_grant_os, clarsimp) |
|
2021 |
apply (case_tac "cq2smsgq s q") |
|
2022 |
apply (drule current_has_smsgq', simp+) |
|
2023 |
apply (case_tac "cq2smsgq (SendMsg p q m # s) q") |
|
2024 |
apply (drule current_has_smsgq', simp+) |
|
2025 |
||
2026 |
apply (simp add:update_s2ss_obj_def) |
|
2027 |
apply (tactic {*my_clarify_tac 1*}) |
|
2028 |
apply (simp add:s2ss_def) |
|
2029 |
apply (tactic {*my_seteq_tac 1*}) |
|
2030 |
apply (case_tac "obj = O_msgq q") |
|
2031 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2032 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
2033 |
apply (simp add:co2sobj_sendmsg is_file_simps is_dir_simps split:t_object.splits if_splits) |
|
2034 |
apply (simp add:co2sobj.simps) |
|
2035 |
apply (simp add:co2sobj.simps) |
|
2036 |
apply (simp add:co2sobj.simps) |
|
2037 |
apply (tactic {*my_setiff_tac 1*}) |
|
2038 |
apply (rule_tac x = "O_msgq q" in exI, simp add:co2sobj.simps) |
|
2039 |
apply (tactic {*my_setiff_tac 1*}) |
|
2040 |
apply (case_tac "obj = O_msgq q") |
|
2041 |
apply (rule_tac x = obj' in exI) |
|
2042 |
apply (simp add:co2sobj_sendmsg alive_sendmsg split:t_object.splits if_splits) |
|
2043 |
apply (auto simp:co2sobj.simps)[1] |
|
2044 |
apply (rule_tac x = obj in exI, simp add:co2sobj_sendmsg alive_sendmsg split:t_object.splits) |
|
2045 |
apply (auto simp:co2sobj.simps)[1] |
|
2046 |
||
2047 |
apply (rule impI) |
|
2048 |
apply (simp add:s2ss_def) |
|
2049 |
apply (tactic {*my_seteq_tac 1*}) |
|
2050 |
apply (case_tac "obj = O_msgq q") |
|
2051 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2052 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI) |
|
2053 |
apply (simp add:co2sobj_sendmsg is_file_simps is_dir_simps split:t_object.splits if_splits) |
|
2054 |
apply (simp add:co2sobj.simps) |
|
2055 |
apply (simp add:co2sobj.simps) |
|
2056 |
apply (simp add:co2sobj.simps) |
|
2057 |
apply (rule notI, simp) |
|
2058 |
apply (frule_tac obj = obj in co2sobj_smsgq_imp, erule exE, simp) |
|
2059 |
apply (erule_tac x = obj in allE, simp add:co2sobj_sendmsg) |
|
2060 |
apply (tactic {*my_setiff_tac 1*}) |
|
2061 |
apply (rule_tac x = "O_msgq q" in exI, simp add:co2sobj.simps) |
|
2062 |
apply (tactic {*my_setiff_tac 1*}) |
|
2063 |
apply (case_tac "obj = O_msgq q") |
|
2064 |
apply (simp add:co2sobj.simps) |
|
2065 |
apply (rule_tac x = obj in exI, simp add:co2sobj_sendmsg alive_sendmsg split:t_object.splits) |
|
2066 |
apply (auto simp:co2sobj.simps)[1] |
|
2067 |
done |
|
2068 |
||
2069 |
lemma alive_co2sobj_removemsgq: |
|
2070 |
"\<lbrakk>alive s obj; valid (RemoveMsgq p q # s); co2sobj s obj = Some sobj; obj \<noteq> O_msgq q\<rbrakk> |
|
2071 |
\<Longrightarrow> alive (RemoveMsgq p q # s) obj" |
|
2072 |
apply (erule co2sobj_some_caseD) |
|
2073 |
apply (auto simp:is_file_simps is_dir_simps) |
|
2074 |
done |
|
2075 |
||
2076 |
lemma s2ss_removemsgq: "valid (RemoveMsgq p q # s) \<Longrightarrow> s2ss (RemoveMsgq p q # s) = |
|
2077 |
(case (cq2smsgq s q) of |
|
2078 |
Some sq \<Rightarrow> del_s2ss_obj s (s2ss s) (O_msgq q) (S_msgq sq) |
|
2079 |
| _ \<Rightarrow> {})" |
|
2080 |
apply (frule vd_cons, frule vt_grant_os, clarsimp) |
|
2081 |
apply (split option.splits, rule conjI, rule impI) |
|
2082 |
apply (drule current_has_smsgq', simp, simp) |
|
2083 |
apply (rule allI, rule impI) |
|
2084 |
||
2085 |
apply (simp add:del_s2ss_obj_def) |
|
2086 |
apply (tactic {*my_clarify_tac 1*}) |
|
2087 |
apply (simp add:s2ss_def) |
|
2088 |
apply (tactic {*my_seteq_tac 1*}) |
|
2089 |
apply (case_tac "obj = O_msgq q", simp) |
|
2090 |
apply (rule_tac x = obj in exI) |
|
2091 |
apply (simp add:co2sobj_removemsgq alive_simps split:t_object.splits if_splits) |
|
2092 |
apply (tactic {*my_setiff_tac 1*}) |
|
2093 |
apply (case_tac "obj = O_msgq q", simp) |
|
2094 |
apply (rule_tac x = obj' in exI) |
|
2095 |
apply (frule_tac obj = obj' in co2sobj_smsgq_imp, erule exE) |
|
2096 |
apply (simp add:co2sobj_removemsgq alive_simps split:t_object.splits if_splits) |
|
2097 |
apply (simp add:co2sobj.simps) |
|
2098 |
apply (rule_tac x = obj in exI) |
|
2099 |
apply (simp add:co2sobj_removemsgq alive_co2sobj_removemsgq) |
|
2100 |
||
2101 |
apply (rule impI) |
|
2102 |
apply (simp add:s2ss_def) |
|
2103 |
apply (tactic {*my_seteq_tac 1*}) |
|
2104 |
apply (case_tac "obj = O_msgq q", simp) |
|
2105 |
apply (simp, rule conjI, rule_tac x = obj in exI) |
|
2106 |
apply (simp add:co2sobj_removemsgq alive_simps split:t_object.splits if_splits) |
|
2107 |
apply (rule notI, simp, frule_tac obj = obj in co2sobj_smsgq_imp, erule exE) |
|
2108 |
apply (erule_tac x = obj in allE, simp add:co2sobj_removemsgq alive_co2sobj_removemsgq) |
|
2109 |
apply (tactic {*my_setiff_tac 1*}) |
|
2110 |
apply (case_tac "obj = O_msgq q", simp) |
|
2111 |
apply (simp add:co2sobj.simps) |
|
2112 |
apply (rule_tac x = obj in exI) |
|
2113 |
apply (simp add:co2sobj_removemsgq alive_co2sobj_removemsgq) |
|
2114 |
done |
|
2115 |
||
2116 |
declare Product_Type.split_paired_Ex Product_Type.split_paired_All [simp del] |
|
2117 |
||
2118 |
lemma s2ss_shm_no_bk_elim': |
|
2119 |
"\<lbrakk>x \<notin> s2ss_shm_no_backup s pfrom; co2sobj s (O_proc p) = Some x; O_proc p \<notin> Tainted s; |
|
2120 |
valid s; info_flow_shm s pfrom p\<rbrakk> |
|
2121 |
\<Longrightarrow> \<exists> p'. \<not> info_flow_shm s pfrom p' \<and> p' \<in> current_procs s \<and> co2sobj s (O_proc p') = Some x" |
|
2122 |
apply (auto simp:s2ss_shm_no_backup_def co2sobj.simps tainted_eq_Tainted split:option.splits) |
|
2123 |
apply (erule_tac x = p in allE, auto) |
|
2124 |
apply (rule_tac x = p' in exI, auto) |
|
2125 |
done |
|
2126 |
||
2127 |
lemma s2ss_recvmsg: "valid (RecvMsg p q m # s) \<Longrightarrow> s2ss (RecvMsg p q m # s) = ( |
|
2128 |
case (cq2smsgq s q, cq2smsgq (RecvMsg p q m # s) q) of |
|
2129 |
(Some sq, Some sq') \<Rightarrow> if (O_msg q m \<in> Tainted s \<and> O_proc p \<notin> Tainted s) |
|
2130 |
then update_s2ss_obj s (update_s2ss_shm s p) (O_msgq q) (S_msgq sq) (S_msgq sq') |
|
2131 |
else update_s2ss_obj s (s2ss s) (O_msgq q) (S_msgq sq) (S_msgq sq') |
|
2132 |
| _ \<Rightarrow> {})" |
|
2133 |
apply (frule vt_grant_os, frule vd_cons) |
|
2134 |
apply (case_tac "cq2smsgq s q") |
|
2135 |
apply (drule current_has_smsgq', simp, simp) |
|
2136 |
apply (case_tac "cq2smsgq (RecvMsg p q m # s) q") |
|
2137 |
apply (drule current_has_smsgq', simp, simp) |
|
2138 |
apply (simp split:if_splits add:update_s2ss_obj_def) |
|
2139 |
||
2140 |
apply (tactic {*my_clarify_tac 1*}) |
|
2141 |
unfolding s2ss_def update_s2ss_shm_def |
|
2142 |
apply (tactic {*my_seteq_tac 1*}) |
|
2143 |
apply (case_tac "obj = O_msgq q") |
|
2144 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2145 |
apply (rule disjI2) |
|
2146 |
apply (rule DiffI) |
|
2147 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2148 |
apply (case_tac "info_flow_shm s p pa") |
|
2149 |
apply (rule UnI2) |
|
2150 |
apply (simp add:co2sobj_recvmsg del:Product_Type.split_paired_Ex |
|
2151 |
split:t_object.splits option.splits) |
|
2152 |
apply (rule_tac x = ab in exI, simp, rule_tac x = pa in exI, simp) |
|
2153 |
apply (rule UnI1,simp, rule_tac x = obj in exI) |
|
2154 |
apply (simp add:co2sobj_recvmsg split:t_object.splits option.splits) |
|
2155 |
apply (rule UnI1,simp, rule_tac x = obj in exI) |
|
2156 |
apply (simp add:co2sobj_recvmsg is_file_simps split:t_object.splits option.splits) |
|
2157 |
apply (rule UnI1, simp,rule_tac x = obj in exI) |
|
2158 |
apply (simp add:co2sobj_recvmsg split:t_object.splits option.splits) |
|
2159 |
apply (rule UnI1, simp,rule_tac x = obj in exI) |
|
2160 |
apply (simp add:co2sobj_recvmsg is_dir_simps split:t_object.splits option.splits) |
|
2161 |
apply (rule UnI1, simp, rule_tac x = obj in exI) |
|
2162 |
apply (simp add:co2sobj_recvmsg split:t_object.splits option.splits if_splits) |
|
2163 |
apply (rule notI, simp add:s2ss_shm_no_backup_def del:Product_Type.split_paired_Ex) |
|
2164 |
apply (erule exE|erule conjE)+ |
|
2165 |
apply (simp, frule co2sobj_sproc_imp, erule exE, simp) |
|
2166 |
apply (simp add:co2sobj_recvmsg split:if_splits option.splits) |
|
2167 |
apply (erule_tac x = paa in allE, simp) |
|
2168 |
apply (tactic {*my_setiff_tac 1*}) |
|
2169 |
apply (rule_tac x = "O_msgq q" in exI, simp add:co2sobj.simps alive_recvmsg) |
|
2170 |
apply (tactic {*my_setiff_tac 1*}, erule UnE) |
|
2171 |
apply (tactic {*my_setiff_tac 1*}) |
|
2172 |
apply (case_tac "obj = O_msgq q") |
|
2173 |
apply (rule_tac x = obj' in exI) |
|
2174 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2175 |
split:t_object.splits if_splits option.splits) |
|
2176 |
apply (auto simp:co2sobj.simps is_file_simps is_dir_simps)[1] |
|
2177 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2178 |
apply (case_tac "info_flow_shm s p pa \<and> O_proc pa \<notin> Tainted s") |
|
2179 |
apply (drule_tac p = pa in s2ss_shm_no_bk_elim', simp+) |
|
2180 |
apply (erule exE|erule conjE)+ |
|
2181 |
apply (rule_tac x = "O_proc p'" in exI) |
|
2182 |
apply (simp add:co2sobj_recvmsg alive_simps) |
|
2183 |
apply (rule_tac x = obj in exI) |
|
2184 |
apply (case_tac "info_flow_shm s p pa", simp) |
|
2185 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2186 |
apply (case_tac "cp2sproc s pa", simp add:co2sobj.simps) |
|
2187 |
apply (simp, simp add:co2sobj.simps tainted_eq_Tainted) |
|
2188 |
apply (simp, frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2189 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg alive_simps) |
|
2190 |
apply (rule_tac x = obj in exI) |
|
2191 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp split:t_object.splits) |
|
2192 |
apply (simp split:t_object.splits) |
|
2193 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg is_dir_simps) |
|
2194 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg) |
|
2195 |
apply (tactic {*my_setiff_tac 1*}) |
|
2196 |
apply (rule_tac x = "O_proc pa" in exI) |
|
2197 |
apply (frule_tac obj = "O_proc pa" in co2sobj_recvmsg) |
|
2198 |
apply (simp add:info_shm_flow_in_procs, simp add:info_shm_flow_in_procs) |
|
2199 |
||
2200 |
apply (tactic {*my_clarify_tac 1*}) |
|
2201 |
apply (tactic {*my_seteq_tac 1*}) |
|
2202 |
apply (case_tac "obj = O_msgq q") |
|
2203 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2204 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
2205 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps split:t_object.splits if_splits option.splits) |
|
2206 |
apply (simp add:co2sobj.simps tainted_eq_Tainted info_flow_shm_Tainted) |
|
2207 |
apply (simp add:co2sobj.simps) |
|
2208 |
apply (simp add:co2sobj.simps) |
|
2209 |
apply (case_tac "msgs_of_queue s q", simp, simp) |
|
2210 |
apply (tactic {*my_setiff_tac 1*}) |
|
2211 |
apply (rule_tac x = "O_msgq q" in exI) |
|
2212 |
apply (simp add:co2sobj.simps) |
|
2213 |
apply (tactic {*my_setiff_tac 1 *}) |
|
2214 |
apply (case_tac "obj = O_msgq q") |
|
2215 |
apply (rule_tac x = obj' in exI) |
|
2216 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2217 |
split:t_object.splits if_splits option.splits) |
|
2218 |
apply (auto simp:co2sobj.simps is_file_simps is_dir_simps)[1] |
|
2219 |
apply (rule_tac x = obj in exI) |
|
2220 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2221 |
split:t_object.splits if_splits option.splits) |
|
2222 |
apply (auto simp:co2sobj.simps is_file_simps is_dir_simps tainted_eq_Tainted info_flow_shm_Tainted)[1] |
|
2223 |
||
2224 |
apply (tactic {*my_clarify_tac 1*}) |
|
2225 |
apply (tactic {*my_seteq_tac 1*}) |
|
2226 |
apply (case_tac "obj = O_msgq q") |
|
2227 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2228 |
apply (rule disjI2) |
|
2229 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2230 |
apply (case_tac "info_flow_shm s p pa") |
|
2231 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
2232 |
apply (rule DiffI, rule UnI1, simp) |
|
2233 |
apply (rule_tac x = obj in exI) |
|
2234 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2235 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
2236 |
apply (erule s2ss_shm_no_bk_intro2, simp, simp) |
|
2237 |
apply (rule DiffI, rule UnI2, rule CollectI) |
|
2238 |
apply (simp only:co2sobj.simps tainted_eq_Tainted split:option.splits, simp) |
|
2239 |
apply (rule_tac x = ab in exI, simp) |
|
2240 |
apply (rule_tac x = pa in exI, simp add:cp2sproc_other) |
|
2241 |
apply (rule s2ss_shm_no_bk_intro2, simp, simp, simp) |
|
2242 |
apply (rule DiffI, rule UnI1, simp) |
|
2243 |
apply (rule_tac x = obj in exI) |
|
2244 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2245 |
apply (rule_tac p = pa in s2ss_shm_no_bk_intro3) |
|
2246 |
apply (simp add:co2sobj_recvmsg, simp, simp) |
|
2247 |
apply (rule DiffI, rule UnI1, simp) |
|
2248 |
apply (rule_tac x = obj in exI) |
|
2249 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp add:is_file_simps split:option.splits) |
|
2250 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2251 |
apply (rule DiffI, rule UnI1, simp) |
|
2252 |
apply (rule_tac x = obj in exI) |
|
2253 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2254 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2255 |
apply (rule DiffI, rule UnI1, simp) |
|
2256 |
apply (rule_tac x = obj in exI) |
|
2257 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp add:is_dir_simps split:option.splits) |
|
2258 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2259 |
apply (rule DiffI, rule UnI1, simp) |
|
2260 |
apply (rule_tac x = obj in exI) |
|
2261 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2262 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
53 | 2263 |
|
54 | 2264 |
apply (tactic {*my_setiff_tac 1*}) |
2265 |
apply (rule_tac x = "O_msgq q" in exI) |
|
2266 |
apply (simp add:co2sobj.simps) |
|
2267 |
apply (tactic {*my_setiff_tac 1*}) |
|
2268 |
apply (erule UnE, tactic {*my_setiff_tac 1*}) |
|
2269 |
apply (case_tac "obj = O_msgq q") |
|
2270 |
apply (rule_tac x = obj' in exI) |
|
2271 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2272 |
split:t_object.splits if_splits option.splits) |
|
2273 |
apply (auto simp:co2sobj.simps is_file_simps is_dir_simps)[1] |
|
2274 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2275 |
apply (case_tac "info_flow_shm s p pa \<and> O_proc pa \<notin> Tainted s") |
|
2276 |
apply (drule_tac p = pa in s2ss_shm_no_bk_elim', simp+) |
|
2277 |
apply (erule exE|erule conjE)+ |
|
2278 |
apply (rule_tac x = "O_proc p'" in exI) |
|
2279 |
apply (simp add:co2sobj_recvmsg alive_simps) |
|
2280 |
apply (rule_tac x = obj in exI) |
|
2281 |
apply (case_tac "info_flow_shm s p pa", simp) |
|
2282 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2283 |
apply (case_tac "cp2sproc s pa", simp add:co2sobj.simps) |
|
2284 |
apply (simp, simp add:co2sobj.simps tainted_eq_Tainted) |
|
2285 |
apply (simp, frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2286 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg alive_simps) |
|
2287 |
apply (rule_tac x = obj in exI) |
|
2288 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp split:t_object.splits) |
|
2289 |
apply (simp split:t_object.splits) |
|
2290 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg is_dir_simps) |
|
2291 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg) |
|
2292 |
apply (tactic {*my_setiff_tac 1*}) |
|
2293 |
apply (rule_tac x = "O_proc pa" in exI) |
|
2294 |
apply (frule_tac obj = "O_proc pa" in co2sobj_recvmsg) |
|
2295 |
apply (simp add:info_shm_flow_in_procs, simp add:info_shm_flow_in_procs) |
|
2296 |
||
2297 |
apply (rule impI, tactic {*my_seteq_tac 1*}) |
|
2298 |
apply (case_tac "obj = O_msgq q") |
|
2299 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2300 |
apply (rule disjI2, simp, rule conjI) |
|
2301 |
apply (rule_tac x = obj in exI) |
|
2302 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2303 |
split:t_object.splits if_splits option.splits) |
|
2304 |
apply (simp add:co2sobj.simps tainted_eq_Tainted info_flow_shm_Tainted) |
|
2305 |
apply (simp add:co2sobj_recvmsg) |
|
2306 |
apply (simp add:alive_recvmsg split:if_splits) |
|
2307 |
apply (erule_tac x = obj in allE, simp split:t_object.splits if_splits option.splits) |
|
2308 |
apply (rule notI, simp add:co2sobj.simps) |
|
2309 |
apply (tactic {*my_setiff_tac 1*}) |
|
2310 |
apply (rule_tac x = "O_msgq q" in exI) |
|
2311 |
apply (simp add:co2sobj.simps) |
|
2312 |
apply (tactic {*my_setiff_tac 1*}) |
|
2313 |
apply simp |
|
2314 |
apply (tactic {*my_clarify_tac 1*}) |
|
2315 |
apply (case_tac "obj = O_msgq q") |
|
2316 |
apply (rule_tac x = obj' in exI) |
|
2317 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2318 |
split:t_object.splits if_splits option.splits) |
|
2319 |
apply (auto simp:co2sobj.simps is_file_simps is_dir_simps)[1] |
|
2320 |
apply (rule_tac x = obj in exI) |
|
2321 |
apply (frule_tac obj = obj in co2sobj_recvmsg) |
|
2322 |
apply (simp add:alive_recvmsg, rule notI, simp add:co2sobj.simps) |
|
2323 |
apply (rule conjI) |
|
2324 |
apply (simp add:alive_recvmsg, rule notI, simp add:co2sobj.simps) |
|
2325 |
apply (auto simp:co2sobj.simps tainted_eq_Tainted split:t_object.splits option.splits if_splits)[1] |
|
2326 |
||
2327 |
apply (tactic {*my_clarify_tac 1*}) |
|
2328 |
apply (tactic {*my_seteq_tac 1*}) |
|
2329 |
apply (case_tac "obj = O_msgq q") |
|
2330 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2331 |
apply (rule disjI2) |
|
2332 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2333 |
apply (case_tac "info_flow_shm s p pa") |
|
2334 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
2335 |
apply (rule DiffI, rule UnI1, simp) |
|
2336 |
apply (rule_tac x = obj in exI) |
|
2337 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2338 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
2339 |
apply (erule s2ss_shm_no_bk_intro2, simp, simp) |
|
2340 |
apply (rule DiffI, rule UnI2, rule CollectI) |
|
2341 |
apply (simp only:co2sobj.simps tainted_eq_Tainted split:option.splits, simp) |
|
2342 |
apply (rule_tac x = ab in exI, simp) |
|
2343 |
apply (rule_tac x = pa in exI, simp add:cp2sproc_other) |
|
2344 |
apply (rule s2ss_shm_no_bk_intro2, simp, simp, simp) |
|
2345 |
apply (rule DiffI, rule UnI1, simp) |
|
2346 |
apply (rule_tac x = obj in exI) |
|
2347 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2348 |
apply (rule_tac p = pa in s2ss_shm_no_bk_intro3) |
|
2349 |
apply (simp add:co2sobj_recvmsg, simp, simp) |
|
2350 |
apply (rule DiffI, rule UnI1, simp) |
|
2351 |
apply (rule_tac x = obj in exI) |
|
2352 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp add:is_file_simps split:option.splits) |
|
2353 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2354 |
apply (rule DiffI, rule UnI1, simp) |
|
2355 |
apply (rule_tac x = obj in exI) |
|
2356 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2357 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2358 |
apply (rule DiffI, rule UnI1, simp) |
|
2359 |
apply (rule_tac x = obj in exI) |
|
2360 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp add:is_dir_simps split:option.splits) |
|
2361 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2362 |
apply (rule DiffI, rule UnI1, simp) |
|
2363 |
apply (rule_tac x = obj in exI) |
|
2364 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2365 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2366 |
apply (tactic {*my_setiff_tac 1*}) |
|
2367 |
apply (rule_tac x = "O_msgq q" in exI) |
|
2368 |
apply (simp add:co2sobj.simps) |
|
2369 |
apply (tactic {*my_setiff_tac 1*}) |
|
2370 |
apply (erule UnE, tactic {*my_setiff_tac 1*}) |
|
2371 |
apply (case_tac "obj = O_msgq q") |
|
2372 |
apply (rule_tac x = obj' in exI) |
|
2373 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2374 |
split:t_object.splits if_splits option.splits) |
|
2375 |
apply (auto simp:co2sobj.simps is_file_simps is_dir_simps)[1] |
|
2376 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2377 |
apply (case_tac "info_flow_shm s p pa \<and> O_proc pa \<notin> Tainted s") |
|
2378 |
apply (drule_tac p = pa in s2ss_shm_no_bk_elim', simp+) |
|
2379 |
apply (erule exE|erule conjE)+ |
|
2380 |
apply (rule_tac x = "O_proc p'" in exI) |
|
2381 |
apply (simp add:co2sobj_recvmsg alive_simps) |
|
2382 |
apply (rule_tac x = obj in exI) |
|
2383 |
apply (case_tac "info_flow_shm s p pa", simp) |
|
2384 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2385 |
apply (case_tac "cp2sproc s pa", simp add:co2sobj.simps) |
|
2386 |
apply (simp, simp add:co2sobj.simps tainted_eq_Tainted) |
|
2387 |
apply (simp, frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2388 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg alive_simps) |
|
2389 |
apply (rule_tac x = obj in exI) |
|
2390 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp split:t_object.splits) |
|
2391 |
apply (simp split:t_object.splits) |
|
2392 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg is_dir_simps) |
|
2393 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg) |
|
2394 |
apply (tactic {*my_setiff_tac 1*}) |
|
2395 |
apply (rule_tac x = "O_proc pa" in exI) |
|
2396 |
apply (frule_tac obj = "O_proc pa" in co2sobj_recvmsg) |
|
2397 |
apply (simp add:info_shm_flow_in_procs, simp add:info_shm_flow_in_procs) |
|
53 | 2398 |
|
54 | 2399 |
apply (rule impI, tactic {*my_seteq_tac 1*}) |
2400 |
apply (case_tac "obj = O_msgq q") |
|
2401 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2402 |
apply (rule disjI2, simp) |
|
2403 |
apply (rule_tac x = obj in exI) |
|
2404 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2405 |
split:t_object.splits if_splits option.splits) |
|
2406 |
apply (simp add:co2sobj.simps tainted_eq_Tainted info_flow_shm_Tainted) |
|
2407 |
apply (tactic {*my_setiff_tac 1*}) |
|
2408 |
apply (rule_tac x = "O_msgq q" in exI) |
|
2409 |
apply (simp add:co2sobj.simps) |
|
2410 |
apply (tactic {*my_setiff_tac 1*}) |
|
2411 |
apply (case_tac "obj = O_msgq q") |
|
2412 |
apply (rule_tac x = obj' in exI) |
|
2413 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2414 |
split:t_object.splits if_splits option.splits) |
|
2415 |
apply (auto simp:co2sobj.simps is_file_simps is_dir_simps)[1] |
|
2416 |
apply (rule_tac x = obj in exI) |
|
2417 |
apply (frule_tac obj = obj in co2sobj_recvmsg) |
|
2418 |
apply (simp add:alive_recvmsg, rule notI, simp add:co2sobj.simps) |
|
2419 |
apply (rule conjI) |
|
2420 |
apply (simp add:alive_recvmsg, rule notI, simp add:co2sobj.simps) |
|
2421 |
apply (auto simp:co2sobj.simps tainted_eq_Tainted split:t_object.splits option.splits if_splits)[1] |
|
2422 |
||
2423 |
apply (tactic {*my_clarify_tac 1*}) |
|
2424 |
apply (tactic {*my_seteq_tac 1*}) |
|
2425 |
apply (case_tac "obj = O_msgq q") |
|
2426 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2427 |
apply (rule disjI2) |
|
2428 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2429 |
apply (case_tac "info_flow_shm s p pa") |
|
2430 |
apply (case_tac "O_proc pa \<in> Tainted s") |
|
2431 |
apply (rule DiffI, rule DiffI, rule UnI1, simp) |
|
2432 |
apply (rule_tac x = obj in exI) |
|
2433 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2434 |
apply (simp add:co2sobj.simps tainted_eq_Tainted) |
|
2435 |
apply (erule s2ss_shm_no_bk_intro2, simp, simp) |
|
2436 |
apply (simp, rule notI, simp add:co2sobj.simps split:option.splits) |
|
2437 |
apply (rule DiffI, rule DiffI, rule UnI2, rule CollectI) |
|
2438 |
apply (simp only:co2sobj.simps tainted_eq_Tainted split:option.splits, simp) |
|
2439 |
apply (rule_tac x = ab in exI, simp) |
|
2440 |
apply (rule_tac x = pa in exI, simp add:cp2sproc_other) |
|
2441 |
apply (rule s2ss_shm_no_bk_intro2, simp, simp, simp) |
|
2442 |
apply (simp, rule notI, simp add:co2sobj.simps split:option.splits) |
|
2443 |
apply (rule DiffI, rule DiffI, rule UnI1, simp) |
|
2444 |
apply (rule_tac x = obj in exI) |
|
2445 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2446 |
apply (rule_tac p = pa in s2ss_shm_no_bk_intro3) |
|
2447 |
apply (simp add:co2sobj_recvmsg, simp, simp) |
|
2448 |
apply (simp, rule notI, simp add:co2sobj.simps split:option.splits) |
|
2449 |
apply (rule DiffI, rule DiffI, rule UnI1, simp) |
|
2450 |
apply (rule_tac x = obj in exI) |
|
2451 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp add:is_file_simps split:option.splits) |
|
2452 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2453 |
apply (simp, rule notI, simp add:co2sobj.simps split:option.splits) |
|
2454 |
apply (rule DiffI, rule DiffI, rule UnI1, simp) |
|
2455 |
apply (rule_tac x = obj in exI) |
|
2456 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2457 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2458 |
apply (simp, rule notI, simp add:co2sobj.simps split:option.splits) |
|
2459 |
apply (rule DiffI, rule DiffI, rule UnI1, simp) |
|
2460 |
apply (rule_tac x = obj in exI) |
|
2461 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp add:is_dir_simps split:option.splits) |
|
2462 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2463 |
apply (simp, rule notI, simp add:co2sobj.simps split:option.splits) |
|
2464 |
apply (rule DiffI, rule DiffI, rule UnI1, simp) |
|
2465 |
apply (rule_tac x = obj in exI) |
|
2466 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp, simp split:option.splits) |
|
2467 |
apply (simp add:co2sobj_recvmsg s2ss_shm_no_bk_intro1) |
|
2468 |
apply (simp, rule notI, erule_tac x = obj in allE, simp) |
|
2469 |
apply (simp add:co2sobj_recvmsg) |
|
2470 |
apply (tactic {*my_setiff_tac 1*}) |
|
2471 |
apply (rule_tac x = "O_msgq q" in exI) |
|
2472 |
apply (simp add:co2sobj.simps) |
|
2473 |
apply (tactic {*my_setiff_tac 1*}) |
|
2474 |
apply (erule UnE, tactic {*my_setiff_tac 1*}) |
|
2475 |
apply (case_tac "obj = O_msgq q") |
|
2476 |
apply (simp add:co2sobj.simps) |
|
2477 |
apply (erule_tac obj = obj in co2sobj_some_caseD) |
|
2478 |
apply (case_tac "info_flow_shm s p pa \<and> O_proc pa \<notin> Tainted s") |
|
2479 |
apply (drule_tac p = pa in s2ss_shm_no_bk_elim', simp+) |
|
2480 |
apply (erule exE|erule conjE)+ |
|
2481 |
apply (rule_tac x = "O_proc p'" in exI) |
|
2482 |
apply (simp add:co2sobj_recvmsg alive_simps) |
|
2483 |
apply (rule_tac x = obj in exI) |
|
2484 |
apply (case_tac "info_flow_shm s p pa", simp) |
|
2485 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2486 |
apply (case_tac "cp2sproc s pa", simp add:co2sobj.simps) |
|
2487 |
apply (simp, simp add:co2sobj.simps tainted_eq_Tainted) |
|
2488 |
apply (simp, frule_tac obj = obj in co2sobj_recvmsg, simp+) |
|
2489 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg alive_simps) |
|
2490 |
apply (rule_tac x = obj in exI) |
|
2491 |
apply (frule_tac obj = obj in co2sobj_recvmsg, simp split:t_object.splits) |
|
2492 |
apply (simp split:t_object.splits) |
|
2493 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg is_dir_simps) |
|
2494 |
apply (rule_tac x = obj in exI, simp add:co2sobj_recvmsg) |
|
2495 |
apply (tactic {*my_setiff_tac 1*}) |
|
2496 |
apply (rule_tac x = "O_proc pa" in exI) |
|
2497 |
apply (frule_tac obj = "O_proc pa" in co2sobj_recvmsg) |
|
2498 |
apply (simp add:info_shm_flow_in_procs, simp add:info_shm_flow_in_procs) |
|
2499 |
||
2500 |
apply (rule impI, tactic {*my_seteq_tac 1*}) |
|
2501 |
apply (case_tac "obj = O_msgq q") |
|
2502 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2503 |
apply (rule disjI2, simp, rule conjI) |
|
2504 |
apply (rule_tac x = obj in exI) |
|
2505 |
apply (simp add:co2sobj_recvmsg is_file_simps is_dir_simps alive_recvmsg |
|
2506 |
split:t_object.splits if_splits option.splits) |
|
2507 |
apply (simp add:co2sobj.simps tainted_eq_Tainted info_flow_shm_Tainted) |
|
2508 |
apply (rule notI, simp) |
|
2509 |
apply (frule co2sobj_smsgq_imp, erule exE, simp) |
|
2510 |
apply (simp add:co2sobj_recvmsg) |
|
2511 |
apply (erule_tac x = obj in allE, simp) |
|
2512 |
apply (tactic {*my_setiff_tac 1*}) |
|
2513 |
apply (rule_tac x = "O_msgq q" in exI) |
|
2514 |
apply (simp add:co2sobj.simps) |
|
2515 |
apply (tactic {*my_setiff_tac 1*}) |
|
2516 |
apply (simp, erule exE, erule conjE) |
|
2517 |
apply (case_tac "obj = O_msgq q") |
|
2518 |
apply (simp add:co2sobj.simps) |
|
2519 |
apply (rule_tac x = obj in exI) |
|
2520 |
apply (frule_tac obj = obj in co2sobj_recvmsg) |
|
2521 |
apply (simp add:alive_recvmsg, rule notI, simp add:co2sobj.simps) |
|
2522 |
apply (rule conjI) |
|
2523 |
apply (simp add:alive_recvmsg, rule notI, simp add:co2sobj.simps) |
|
2524 |
apply (auto simp:co2sobj.simps tainted_eq_Tainted intro: info_flow_shm_Tainted |
|
2525 |
split:t_object.splits option.splits if_splits)[1] |
|
2526 |
done |
|
2527 |
||
2528 |
lemma s2ss_createshm: |
|
2529 |
"valid (CreateShM p h # s) \<Longrightarrow> s2ss (CreateShM p h # s) = |
|
2530 |
(case (ch2sshm (CreateShM p h # s) h) of |
|
2531 |
Some sh \<Rightarrow> s2ss s \<union> {S_shm sh} |
|
2532 |
| _ \<Rightarrow> {})" |
|
2533 |
apply (frule vd_cons, frule vt_grant_os, clarsimp) |
|
2534 |
apply (case_tac "ch2sshm (CreateShM p h # s) h") |
|
2535 |
apply (drule current_shm_has_sh', simp+) |
|
2536 |
apply (simp add:s2ss_def) |
|
2537 |
apply (tactic {*my_seteq_tac 1*}) |
|
2538 |
apply (case_tac "obj = O_shm h") |
|
2539 |
apply (rule disjI1, simp add:co2sobj.simps) |
|
2540 |
apply (rule disjI2, simp, rule_tac x = obj in exI) |
|
2541 |
apply (simp add:co2sobj_createshm is_file_simps is_dir_simps split:t_object.splits if_splits) |
|
2542 |
apply (simp add:co2sobj.simps) |
|
2543 |
apply (simp add:co2sobj.simps) |
|
2544 |
apply (tactic {*my_setiff_tac 1*}) |
|
2545 |
apply (rule_tac x = "O_shm h" in exI, simp add:co2sobj.simps) |
|
2546 |
apply (tactic {*my_setiff_tac 1*}) |
|
2547 |
apply (case_tac "obj = O_shm h") |
|
2548 |
apply simp |
|
2549 |
apply (rule_tac x = obj in exI) |
|
2550 |
apply (auto simp add:co2sobj_createshm alive_simps split:t_object.splits if_splits) |
|
2551 |
done |
|
2552 |
||
57 | 2553 |
end |
54 | 2554 |
|
57 | 2555 |
end |