author | chunhan |
Mon, 06 Jan 2014 23:07:51 +0800 | |
changeset 89 | ded3f83f6cb9 |
parent 88 | e832378a2ff2 |
child 90 | 003cac7b8bf5 |
permissions | -rw-r--r-- |
88 | 1 |
theory Enrich2 |
82 | 2 |
imports Main Flask Static Init_prop Valid_prop Tainted_prop Delete_prop Co2sobj_prop S2ss_prop S2ss_prop2 |
83 | 3 |
Temp Enrich Proc_fd_of_file_prop |
82 | 4 |
begin |
5 |
||
6 |
context tainting_s begin |
|
7 |
||
87 | 8 |
fun enrich_msgq :: "t_state \<Rightarrow> t_msgq \<Rightarrow> t_msgq \<Rightarrow> t_state" |
9 |
where |
|
10 |
"enrich_msgq [] tq dq = []" |
|
11 |
| "enrich_msgq (CreateMsgq p q # s) tq dq = |
|
12 |
(if (tq = q) |
|
13 |
then (CreateMsgq p dq # CreateMsgq p q # s) |
|
14 |
else CreateMsgq p q # (enrich_msgq s tq dq))" |
|
15 |
| "enrich_msgq (SendMsg p q m # s) tq dq = |
|
16 |
(if (tq = q) |
|
17 |
then (SendMsg p dq m # SendMsg p q m # (enrich_msgq s tq dq)) |
|
18 |
else SendMsg p q m # (enrich_msgq s tq dq))" |
|
19 |
| "enrich_msgq (RecvMsg p q m # s) tq dq = |
|
20 |
(if (tq = q) |
|
21 |
then (RecvMsg p dq m # RecvMsg p q m # (enrich_msgq s tq dq)) |
|
22 |
else RecvMsg p q m # (enrich_msgq s tq dq))" |
|
23 |
| "enrich_msgq (e # s) tq dq = e # (enrich_msgq s tq dq)" |
|
24 |
||
88 | 25 |
lemma enrich_msgq_duq_in: |
26 |
"\<lbrakk>q' \<notin> current_msgqs s; q \<in> current_msgqs s; no_del_event s; valid s\<rbrakk> |
|
27 |
\<Longrightarrow> q' \<in> current_msgqs (enrich_msgq s q q')" |
|
28 |
apply (induct s, simp) |
|
29 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
30 |
apply auto |
|
31 |
done |
|
87 | 32 |
|
88 | 33 |
lemma enrich_msgq_duq_sms: |
34 |
"\<lbrakk>q' \<notin> current_msgqs s; q \<in> current_msgqs s; no_del_event s; valid s\<rbrakk> |
|
35 |
\<Longrightarrow> msgs_of_queue (enrich_msgq s q q') q' = msgs_of_queue s q" |
|
36 |
apply (induct s, simp) |
|
37 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
38 |
apply auto |
|
39 |
done |
|
40 |
||
41 |
lemma enrich_msgq_cur_inof: |
|
89 | 42 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 43 |
\<Longrightarrow> inum_of_file (enrich_msgq s q q') f = inum_of_file s f" |
44 |
apply (induct s arbitrary:f, simp) |
|
45 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
46 |
apply (auto split:option.splits) |
|
47 |
done |
|
48 |
||
49 |
lemma enrich_msgq_cur_inos: |
|
89 | 50 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 51 |
\<Longrightarrow> inum_of_socket (enrich_msgq s q q') = inum_of_socket s" |
52 |
apply (rule ext) |
|
53 |
apply (induct s, simp) |
|
54 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
55 |
apply (auto split:option.splits) |
|
56 |
done |
|
57 |
||
58 |
lemma enrich_msgq_cur_inos': |
|
89 | 59 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 60 |
\<Longrightarrow> inum_of_socket (enrich_msgq s q q') sock = inum_of_socket s sock" |
61 |
apply (simp add:enrich_msgq_cur_inos) |
|
62 |
done |
|
63 |
||
64 |
lemma enrich_msgq_cur_inums: |
|
89 | 65 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 66 |
\<Longrightarrow> current_inode_nums (enrich_msgq s q q') = current_inode_nums s" |
67 |
apply (auto simp:current_inode_nums_def current_file_inums_def |
|
68 |
current_sock_inums_def enrich_msgq_cur_inof enrich_msgq_cur_inos) |
|
69 |
done |
|
70 |
||
71 |
lemma enrich_msgq_cur_itag: |
|
89 | 72 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 73 |
\<Longrightarrow> itag_of_inum (enrich_msgq s q q') = itag_of_inum s" |
74 |
apply (rule ext) |
|
75 |
apply (induct s, simp) |
|
76 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
77 |
apply (auto split:option.splits t_socket_type.splits) |
|
78 |
done |
|
79 |
||
80 |
lemma enrich_msgq_cur_tcps: |
|
89 | 81 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 82 |
\<Longrightarrow> is_tcp_sock (enrich_msgq s q q') = is_tcp_sock s" |
83 |
apply (rule ext) |
|
84 |
apply (auto simp:is_tcp_sock_def enrich_msgq_cur_itag enrich_msgq_cur_inos |
|
85 |
split:option.splits t_inode_tag.splits) |
|
86 |
done |
|
87 |
||
88 |
lemma enrich_msgq_cur_udps: |
|
89 | 89 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 90 |
\<Longrightarrow> is_udp_sock (enrich_msgq s q q') = is_udp_sock s" |
91 |
apply (rule ext) |
|
92 |
apply (auto simp:is_udp_sock_def enrich_msgq_cur_itag enrich_msgq_cur_inos |
|
93 |
split:option.splits t_inode_tag.splits) |
|
94 |
done |
|
95 |
||
96 |
lemma enrich_msgq_cur_msgqs: |
|
89 | 97 |
"\<lbrakk>q \<in> current_msgqs s; no_del_event s; valid s\<rbrakk> |
88 | 98 |
\<Longrightarrow> current_msgqs (enrich_msgq s q q') = current_msgqs s \<union> {q'}" |
99 |
apply (induct s, simp) |
|
100 |
apply (frule vt_grant_os, frule vd_cons) |
|
101 |
apply (case_tac a, auto) |
|
102 |
done |
|
103 |
||
104 |
lemma enrich_msgq_cur_msgs: |
|
105 |
"\<lbrakk>q' \<notin> current_msgqs s; q \<in> current_msgqs s; no_del_event s; valid s\<rbrakk> |
|
89 | 106 |
\<Longrightarrow> msgs_of_queue (enrich_msgq s q q') = (msgs_of_queue s) (q' := msgs_of_queue s q)" |
88 | 107 |
apply (rule ext, simp, rule conjI, rule impI) |
108 |
apply (simp add:enrich_msgq_duq_sms) |
|
89 | 109 |
apply (rule impI) |
88 | 110 |
apply (induct s, simp) |
111 |
apply (frule vt_grant_os, frule vd_cons) |
|
112 |
apply (case_tac a, auto) |
|
113 |
done |
|
114 |
||
115 |
lemma enrich_msgq_cur_procs: |
|
89 | 116 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 117 |
\<Longrightarrow> current_procs (enrich_msgq s q q') = current_procs s" |
118 |
apply (induct s, simp) |
|
119 |
apply (frule vt_grant_os, frule vd_cons) |
|
120 |
apply (case_tac a, auto) |
|
121 |
done |
|
122 |
||
123 |
lemma enrich_msgq_cur_files: |
|
89 | 124 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 125 |
\<Longrightarrow> current_files (enrich_msgq s q q') = current_files s" |
126 |
apply (auto simp:current_files_def) |
|
127 |
apply (simp add:enrich_msgq_cur_inof)+ |
|
128 |
done |
|
129 |
||
130 |
lemma enrich_msgq_cur_fds: |
|
89 | 131 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 132 |
\<Longrightarrow> current_proc_fds (enrich_msgq s q q') = current_proc_fds s" |
133 |
apply (induct s, simp) |
|
134 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
135 |
apply auto |
|
136 |
done |
|
137 |
||
138 |
lemma enrich_msgq_filefd: |
|
89 | 139 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 140 |
\<Longrightarrow> file_of_proc_fd (enrich_msgq s q q') = file_of_proc_fd s" |
141 |
apply (rule ext, rule ext) |
|
142 |
apply (induct s, simp) |
|
143 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
144 |
apply auto |
|
145 |
done |
|
146 |
||
147 |
lemma enrich_msgq_flagfd: |
|
89 | 148 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 149 |
\<Longrightarrow> flags_of_proc_fd (enrich_msgq s q q') = flags_of_proc_fd s" |
150 |
apply (rule ext, rule ext) |
|
151 |
apply (induct s, simp) |
|
152 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
153 |
apply auto |
|
154 |
done |
|
155 |
||
156 |
lemma enrich_msgq_proc_fds: |
|
89 | 157 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 158 |
\<Longrightarrow> proc_file_fds (enrich_msgq s q q') = proc_file_fds s" |
159 |
apply (auto simp:proc_file_fds_def enrich_msgq_filefd) |
|
160 |
done |
|
161 |
||
162 |
lemma enrich_msgq_hungs: |
|
163 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
|
164 |
\<Longrightarrow> files_hung_by_del (enrich_msgq s q q') = files_hung_by_del s" |
|
165 |
apply (induct s, simp) |
|
166 |
apply (frule vt_grant_os, frule vd_cons, case_tac a) |
|
167 |
apply (auto simp:files_hung_by_del.simps) |
|
168 |
done |
|
169 |
||
170 |
lemma enrich_msgq_is_file: |
|
89 | 171 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 172 |
\<Longrightarrow> is_file (enrich_msgq s q q') = is_file s" |
173 |
apply (rule ext) |
|
174 |
apply (auto simp add:is_file_def enrich_msgq_cur_itag enrich_msgq_cur_inof |
|
175 |
split:option.splits t_inode_tag.splits) |
|
176 |
done |
|
177 |
||
178 |
lemma enrich_msgq_is_dir: |
|
89 | 179 |
"\<lbrakk>no_del_event s; valid s\<rbrakk> |
88 | 180 |
\<Longrightarrow> is_dir (enrich_msgq s q q') = is_dir s" |
181 |
apply (rule ext) |
|
182 |
apply (auto simp add:is_dir_def enrich_msgq_cur_itag enrich_msgq_cur_inof |
|
183 |
split:option.splits t_inode_tag.splits) |
|
184 |
done |
|
185 |
||
186 |
lemma enrich_msgq_alive: |
|
187 |
"\<lbrakk>alive s obj; valid s; q \<in> current_msgqs s; q' \<notin> current_msgqs s; no_del_event s\<rbrakk> |
|
188 |
\<Longrightarrow> alive (enrich_msgq s q q') obj" |
|
189 |
apply (case_tac obj) |
|
190 |
apply (simp_all add:enrich_msgq_is_file enrich_msgq_is_dir enrich_msgq_cur_msgqs |
|
191 |
enrich_msgq_cur_msgs enrich_msgq_cur_procs enrich_msgq_cur_fds |
|
192 |
enrich_msgq_cur_tcps enrich_msgq_cur_udps) |
|
193 |
apply (rule impI, simp) |
|
194 |
done |
|
195 |
||
196 |
lemma enrich_msgq_alive': |
|
197 |
"\<lbrakk>alive (enrich_msgq s q q') obj; valid s; q \<in> current_msgqs s; q' \<notin> current_msgqs s; no_del_event s\<rbrakk> |
|
198 |
\<Longrightarrow> alive s obj \<or> obj = O_msgq q' \<or> (\<exists> m. obj = O_msg q' m \<and> alive s (O_msg q m))" |
|
199 |
apply (case_tac obj) |
|
200 |
apply (simp_all add:enrich_msgq_is_file enrich_msgq_is_dir enrich_msgq_cur_msgqs |
|
201 |
enrich_msgq_cur_msgs enrich_msgq_cur_procs enrich_msgq_cur_fds |
|
202 |
enrich_msgq_cur_tcps enrich_msgq_cur_udps) |
|
203 |
apply (auto split:if_splits) |
|
204 |
done |
|
87 | 205 |
|
206 |
(* enrich s target_proc duplicated_pro *) |
|
89 | 207 |
fun enrich_proc :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> nat \<Rightarrow> t_state" |
87 | 208 |
where |
89 | 209 |
"enrich_proc [] tp dp n = []" |
210 |
| "enrich_proc (Execve p f fds # s) tp dp n = ( |
|
87 | 211 |
if (tp = p) |
89 | 212 |
then Execve dp f (fds \<inter> proc_file_fds s p) # Execve p f fds # (enrich_proc s tp dp n) |
213 |
else Execve p f fds # (enrich_proc s tp dp n))" |
|
214 |
| "enrich_proc (Clone p p' fds # s) tp dp n = ( |
|
87 | 215 |
if (tp = p') |
216 |
then Clone p dp (fds \<inter> proc_file_fds s p) # Clone p p' fds # s |
|
89 | 217 |
else Clone p p' fds # (enrich_proc s tp dp n))" |
218 |
| "enrich_proc (Open p f flags fd opt # s) tp dp n= ( |
|
87 | 219 |
if (tp = p) |
89 | 220 |
then Open dp f (remove_create_flag flags) fd None # Open p f flags fd opt # (enrich_proc s tp dp n) |
221 |
else Open p f flags fd opt # (enrich_proc s tp dp n))" |
|
222 |
| "enrich_proc (ReadFile p fd # s) tp dp n = ( |
|
87 | 223 |
if (tp = p) |
89 | 224 |
then ReadFile dp fd # ReadFile p fd # (enrich_proc s tp dp n) |
225 |
else ReadFile p fd # (enrich_proc s tp dp n))" |
|
226 |
| "enrich_proc (RecvMsg p q m # s) tp dp n = ( |
|
88 | 227 |
if (tp = p) |
89 | 228 |
then RecvMsg dp n m # RecvMsg p q m # (enrich_msgq (enrich_proc s tp dp (n+1)) q n) |
229 |
else RecvMsg p q m # (enrich_proc s tp dp n))" |
|
87 | 230 |
(* |
231 |
| "enrich_proc (CloseFd p fd # s) tp dp = ( |
|
232 |
if (tp = p \<and> fd \<in> proc_file_fds s p) |
|
233 |
then CloseFd dp fd # CloseFd p fd # (enrich_proc s tp dp) |
|
234 |
else CloseFd p fd # (enrich_proc s tp dp))" |
|
235 |
*) |
|
236 |
(* |
|
237 |
| "enrich_proc (Attach p h flag # s) tp dp = ( |
|
238 |
if (tp = p) |
|
239 |
then Attach dp h flag # Attach p h flag # (enrich_proc s tp dp) |
|
240 |
else Attach p h flag # (enrich_proc s tp dp))" |
|
241 |
| "enrich_proc (Detach p h # s) tp dp = ( |
|
242 |
if (tp = p) |
|
243 |
then Detach dp h # Detach p h # (enrich_proc s tp dp) |
|
244 |
else Detach p h # (enrich_proc s tp dp))" |
|
245 |
*) |
|
246 |
(* |
|
247 |
| "enrich_proc (Kill p p' # s) tp dp = ( |
|
248 |
if (tp = p') then Kill p p' # s |
|
249 |
else Kill p p' # (enrich_proc s tp dp))" |
|
250 |
| "enrich_proc (Exit p # s) tp dp = ( |
|
251 |
if (tp = p) then Exit p # s |
|
252 |
else Exit p # (enrich_proc s tp dp))" |
|
253 |
*) |
|
89 | 254 |
| "enrich_proc (e # s) tp dp n = e # (enrich_proc s tp dp n)" |
87 | 255 |
|
256 |
definition is_created_proc:: "t_state \<Rightarrow> t_process \<Rightarrow> bool" |
|
257 |
where |
|
258 |
"is_created_proc s p \<equiv> p \<in> current_procs s \<and> (p \<in> init_procs \<longrightarrow> died (O_proc p) s)" |
|
259 |
||
260 |
definition is_created_proc':: "t_state \<Rightarrow> t_process \<Rightarrow> bool" |
|
261 |
where |
|
262 |
"is_created_proc' s p \<equiv> p \<in> current_procs s \<and> p \<notin> init_procs" |
|
263 |
||
264 |
lemma created_proc_clone: |
|
265 |
"valid (Clone p p' fds # s) \<Longrightarrow> |
|
266 |
is_created_proc (Clone p p' fds # s) tp = (if (tp = p') then True else is_created_proc s tp)" |
|
267 |
apply (drule vt_grant_os) |
|
268 |
apply (auto simp:is_created_proc_def dest:not_all_procs_prop2) |
|
269 |
using not_died_init_proc |
|
270 |
by auto |
|
271 |
||
272 |
lemma created_proc_exit: |
|
273 |
"is_created_proc (Exit p # s) tp = (if (tp = p) then False else is_created_proc s tp)" |
|
274 |
by (simp add:is_created_proc_def) |
|
275 |
||
276 |
lemma created_proc_kill: |
|
277 |
"is_created_proc (Kill p p' # s) tp = (if (tp = p') then False else is_created_proc s tp)" |
|
278 |
by (simp add:is_created_proc_def) |
|
279 |
||
280 |
lemma created_proc_other: |
|
281 |
"\<lbrakk>\<And> p p' fds. e \<noteq> Clone p p' fds; |
|
282 |
\<And> p. e \<noteq> Exit p; |
|
283 |
\<And> p p'. e \<noteq> Kill p p'\<rbrakk> \<Longrightarrow> is_created_proc (e # s) tp = is_created_proc s tp" |
|
284 |
by (case_tac e, auto simp:is_created_proc_def) |
|
285 |
||
286 |
lemmas is_created_proc_simps = created_proc_clone created_proc_exit created_proc_kill created_proc_other |
|
287 |
||
288 |
lemma no_del_died: |
|
289 |
"\<lbrakk>no_del_event s; died obj s\<rbrakk> \<Longrightarrow> (\<exists> p fd. obj = O_fd p fd \<or> obj = O_tcp_sock (p, fd) \<or> obj = O_udp_sock (p, fd)) |
|
290 |
\<or> (\<exists> q m. obj = O_msg q m) " |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
291 |
apply (induct s) |
87 | 292 |
apply simp |
293 |
apply (case_tac a) |
|
82 | 294 |
apply (auto split:option.splits) |
295 |
done |
|
296 |
||
87 | 297 |
lemma no_del_created_eq: |
298 |
"no_del_event s \<Longrightarrow> is_created_proc s p = is_created_proc' s p" |
|
299 |
apply (induct s) |
|
300 |
apply (simp add:is_created_proc_def is_created_proc'_def) |
|
301 |
apply (case_tac a) |
|
302 |
apply (auto simp add:is_created_proc_def is_created_proc'_def dest:no_del_died) |
|
303 |
done |
|
304 |
||
305 |
lemma enrich_proc_dup_in: |
|
89 | 306 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
307 |
\<Longrightarrow> p' \<in> current_procs (enrich_proc s p p' i)" |
|
87 | 308 |
apply (induct s, simp add:is_created_proc_def) |
309 |
apply (frule vt_grant_os, frule vd_cons) |
|
89 | 310 |
apply (case_tac a) |
311 |
apply ( auto simp:is_created_proc_def Let_def enrich_msgq_cur_procs |
|
312 |
dest:not_all_procs_prop3) |
|
313 |
sorry |
|
82 | 314 |
|
87 | 315 |
lemma enrich_proc_dup_ffd: |
316 |
"\<lbrakk>file_of_proc_fd s p fd = Some f; is_created_proc s p; p' \<notin> all_procs s; valid s\<rbrakk> |
|
89 | 317 |
\<Longrightarrow> file_of_proc_fd (enrich_proc s p p' i) p' fd = Some f" |
87 | 318 |
apply (induct s, simp add:is_created_proc_def) |
319 |
apply (frule vt_grant_os, frule vd_cons) |
|
89 | 320 |
apply (case_tac a, auto simp:is_created_proc_def proc_file_fds_def Let_def |
87 | 321 |
dest:not_all_procs_prop3 split:if_splits option.splits) |
89 | 322 |
sorry |
87 | 323 |
|
324 |
lemma enrich_proc_dup_ffd': |
|
89 | 325 |
"\<lbrakk>file_of_proc_fd (enrich_proc s p p' i) p' fd = Some f; is_created_proc s p; p' \<notin> all_procs s; |
87 | 326 |
no_del_event s; valid s\<rbrakk> |
327 |
\<Longrightarrow> file_of_proc_fd s p fd = Some f" |
|
328 |
apply (induct s, simp add:is_created_proc_def) |
|
329 |
apply (frule vt_grant_os, frule vd_cons) |
|
89 | 330 |
apply (case_tac a, auto simp:is_created_proc_def proc_file_fds_def Let_def |
87 | 331 |
dest:not_all_procs_prop3 split:if_splits option.splits) |
89 | 332 |
sorry |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
333 |
|
87 | 334 |
lemma enrich_proc_dup_ffd_eq: |
335 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
|
89 | 336 |
\<Longrightarrow> file_of_proc_fd (enrich_proc s p p' i) p' fd = file_of_proc_fd s p fd" |
87 | 337 |
apply (case_tac "file_of_proc_fd s p fd") |
89 | 338 |
apply (case_tac[!] "file_of_proc_fd (enrich_proc s p p' i) p' fd") |
87 | 339 |
apply (auto dest:enrich_proc_dup_ffd enrich_proc_dup_ffd') |
89 | 340 |
apply (drule_tac i = i in enrich_proc_dup_ffd, simp+) |
87 | 341 |
done |
342 |
||
89 | 343 |
lemma enrich_proc_cur_msgqs: |
344 |
"\<lbrakk>valid s\<rbrakk> \<Longrightarrow> current_msgqs (enrich_proc s p p' i) = current_msgqs s \<union> {q'. q' \<ge> new_msgq s \<and> q' \<le> new_msgq s + (nums_of_recvmsg s p) - 1}" |
|
345 |
apply (induct s, simp) |
|
346 |
apply (auto)[1] |
|
347 |
apply (drule new_msgq_1, simp, simp) |
|
348 |
apply (frule vt_grant_os, frule vd_cons) |
|
349 |
sorry |
|
350 |
||
351 |
lemma enrich_proc_not_alive: |
|
352 |
"\<lbrakk>enrich_not_alive s (E_proc p' (new_msgq s) (new_msgq s + (nums_of_recvmsg s p) - 1)) obj; |
|
353 |
is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
|
354 |
\<Longrightarrow> enrich_not_alive (enrich_proc s p p' (new_msgq s)) (E_proc p' (new_msgq s) (new_msgq s + (nums_of_recvmsg s p) - 1)) obj" |
|
355 |
apply (case_tac obj, simp_all) |
|
356 |
prefer 5 |
|
357 |
apply (simp add:enrich_proc_cur_msgqs) |
|
358 |
apply (rule impI, rule notI) |
|
359 |
apply simp |
|
360 |
apply (auto)[1] |
|
361 |
defer |
|
362 |
apply simp |
|
363 |
apply (rule impI, rule notI) |
|
364 |
defer |
|
365 |
apply (subgoal_tac "new_msgq s \<noteq> 0") |
|
366 |
apply simp |
|
367 |
apply arith |
|
368 |
apply (simp_all add:enrich_proc_cur_procs enrich_proc_cur_files enrich_proc_cur_inums |
|
369 |
enrich_proc_cur_msgqs enrich_proc_cur_msgs enrich_proc_cur_fds) |
|
370 |
defer |
|
371 |
apply (rule impI, rule notI) |
|
372 |
sorry |
|
373 |
||
87 | 374 |
|
375 |
lemma enrich_proc_dup_fflags: |
|
376 |
"\<lbrakk>flags_of_proc_fd s p fd = Some flag; is_created_proc s p; p' \<notin> all_procs s; valid s\<rbrakk> |
|
377 |
\<Longrightarrow> flags_of_proc_fd (enrich_proc s p p') p' fd = Some (remove_create_flag flag) \<or> |
|
378 |
flags_of_proc_fd (enrich_proc s p p') p' fd = Some flag" |
|
379 |
apply (induct s arbitrary:p, simp add:is_created_proc_def) |
|
380 |
apply (frule vt_grant_os, frule vd_cons) |
|
89 | 381 |
apply (case_tac a, auto simp:is_created_proc_def proc_file_fds_def is_creat_flag_def Let_def |
87 | 382 |
dest:not_all_procs_prop3 split:if_splits option.splits) |
89 | 383 |
sorry |
87 | 384 |
|
385 |
lemma enrich_proc_dup_ffds: |
|
386 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
|
387 |
\<Longrightarrow> proc_file_fds (enrich_proc s p p') p' = proc_file_fds s p" |
|
388 |
apply (auto simp:proc_file_fds_def) |
|
389 |
apply (rule_tac x = f in exI) |
|
390 |
apply (erule enrich_proc_dup_ffd', simp+) |
|
391 |
apply (rule_tac x = f in exI) |
|
392 |
apply (erule enrich_proc_dup_ffd, simp+) |
|
393 |
done |
|
394 |
||
395 |
lemma enrich_proc_dup_ffds_eq_fds: |
|
396 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
|
397 |
\<Longrightarrow> current_proc_fds (enrich_proc s p p') p' = proc_file_fds s p" |
|
398 |
apply (induct s arbitrary:p) |
|
399 |
apply (simp add: is_created_proc_def) |
|
400 |
apply (frule not_all_procs_prop3) |
|
401 |
apply (frule vd_cons, frule vt_grant_os, case_tac a) |
|
402 |
apply (auto split:if_splits option.splits dest:proc_fd_in_fds set_mp not_all_procs_prop3 |
|
89 | 403 |
simp:proc_file_fds_def is_created_proc_def Let_def) |
404 |
sorry |
|
405 |
||
406 |
lemma enrich_proc_dup_ffds': |
|
407 |
"\<lbrakk>fd \<notin> current_proc_fds (enrich_proc s p p') p'; is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
|
408 |
\<Longrightarrow> fd \<notin> proc_file_fds s p \<and> file_of_proc_fd s p fd = None" |
|
409 |
apply (auto simp:enrich_proc_dup_ffds_eq_fds) |
|
410 |
apply (simp add:proc_file_fds_def) |
|
87 | 411 |
done |
412 |
||
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
413 |
lemma enrich_proc_cur_inof: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
414 |
"\<lbrakk>valid s; no_del_event s\<rbrakk> \<Longrightarrow> inum_of_file (enrich_proc s p p') f = inum_of_file s f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
415 |
apply (induct s arbitrary:f) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
416 |
apply simp |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
417 |
apply (frule vd_cons, frule vt_grant_os, frule vt_grant) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
418 |
apply (case_tac a, auto) |
89 | 419 |
apply (auto split:option.splits simp del:grant.simps simp add:Let_def) |
420 |
sorry |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
421 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
422 |
lemma not_all_procs_sock: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
423 |
"\<lbrakk>p' \<notin> all_procs s; valid s\<rbrakk> \<Longrightarrow> inum_of_socket s (p', fd) = None" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
424 |
apply (frule not_all_procs_prop3) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
425 |
apply (case_tac "inum_of_socket s (p', fd)", simp_all) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
426 |
apply (drule cn_in_curp', simp+) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
427 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
428 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
429 |
lemma enrich_proc_cur_inos: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
430 |
"\<lbrakk>valid s; no_del_event s; p' \<notin> all_procs s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
431 |
\<Longrightarrow> inum_of_socket (enrich_proc s p p') (tp, fd) = inum_of_socket s (tp, fd)" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
432 |
apply (induct s arbitrary:tp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
433 |
apply simp |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
434 |
apply (frule vd_cons, frule vt_grant_os) |
89 | 435 |
apply (case_tac a, auto split:option.splits simp:not_all_procs_sock Let_def) |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
436 |
apply (simp add:proc_file_fds_def, erule exE) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
437 |
apply (case_tac "inum_of_socket s (nat1, fd)", simp_all) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
438 |
apply (drule filefd_socket_conflict, simp_all add:current_sockets_def) |
89 | 439 |
sorry |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
440 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
441 |
lemma enrich_proc_cur_inums: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
442 |
"\<lbrakk>p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
443 |
\<Longrightarrow> current_inode_nums (enrich_proc s p p') = current_inode_nums s" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
444 |
apply (auto simp:current_inode_nums_def current_file_inums_def |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
445 |
current_sock_inums_def enrich_proc_cur_inof enrich_proc_cur_inos) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
446 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
447 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
448 |
lemma enrich_proc_cur_itag: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
449 |
"\<lbrakk>valid s; no_del_event s; p' \<notin> all_procs s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
450 |
\<Longrightarrow> itag_of_inum (enrich_proc s p p') i = itag_of_inum s i" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
451 |
apply (induct s) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
452 |
apply simp |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
453 |
apply (frule vd_cons, frule vt_grant_os) |
89 | 454 |
apply (case_tac a, auto split:option.splits t_socket_type.splits simp:Let_def) |
455 |
sorry |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
456 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
457 |
lemma enrich_proc_cur_tcps: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
458 |
"\<lbrakk>valid s; no_del_event s; p' \<notin> all_procs s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
459 |
\<Longrightarrow> is_tcp_sock (enrich_proc s p p') = is_tcp_sock s" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
460 |
apply (rule ext, case_tac x) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
461 |
apply (auto simp add:is_tcp_sock_def enrich_proc_cur_itag enrich_proc_cur_inos |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
462 |
split:option.splits t_inode_tag.splits) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
463 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
464 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
465 |
lemma enrich_proc_cur_udps: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
466 |
"\<lbrakk>valid s; no_del_event s; p' \<notin> all_procs s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
467 |
\<Longrightarrow> is_udp_sock (enrich_proc s p p') = is_udp_sock s" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
468 |
apply (rule ext, case_tac x) |
89 | 469 |
apply (auto simp add:is_udp_sock_def enrich_proc_cur_itag enrich_proc_cur_inos |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
470 |
split:option.splits t_inode_tag.splits) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
471 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
472 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
473 |
lemma enrich_proc_cur_msgqs: |
89 | 474 |
"\<lbrakk>q \<in> current_msgqs s; valid s\<rbrakk> \<Longrightarrow> q \<in> current_msgqs (enrich_proc s p p')" |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
475 |
apply (induct s, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
476 |
apply (frule vt_grant_os, frule vd_cons) |
89 | 477 |
apply (case_tac a, auto simp:Let_def) |
478 |
sorry |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
479 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
480 |
lemma enrich_proc_cur_msgs: |
89 | 481 |
"\<lbrakk>q \<in> current_msgqs s; valid s\<rbrakk> \<Longrightarrow> msgs_of_queue (enrich_proc s p p') q = msgs_of_queue s q" |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
482 |
apply (induct s, simp) |
89 | 483 |
apply (frule_tac p = p and p' = p' in enrich_proc_cur_msgqs, simp) |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
484 |
apply (frule vt_grant_os, frule vd_cons) |
89 | 485 |
apply (case_tac a, auto simp:Let_def) |
486 |
sorry |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
487 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
488 |
lemma enrich_proc_cur_procs: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
489 |
"\<lbrakk>p' \<notin> all_procs s; no_del_event s; is_created_proc s p; valid s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
490 |
\<Longrightarrow> current_procs (enrich_proc s p p') = current_procs s \<union> {p'}" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
491 |
apply (induct s, simp add:is_created_proc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
492 |
apply (frule vt_grant_os, frule vd_cons) |
89 | 493 |
apply (case_tac a, auto simp:is_created_proc_simps Let_def) |
494 |
sorry |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
495 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
496 |
lemma enrich_proc_cur_files: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
497 |
"\<lbrakk>valid s; no_del_event s\<rbrakk> \<Longrightarrow> current_files (enrich_proc s p p') = current_files s" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
498 |
apply (auto simp:current_files_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
499 |
apply (simp add: enrich_proc_cur_inof)+ |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
500 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
501 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
502 |
lemma enrich_proc_cur_fds1: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
503 |
"\<lbrakk>p' \<notin> all_procs s; no_del_event s; is_created_proc s p; valid s; tp \<in> current_procs s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
504 |
\<Longrightarrow> current_proc_fds (enrich_proc s p p') tp = current_proc_fds s tp" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
505 |
apply (induct s, simp add:is_created_proc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
506 |
apply (frule vt_grant_os, frule vd_cons) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
507 |
apply (frule not_all_procs_prop3) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
508 |
apply (case_tac a) |
89 | 509 |
sorry |
510 |
(* |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
511 |
apply (auto simp:is_created_proc_simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
512 |
done |
89 | 513 |
*) |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
514 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
515 |
lemma enrich_proc_cur_fds1': |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
516 |
"\<lbrakk>p' \<notin> all_procs s; no_del_event s; is_created_proc s p; valid s; tp \<noteq> p'\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
517 |
\<Longrightarrow> current_proc_fds (enrich_proc s p p') tp = current_proc_fds s tp" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
518 |
apply (induct s, simp add:is_created_proc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
519 |
apply (frule vt_grant_os, frule vd_cons) |
89 | 520 |
apply (frule not_all_procs_prop3) sorry (* |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
521 |
apply (case_tac a) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
522 |
apply (auto simp:is_created_proc_simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
523 |
done |
89 | 524 |
*) |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
525 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
526 |
lemma enrich_proc_cur_fds: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
527 |
"\<lbrakk>p' \<notin> all_procs s; no_del_event s; is_created_proc s p; valid s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
528 |
\<Longrightarrow> current_proc_fds (enrich_proc s p p') tp = (if (tp = p') then proc_file_fds s p else current_proc_fds s tp)" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
529 |
apply (simp add:enrich_proc_cur_fds1' enrich_proc_dup_ffds_eq_fds split:if_splits) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
530 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
531 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
532 |
lemma enrich_proc_not_alive: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
533 |
"\<lbrakk>enrich_not_alive s (E_proc p') obj; is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
534 |
\<Longrightarrow> enrich_not_alive (enrich_proc s p p') (E_proc p') obj" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
535 |
apply (case_tac obj) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
536 |
apply (simp_all add:enrich_proc_cur_procs enrich_proc_cur_files enrich_proc_cur_inums |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
537 |
enrich_proc_cur_msgqs enrich_proc_cur_msgs enrich_proc_cur_fds) |
89 | 538 |
defer |
539 |
apply (rule impI, rule notI) |
|
540 |
sorry |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
541 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
542 |
lemma enrich_proc_filefd: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
543 |
"\<lbrakk>file_of_proc_fd s tp fd = Some f; is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
544 |
\<Longrightarrow> file_of_proc_fd (enrich_proc s p p') tp fd = Some f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
545 |
apply (induct s arbitrary:tp, simp add:is_created_proc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
546 |
apply (frule vt_grant_os, frule vd_cons) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
547 |
apply (frule not_all_procs_prop3) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
548 |
apply (case_tac a) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
549 |
apply (auto simp:is_created_proc_simps dest:proc_fd_in_procs split:if_splits) |
89 | 550 |
sorry |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
551 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
552 |
lemma enrich_proc_flagfd: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
553 |
"\<lbrakk>flags_of_proc_fd s tp fd = Some f; is_created_proc s p; p' \<notin> all_procs s; no_del_event s; valid s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
554 |
\<Longrightarrow> flags_of_proc_fd (enrich_proc s p p') tp fd = Some f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
555 |
apply (induct s arbitrary:tp, simp add:is_created_proc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
556 |
apply (frule vt_grant_os, frule vd_cons) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
557 |
apply (frule not_all_procs_prop3) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
558 |
apply (case_tac a) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
559 |
apply (auto simp:is_created_proc_simps dest:proc_fd_in_procs current_fflag_has_ffd split:if_splits option.splits) |
89 | 560 |
sorry |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
561 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
562 |
lemma enrich_proc_hungs: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
563 |
"\<lbrakk>valid s; no_del_event s\<rbrakk> \<Longrightarrow> files_hung_by_del (enrich_proc s p p') = files_hung_by_del s" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
564 |
apply (induct s, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
565 |
apply (frule vt_grant_os, frule vd_cons) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
566 |
apply (case_tac a, auto simp:files_hung_by_del.simps) |
89 | 567 |
sorry |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
568 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
569 |
lemma enrich_proc_is_file: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
570 |
"\<lbrakk>valid s; no_del_event s; p' \<notin> all_procs s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
571 |
\<Longrightarrow> is_file (enrich_proc s p p') = is_file s" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
572 |
apply (rule ext, case_tac x) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
573 |
apply (auto simp add:is_file_def enrich_proc_cur_itag enrich_proc_cur_inof |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
574 |
split:option.splits t_inode_tag.splits) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
575 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
576 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
577 |
lemma enrich_proc_is_dir: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
578 |
"\<lbrakk>valid s; no_del_event s; p' \<notin> all_procs s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
579 |
\<Longrightarrow> is_dir (enrich_proc s p p') = is_dir s" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
580 |
apply (rule ext, case_tac x) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
581 |
apply (auto simp add:is_dir_def enrich_proc_cur_itag enrich_proc_cur_inof |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
582 |
split:option.splits t_inode_tag.splits) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
583 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
584 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
585 |
lemma enrich_proc_alive: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
586 |
"\<lbrakk>alive s obj; valid s; is_created_proc s p; p' \<notin> all_procs s; no_del_event s\<rbrakk> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
587 |
\<Longrightarrow> alive (enrich_proc s p p') obj" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
588 |
apply (case_tac obj) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
589 |
apply (simp_all add:enrich_proc_is_file enrich_proc_is_dir enrich_proc_cur_msgqs |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
590 |
enrich_proc_cur_msgs enrich_proc_cur_procs enrich_proc_cur_fds |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
591 |
enrich_proc_cur_tcps enrich_proc_cur_udps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
592 |
apply (rule impI, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
593 |
apply (drule current_proc_fds_in_curp, simp, simp add:not_all_procs_prop3) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
594 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
595 |
|
82 | 596 |
lemma enrich_proc_prop: |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
597 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s; no_del_event s\<rbrakk> |
82 | 598 |
\<Longrightarrow> valid (enrich_proc s p p') \<and> |
599 |
(\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp) \<and> |
|
600 |
(\<forall> f. f \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f) \<and> |
|
601 |
(\<forall> q. q \<in> current_msgqs s \<longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q) \<and> |
|
602 |
(\<forall> tp fd. fd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd) \<and> |
|
603 |
(cp2sproc (enrich_proc s p p') p' = cp2sproc s p) \<and> |
|
604 |
(\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd)" |
|
605 |
proof (induct s) |
|
606 |
case Nil |
|
607 |
thus ?case by (auto simp:is_created_proc_def) |
|
608 |
next |
|
609 |
case (Cons e s) |
|
83 | 610 |
hence vd_cons': "valid (e # s)" and created_cons: "is_created_proc (e # s) p" |
82 | 611 |
and all_procs_cons: "p' \<notin> all_procs (e # s)" and vd: "valid s" |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
612 |
and os: "os_grant s e" and grant: "grant s e" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
613 |
and nodel_cons: "no_del_event (e # s)" |
83 | 614 |
by (auto dest:vd_cons' vt_grant_os vt_grant) |
82 | 615 |
from all_procs_cons have all_procs: "p' \<notin> all_procs s" by (case_tac e, auto) |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
616 |
from nodel_cons have nodel: "no_del_event s" by (case_tac e, auto) |
82 | 617 |
from Cons have pre: "is_created_proc s p \<Longrightarrow> valid (enrich_proc s p p') \<and> |
618 |
(\<forall>tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp) \<and> |
|
619 |
(\<forall>f. f \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f) \<and> |
|
620 |
(\<forall>q. q \<in> current_msgqs s \<longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q) \<and> |
|
621 |
(\<forall>tp fd. fd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd) \<and> |
|
622 |
(cp2sproc (enrich_proc s p p') p' = cp2sproc s p) \<and> |
|
623 |
(\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd)" |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
624 |
using vd all_procs nodel by auto |
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
625 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
626 |
from pre have pre_vd: "is_created_proc s p \<Longrightarrow> valid (enrich_proc s p p')" by simp |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
627 |
have vd_enrich:"is_created_proc s p \<Longrightarrow> valid (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
628 |
apply (frule pre_vd) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
629 |
apply (erule_tac s = s and obj' = "E_proc p'" in enrich_valid_intro_cons) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
630 |
apply (simp_all add: pre nodel_cons all_procs_cons vd_cons') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
631 |
apply (clarsimp simp:enrich_proc_alive nodel all_procs vd) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
632 |
apply (rule allI, rule impI, erule enrich_proc_not_alive) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
633 |
apply (simp_all add:nodel all_procs vd enrich_proc_hungs enrich_proc_cur_msgs) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
634 |
apply ((rule allI| rule impI)+, erule enrich_proc_filefd) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
635 |
apply (simp_all add:nodel all_procs vd) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
636 |
apply ((rule allI| rule impI)+, erule enrich_proc_flagfd) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
637 |
apply (simp_all add:nodel all_procs vd) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
638 |
done |
82 | 639 |
have vd_enrich_cons: "valid (enrich_proc (e # s) p p')" |
640 |
proof- |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
641 |
have "\<And>f fds. \<lbrakk>valid (Execve p f fds # enrich_proc s p p'); is_created_proc s p; |
82 | 642 |
valid (Execve p f fds # s); p' \<notin> all_procs s\<rbrakk> |
643 |
\<Longrightarrow> valid (Execve p' f (fds \<inter> proc_file_fds s p) # Execve p f fds # enrich_proc s p p')" |
|
644 |
proof- |
|
645 |
fix f fds |
|
646 |
assume a1: "valid (Execve p f fds # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
647 |
and a3: "valid (Execve p f fds # s)" and a0: "p' \<notin> all_procs s" |
|
648 |
have cp2sp: "\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp" |
|
649 |
and cf2sf: "\<forall> tf. tf \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
|
650 |
and cfd2sfd: "\<forall> tp tfd. tfd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp tfd = cfd2sfd s tp tfd" |
|
651 |
and dup_sp: "cp2sproc (enrich_proc s p p') p' = cp2sproc s p" |
|
652 |
and dup_sfd: "\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd" |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
653 |
using pre a2 |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
654 |
by auto |
82 | 655 |
show "valid (Execve p' f (fds \<inter> proc_file_fds s p) # Execve p f fds # enrich_proc s p p')" |
656 |
proof- |
|
657 |
from a0 a3 have a0': "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3) |
|
658 |
from a3 have grant: "grant s (Execve p f fds)" and os: "os_grant s (Execve p f fds)" |
|
659 |
by (auto dest:vt_grant_os vt_grant simp del:os_grant.simps) |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
660 |
have f_in: "is_file (enrich_proc s p p') f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
661 |
using vd nodel os all_procs |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
662 |
by (auto dest:vt_grant_os simp:enrich_proc_is_file) |
82 | 663 |
moreover have a5: "proc_file_fds s p \<subseteq> proc_file_fds (Execve p f fds # enrich_proc s p p') p'" |
664 |
using a3 a0' |
|
665 |
apply (frule_tac vt_grant_os) |
|
666 |
apply (auto simp:proc_file_fds_def) |
|
667 |
apply (rule_tac x = fa in exI) |
|
668 |
apply (erule enrich_proc_dup_ffd) |
|
669 |
apply (simp_all add:vd all_procs a2) |
|
670 |
done |
|
671 |
ultimately have "os_grant (Execve p f fds # enrich_proc s p p') (Execve p' f (fds \<inter> proc_file_fds s p))" |
|
672 |
apply (auto simp:is_file_simps enrich_proc_dup_in a2 vd all_procs a1 enrich_proc_dup_ffds) |
|
673 |
done |
|
674 |
moreover have "grant (Execve p f fds # enrich_proc s p p') (Execve p' f (fds \<inter> proc_file_fds s p))" |
|
675 |
proof- |
|
676 |
from grant obtain up rp tp uf rf tf |
|
677 |
where p1: "sectxt_of_obj s (O_proc p) = Some (up, rp, tp)" |
|
678 |
and p2: "sectxt_of_obj s (O_file f) = Some (uf, rf, tf)" |
|
679 |
by (simp split:option.splits, blast) |
|
680 |
with grant obtain pu nr nt where p3: "npctxt_execve (up, rp, tp) (uf, rf, tf) = Some (pu, nr, nt)" |
|
681 |
by (simp split:option.splits del:npctxt_execve.simps, blast) |
|
682 |
have p1': "sectxt_of_obj (Execve p f fds # enrich_proc s p p') (O_proc p') = Some (up, rp, tp)" |
|
683 |
using p1 dup_sp a1 a0' |
|
684 |
apply (simp add:sectxt_of_obj_simps) |
|
685 |
by (simp add:cp2sproc_def split:option.splits) |
|
686 |
from os have f_in': "is_file s f" by simp |
|
687 |
from vd os have "\<exists> sf. cf2sfile s f = Some sf" |
|
688 |
by (auto dest!:is_file_in_current current_file_has_sfile) |
|
689 |
hence p2': "sectxt_of_obj (Execve p f fds # enrich_proc s p p') (O_file f) = Some (uf, rf, tf)" |
|
690 |
using f_in p2 cf2sf os a1 |
|
691 |
apply (erule_tac x = f in allE) |
|
692 |
apply (auto dest:is_file_in_current simp:cf2sfile_def sectxt_of_obj_simps split:option.splits) |
|
693 |
apply (case_tac f, simp) |
|
694 |
apply (drule_tac s = s in root_is_dir', simp add:vd, simp+) |
|
695 |
done |
|
696 |
from dup_sfd a5 have "\<forall>fd. fd \<in> proc_file_fds s p \<longrightarrow> |
|
697 |
cfd2sfd (Execve p f fds # enrich_proc s p p') p' fd = cfd2sfd s p fd" |
|
698 |
apply (rule_tac allI) |
|
699 |
apply (erule_tac x = fd in allE, clarsimp) |
|
700 |
apply (drule set_mp, simp) |
|
701 |
apply (auto simp:cfd2sfd_execve proc_file_fds_def a1) |
|
702 |
done |
|
703 |
hence "inherit_fds_check (Execve p f fds # enrich_proc s p p') (up, nr, nt) p' (fds \<inter> proc_file_fds s p)" |
|
704 |
using grant os p1 p2 p3 vd |
|
705 |
apply (clarsimp) |
|
706 |
apply (rule_tac s = s and p = p and fds = fds in enrich_inherit_fds_check_dup) |
|
707 |
apply simp_all |
|
708 |
done |
|
709 |
moreover have "search_check (Execve p f fds # enrich_proc s p p') (up, rp, tp) f" |
|
710 |
using p1 p2 p2' vd cf2sf f_in f_in' grant p3 f_in a1 |
|
711 |
apply (rule_tac s = s in enrich_search_check) |
|
712 |
apply (simp_all add:is_file_simps) |
|
713 |
apply (rule allI, rule impI, erule_tac x = fa in allE, simp) |
|
714 |
apply (drule_tac ff = fa in cf2sfile_other') |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
715 |
apply (auto simp:a2 enrich_proc_cur_files nodel) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
716 |
done |
82 | 717 |
ultimately show ?thesis |
718 |
using p1' p2' p3 |
|
719 |
apply (simp split:option.splits) |
|
720 |
using grant p1 p2 |
|
721 |
apply simp |
|
722 |
done |
|
723 |
qed |
|
724 |
ultimately show ?thesis using a1 |
|
725 |
by (erule_tac valid.intros(2), auto) |
|
726 |
qed |
|
727 |
qed |
|
728 |
moreover have "\<And>tp fds. \<lbrakk>valid (Clone tp p fds # s); p' \<noteq> p; p' \<notin> all_procs s\<rbrakk> \<Longrightarrow> |
|
729 |
valid (Clone tp p' (fds \<inter> proc_file_fds s tp) # Clone tp p fds # s)" |
|
730 |
apply (frule vt_grant_os, frule vt_grant, drule not_all_procs_prop3) |
|
731 |
apply (rule valid.intros(2)) |
|
732 |
apply (simp_all split:option.splits add:sectxt_of_obj_simps) |
|
733 |
apply (auto simp add:proc_file_fds_def)[1] |
|
734 |
apply (auto simp:inherit_fds_check_def sectxt_of_obj_simps sectxts_of_fds_def inherit_fds_check_ctxt_def) |
|
735 |
done |
|
736 |
moreover have "\<And>f flags fd opt. \<lbrakk>valid (Open p f flags fd opt # enrich_proc s p p'); |
|
737 |
is_created_proc s p; valid (Open p f flags fd opt # s); p' \<notin> all_procs s\<rbrakk> |
|
738 |
\<Longrightarrow> valid (Open p' f (remove_create_flag flags) fd None # Open p f flags fd opt # enrich_proc s p p')" |
|
739 |
proof- |
|
740 |
fix f flags fd opt |
|
741 |
assume a1: "valid (Open p f flags fd opt # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
742 |
and a3: "valid (Open p f flags fd opt # s)" and a4: "p' \<notin> all_procs s" |
|
743 |
have cp2sp: "\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp" |
|
744 |
and cf2sf: "\<forall> tf. tf \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
|
745 |
and cfd2sfd: "\<forall> tp tfd. tfd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp tfd = cfd2sfd s tp tfd" |
|
746 |
and dup_sp: "cp2sproc (enrich_proc s p p') p' = cp2sproc s p" |
|
747 |
and dup_sfd: "\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd" |
|
748 |
using pre a2 by auto |
|
749 |
from a4 a3 have a0: "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3 split:option.splits) |
|
750 |
have a5: "p' \<in> current_procs (enrich_proc s p p')" |
|
751 |
using a2 a3 vd |
|
752 |
apply (erule_tac enrich_proc_dup_in) |
|
753 |
by (simp_all add:vd a4) |
|
754 |
have a6: "is_file (Open p f flags fd opt # enrich_proc s p p') f" |
|
755 |
using a1 a3 |
|
756 |
by (auto simp:is_file_open dest:vt_grant_os) |
|
757 |
have a7: "fd \<notin> current_proc_fds (enrich_proc s p p') p'" |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
758 |
using a2 a4 vd nodel |
82 | 759 |
apply (simp add:enrich_proc_dup_ffds_eq_fds) |
760 |
apply (rule notI) |
|
761 |
apply (drule_tac p = p in file_fds_subset_pfds) |
|
762 |
apply (drule set_mp, simp) |
|
763 |
using a3 |
|
764 |
apply (drule_tac vt_grant_os) |
|
765 |
apply (auto split:option.splits) |
|
766 |
done |
|
767 |
from a1 have a8: "valid (enrich_proc s p p')" by (erule_tac valid.cases, auto) |
|
768 |
from a3 have grant: "grant s (Open p f flags fd opt)" and os: "os_grant s (Open p f flags fd opt)" |
|
769 |
by (auto dest:vt_grant_os vt_grant) |
|
770 |
show "valid (Open p' f (remove_create_flag flags) fd None # Open p f flags fd opt # enrich_proc s p p')" |
|
771 |
proof (cases opt) |
|
772 |
case None |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
773 |
have f_in: "is_file (enrich_proc s p p') f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
774 |
using vd nodel os all_procs None |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
775 |
by (auto dest:vt_grant_os simp:enrich_proc_is_file) |
82 | 776 |
from grant None obtain up rp tp uf rf tf |
777 |
where p1: "sectxt_of_obj s (O_proc p) = Some (up, rp, tp)" |
|
778 |
and p2: "sectxt_of_obj s (O_file f) = Some (uf, rf, tf)" |
|
779 |
apply (simp split:option.splits) |
|
780 |
by (case_tac a, case_tac aa, blast) |
|
781 |
have p1': "sectxt_of_obj (Open p f flags fd opt # enrich_proc s p p') (O_proc p') = Some (up, rp, tp)" |
|
782 |
using p1 dup_sp a1 |
|
783 |
apply (simp add:sectxt_of_obj_simps) |
|
784 |
by (simp add:cp2sproc_def split:option.splits) |
|
785 |
from os None have f_in': "is_file s f" by simp |
|
786 |
from vd os None have "\<exists> sf. cf2sfile s f = Some sf" |
|
787 |
by (auto dest!:is_file_in_current current_file_has_sfile) |
|
788 |
hence p2': "sectxt_of_obj (Open p f flags fd opt # enrich_proc s p p') (O_file f) = Some (uf, rf, tf)" |
|
789 |
using p2 cf2sf os a1 None f_in' vd f_in |
|
790 |
apply (erule_tac x = f in allE) |
|
791 |
apply (auto dest:is_file_in_current simp:cf2sfile_def sectxt_of_obj_simps split:option.splits) |
|
792 |
apply (case_tac f, simp) |
|
793 |
apply (drule_tac s = s in root_is_dir', simp add:vd, simp+) |
|
794 |
done |
|
795 |
have "search_check (Open p f flags fd opt # enrich_proc s p p') (up, rp, tp) f" |
|
796 |
using p1 p2 p2' vd cf2sf f_in f_in' grant f_in a1 None |
|
797 |
apply (rule_tac s = s in enrich_search_check) |
|
798 |
apply (simp_all add:is_file_simps) |
|
799 |
apply (rule allI, rule impI, erule_tac x = fa in allE, simp) |
|
800 |
apply (simp add:cf2sfile_open_none) |
|
801 |
done |
|
802 |
thus ?thesis using a0 a5 a6 a7 None a1 |
|
803 |
apply (rule_tac valid.intros(2)) |
|
804 |
apply (simp_all add:a1) |
|
805 |
apply (case_tac flags, simp add:is_creat_excl_flag_def) |
|
806 |
using p1' p2' |
|
807 |
apply simp |
|
808 |
using grant p1 p2 |
|
809 |
apply (simp add:oflags_check_remove_create) |
|
810 |
done |
|
811 |
next |
|
812 |
case (Some inum) |
|
813 |
with os obtain pf where parent: "parent f = Some pf" by auto |
|
814 |
with grant Some obtain pu rp pt pfu pfr pft where |
|
815 |
p1: "sectxt_of_obj s (O_proc p) = Some (pu, rp, pt)" |
|
816 |
and p2: "sectxt_of_obj s (O_dir pf) = Some (pfu, pfr, pft)" |
|
817 |
apply (simp split:option.splits) |
|
818 |
apply (case_tac a, case_tac aa, blast) |
|
819 |
done |
|
820 |
from p1 have p1': "sectxt_of_obj (enrich_proc s p p') (O_proc p) = Some (pu, rp, pt)" |
|
821 |
using cp2sp os |
|
822 |
apply (erule_tac x = p in allE) |
|
823 |
apply (auto split:option.splits simp:cp2sproc_def) |
|
824 |
done |
|
825 |
from os parent Some |
|
826 |
have pf_in: "is_dir s pf" by auto |
|
827 |
hence "\<exists> sf. cf2sfile s pf = Some sf" using vd |
|
828 |
by (auto dest!:is_dir_in_current current_file_has_sfile) |
|
829 |
from a1 parent Some have pf_in': "is_dir (enrich_proc s p p') pf" |
|
830 |
apply (frule_tac vt_grant_os) |
|
831 |
by (clarsimp) |
|
832 |
have p2': "sectxt_of_obj (enrich_proc s p p') (O_dir pf) = Some (pfu, pfr, pft)" |
|
833 |
proof- |
|
834 |
have "cf2sfile (enrich_proc s p p') pf = cf2sfile s pf" |
|
835 |
using cf2sf pf_in |
|
836 |
apply (drule_tac is_dir_in_current) |
|
837 |
apply (erule_tac x = pf in allE) |
|
838 |
by simp |
|
839 |
with pf_in pf_in' p2 vd Some a8 |
|
840 |
show ?thesis |
|
841 |
apply (frule_tac is_dir_not_file) |
|
842 |
apply (frule_tac s = "enrich_proc s p p'" in is_dir_not_file) |
|
843 |
apply (simp add:cf2sfile_def) |
|
844 |
apply (case_tac pf, simp) |
|
845 |
apply (simp add:sroot_def root_sec_remains) |
|
846 |
by (auto split:option.splits dest!:current_has_sec' get_pfs_secs_prop' dest:parentf_is_dir_prop1) |
|
847 |
qed |
|
848 |
from p1 have dup: "sectxt_of_obj (Open p f flags fd (Some inum) # enrich_proc s p p') (O_proc p') |
|
849 |
= Some (pu, rp, pt)" |
|
850 |
using a1 Some |
|
851 |
apply (simp add:sec_open) |
|
852 |
using dup_sp |
|
853 |
apply (auto split:option.splits if_splits simp:cp2sproc_def) |
|
854 |
done |
|
855 |
have nsf: "sectxt_of_obj (Open p f flags fd (Some inum) # enrich_proc s p p') (O_file f) |
|
856 |
= Some (pu, R_object, type_transition pt pft C_file True)" |
|
857 |
using a1 Some p1 p2 parent p2' p1' |
|
858 |
by (simp add:sec_open) |
|
859 |
have "search_check (Open p f flags fd (Some inum) # enrich_proc s p p') (pu, rp, pt) f" |
|
860 |
proof- |
|
861 |
have "search_check (Open p f flags fd (Some inum) # enrich_proc s p p') (pu, rp, pt) pf" |
|
862 |
using grant Some parent p1 p2 vd a1 pf_in pf_in' p2' |
|
863 |
apply simp |
|
864 |
apply (rule_tac s = s in enrich_search_check') |
|
865 |
apply (simp_all add:is_dir_simps sectxt_of_obj_simps) |
|
866 |
apply (rule allI, rule impI) |
|
867 |
apply (case_tac "fa = f") |
|
868 |
using os Some |
|
869 |
apply simp |
|
870 |
apply (drule_tac f' = fa in cf2sfile_open) |
|
871 |
apply (simp add:current_files_simps) |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
872 |
using enrich_proc_cur_files a2 nodel |
82 | 873 |
apply simp |
874 |
apply simp |
|
875 |
using cf2sf |
|
876 |
apply simp |
|
877 |
done |
|
878 |
moreover have "is_file (Open p f flags fd (Some inum) # enrich_proc s p p') f" |
|
879 |
using a1 Some |
|
880 |
by (simp add:is_file_open) |
|
881 |
ultimately |
|
882 |
show ?thesis |
|
883 |
using parent a1 Some nsf |
|
884 |
apply (erule_tac search_check_leveling_f) |
|
885 |
apply (simp_all) |
|
886 |
apply (simp add:search_check_file_def) |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
887 |
(* create new file, grant only check pf's SEARCH permission, not newfile itself, so we make assumptions of this case in the locale *) |
82 | 888 |
apply (simp add:permission_check.simps) |
889 |
sorry |
|
890 |
qed |
|
891 |
thus ?thesis using a0 a5 a6 a7 a1 Some |
|
892 |
apply (rule_tac valid.intros(2)) |
|
893 |
apply (simp add:a1) |
|
894 |
apply simp |
|
895 |
apply (case_tac flags, simp add:is_creat_excl_flag_def) |
|
896 |
using grant p1 p2 parent dup nsf |
|
897 |
apply (simp add:oflags_check_remove_create) |
|
898 |
done |
|
899 |
qed |
|
900 |
qed |
|
901 |
moreover have "\<And>fd. \<lbrakk>valid (CloseFd p fd # enrich_proc s p p'); is_created_proc s p; |
|
902 |
valid (CloseFd p fd # s); p' \<notin> all_procs s; fd \<in> proc_file_fds s p\<rbrakk> |
|
903 |
\<Longrightarrow> valid (CloseFd p' fd # CloseFd p fd # enrich_proc s p p')" |
|
904 |
proof- |
|
905 |
fix fd |
|
906 |
assume a1: "valid (CloseFd p fd # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
907 |
and a3: "p' \<notin> all_procs s" and a4: "valid (CloseFd p fd # s)" |
|
908 |
and a5: "fd \<in> proc_file_fds s p" |
|
909 |
from a4 a3 have a0: "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3) |
|
910 |
have "p' \<in> current_procs (enrich_proc s p p')" |
|
911 |
using a2 a3 vd |
|
912 |
by (auto intro:enrich_proc_dup_in) |
|
913 |
moreover have "fd \<in> current_proc_fds (enrich_proc s p p') p'" |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
914 |
using a5 a2 a3 vd pre_vd nodel |
82 | 915 |
apply (simp) |
916 |
apply (drule_tac s = "enrich_proc s p p'" and p = p' in file_fds_subset_pfds) |
|
917 |
apply (erule set_mp) |
|
918 |
apply (simp add:enrich_proc_dup_ffds) |
|
919 |
done |
|
920 |
ultimately show "valid (CloseFd p' fd # CloseFd p fd # enrich_proc s p p')" |
|
921 |
apply (rule_tac valid.intros(2)) |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
922 |
apply (simp_all add:a1 a0 a2 pre_vd) |
82 | 923 |
done |
924 |
qed |
|
925 |
moreover have "\<And> fd. \<lbrakk>valid (ReadFile p fd # enrich_proc s p p'); |
|
926 |
is_created_proc s p; valid (ReadFile p fd # s); p' \<notin> all_procs s\<rbrakk> |
|
927 |
\<Longrightarrow> valid (ReadFile p' fd # ReadFile p fd # enrich_proc s p p')" |
|
928 |
proof- |
|
929 |
fix fd |
|
930 |
assume a1: "valid (ReadFile p fd # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
931 |
and a3: "valid (ReadFile p fd # s)" and a4: "p' \<notin> all_procs s" |
|
932 |
from a3 have os: "os_grant s (ReadFile p fd)" and grant: "grant s (ReadFile p fd)" |
|
933 |
by (auto dest:vt_grant_os vt_grant) |
|
934 |
have cp2sp: "\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp" |
|
935 |
and cf2sf: "\<forall> tf. tf \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
|
936 |
and cfd2sfd: "\<forall> tp tfd. tfd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp tfd = cfd2sfd s tp tfd" |
|
937 |
and dup_sp: "cp2sproc (enrich_proc s p p') p' = cp2sproc s p" |
|
938 |
and dup_sfd: "\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd" |
|
939 |
using pre a2 by auto |
|
940 |
have vd_enrich: "valid (enrich_proc s p p')" using a1 by (auto dest:valid.cases) |
|
941 |
show "valid (ReadFile p' fd # ReadFile p fd # enrich_proc s p p')" |
|
942 |
proof- |
|
943 |
have "os_grant (ReadFile p fd # enrich_proc s p p') (ReadFile p' fd)" |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
944 |
using a1 a2 a4 vd os nodel |
82 | 945 |
apply (clarsimp simp:current_files_simps enrich_proc_dup_in enrich_proc_dup_ffds_eq_fds) |
946 |
apply (simp add:proc_file_fds_def) |
|
947 |
apply (rule conjI) |
|
948 |
apply (rule_tac x = f in exI, simp add:enrich_proc_dup_ffd) |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
949 |
using enrich_proc_cur_files |
82 | 950 |
apply (simp) |
951 |
apply (drule enrich_proc_dup_fflags) |
|
952 |
apply simp_all |
|
953 |
apply (erule disjE) |
|
954 |
apply auto |
|
955 |
apply (simp add:is_read_flag_def) |
|
956 |
done |
|
957 |
moreover have "grant (ReadFile p fd # enrich_proc s p p') (ReadFile p' fd)" |
|
958 |
proof- |
|
959 |
from grant obtain f sp sfd sf where p1: "file_of_proc_fd s p fd = Some f" |
|
960 |
and p2: "sectxt_of_obj s (O_proc p) = Some sp" |
|
961 |
and p3: "sectxt_of_obj s (O_fd p fd) = Some sfd" |
|
962 |
and p4: "sectxt_of_obj s (O_file f) = Some sf" |
|
963 |
by (auto split:option.splits) |
|
964 |
from os obtain flag where p0: "flags_of_proc_fd s p fd = Some flag" |
|
965 |
by auto |
|
966 |
from os have f_in_s: "f \<in> current_files s" using p1 by simp |
|
967 |
from p1 vd have isfile_s: "is_file s f" by (erule_tac file_of_pfd_is_file, simp) |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
968 |
hence isfile_s': "is_file (enrich_proc s p p') f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
969 |
using vd nodel all_procs a2 |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
970 |
by (auto simp:enrich_proc_is_file) |
82 | 971 |
from p0 obtain flag' where p0': "flags_of_proc_fd (enrich_proc s p p') p' fd = Some flag'" |
972 |
and p0'': "(flag' = flag) \<or> (flag' = remove_create_flag flag)" |
|
973 |
using a2 a4 vd |
|
974 |
apply (drule_tac enrich_proc_dup_fflags) |
|
975 |
apply auto |
|
976 |
apply (case_tac flag, auto) |
|
977 |
apply (case_tac flag, auto) |
|
978 |
done |
|
979 |
from p1 have p1': "file_of_proc_fd (enrich_proc s p p') p' fd = Some f" |
|
980 |
using a2 a4 vd |
|
981 |
by (simp add:enrich_proc_dup_ffd) |
|
982 |
from p2 have p2': "sectxt_of_obj (enrich_proc s p p') (O_proc p') = Some sp" |
|
983 |
using dup_sp |
|
984 |
by (auto simp:cp2sproc_def split:option.splits) |
|
985 |
from p3 p1 p1' p0 p0' os have p3': "sectxt_of_obj (enrich_proc s p p') (O_fd p' fd) = Some sfd" |
|
986 |
using dup_sfd |
|
987 |
apply (erule_tac x = fd in allE) |
|
988 |
apply (auto simp:proc_file_fds_def cfd2sfd_def split:option.splits) |
|
989 |
apply (drule current_file_has_sfile') |
|
990 |
apply (simp add:vd, simp) |
|
991 |
apply (drule current_file_has_sfile') |
|
992 |
apply (simp add:vd, simp) |
|
993 |
done |
|
994 |
from p4 have p4': "sectxt_of_obj (enrich_proc s p p') (O_file f) = Some sf" |
|
995 |
using f_in_s cf2sf isfile_s isfile_s' a1 vd_enrich vd |
|
996 |
apply (erule_tac x = f in allE) |
|
997 |
apply (simp) |
|
998 |
apply (auto simp:cf2sfile_def split:option.splits |
|
999 |
dest!:current_has_sec' get_pfs_secs_prop' dest:parentf_is_dir is_file_in_current) |
|
1000 |
apply (case_tac f, simp, drule root_is_dir', simp, simp, simp) |
|
1001 |
done |
|
1002 |
show ?thesis using p1' p2' p3' p4' a1 |
|
1003 |
apply (simp add:sectxt_of_obj_simps) |
|
1004 |
using grant p1 p2 p3 p4 |
|
1005 |
apply simp |
|
1006 |
done |
|
1007 |
qed |
|
1008 |
ultimately show ?thesis |
|
1009 |
using a1 |
|
1010 |
by (erule_tac valid.intros(2), simp+) |
|
1011 |
qed |
|
1012 |
qed |
|
1013 |
ultimately show ?thesis |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1014 |
using vd_enrich created_cons vd_cons' all_procs_cons |
82 | 1015 |
apply (case_tac e) |
1016 |
apply (auto simp:is_created_proc_simps split:if_splits) |
|
1017 |
done |
|
1018 |
qed |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1019 |
have sec_proc: |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1020 |
"\<And> tp. \<lbrakk>tp \<in> current_procs s; is_created_proc s p\<rbrakk> |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1021 |
\<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_proc tp) = sectxt_of_obj s (O_proc tp)" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1022 |
using pre |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1023 |
apply (clarsimp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1024 |
apply (erule_tac x = tp in allE, auto simp:cp2sproc_def split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1025 |
done |
85 | 1026 |
have sf_cons: |
1027 |
"\<forall>f. f \<in> current_files (e # s) \<longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
|
1028 |
proof clarify |
|
1029 |
fix f |
|
1030 |
assume a1: "f \<in> current_files (e # s)" |
|
1031 |
from pre have pre_sf: "\<And> f. \<lbrakk>f \<in> current_files s; is_created_proc s p\<rbrakk> |
|
1032 |
\<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f" |
|
1033 |
by auto |
|
1034 |
from a1 have a1': "f \<in> current_files (enrich_proc (e # s) p p')" |
|
1035 |
using vd_cons' nodel_cons |
|
1036 |
by (simp add:enrich_proc_cur_files) |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1037 |
from a1 have a1'': "f \<in> current_files (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1038 |
using vd_cons' nodel_cons os vd vd_enrich created_cons |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1039 |
apply (case_tac e) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1040 |
apply (auto simp:enrich_proc_cur_files current_files_simps is_created_proc_simps |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1041 |
dest:is_file_in_current is_dir_in_current split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1042 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1043 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1044 |
have sec_dir: |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1045 |
"\<And> tf. \<lbrakk>is_dir s tf; is_created_proc s p\<rbrakk> |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1046 |
\<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_dir tf) = sectxt_of_obj s (O_dir tf)" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1047 |
proof- |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1048 |
fix tf |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1049 |
assume a1: "is_dir s tf" and a2: "is_created_proc s p" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1050 |
from a2 pre |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1051 |
have pre': "\<And>f. f \<in> current_files s \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1052 |
and vd_enrich: "valid (enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1053 |
by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1054 |
hence csf: "cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1055 |
using a1 by (auto simp:is_dir_in_current) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1056 |
from a1 obtain sf where csf_some: "cf2sfile s tf = Some sf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1057 |
apply (case_tac "cf2sfile s tf") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1058 |
apply (drule current_file_has_sfile') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1059 |
apply (simp add:vd, simp add:is_dir_in_current, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1060 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1061 |
from a1 have a1': "is_dir (enrich_proc s p p') tf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1062 |
using enrich_proc_is_dir vd nodel all_procs by simp |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1063 |
from a1 have a3: "\<not> is_file s tf" using vd by (simp add:is_dir_not_file) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1064 |
from a1' vd have a3': "\<not> is_file (enrich_proc s p p') tf" by (simp add:is_dir_not_file) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1065 |
show "sectxt_of_obj (enrich_proc s p p') (O_dir tf) = sectxt_of_obj s (O_dir tf)" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1066 |
using csf csf_some a3 a3' vd_enrich vd |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1067 |
apply (auto simp:cf2sfile_def split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1068 |
apply (case_tac tf) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1069 |
apply (simp add:root_sec_remains, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1070 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1071 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1072 |
have sec_file: |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1073 |
"\<And> tf. \<lbrakk>is_file s tf; is_created_proc s p\<rbrakk> |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1074 |
\<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_file tf) = sectxt_of_obj s (O_file tf)" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1075 |
proof- |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1076 |
fix tf |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1077 |
assume a1: "is_file s tf" and a2: "is_created_proc s p" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1078 |
from a2 pre |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1079 |
have pre': "\<And>f. f \<in> current_files s \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1080 |
and vd_enrich: "valid (enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1081 |
by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1082 |
hence csf: "cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1083 |
using a1 by (auto simp:is_file_in_current) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1084 |
from a1 obtain sf where csf_some: "cf2sfile s tf = Some sf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1085 |
apply (case_tac "cf2sfile s tf") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1086 |
apply (drule current_file_has_sfile') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1087 |
apply (simp add:vd, simp add:is_file_in_current, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1088 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1089 |
from a1 have a1': "is_file (enrich_proc s p p') tf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1090 |
using vd nodel all_procs by (simp add:enrich_proc_is_file) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1091 |
show "sectxt_of_obj (enrich_proc s p p') (O_file tf) = sectxt_of_obj s (O_file tf)" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1092 |
using csf csf_some vd_enrich vd a1 a1' |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1093 |
apply (auto simp:cf2sfile_def split:option.splits if_splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1094 |
apply (case_tac tf, simp_all) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1095 |
apply (drule root_is_dir', simp+) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1096 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1097 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1098 |
have secs_dir: |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1099 |
"\<And> tf ctxts'. \<lbrakk>is_dir s tf; is_created_proc s p; get_parentfs_ctxts s tf = Some ctxts'\<rbrakk> |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1100 |
\<Longrightarrow> \<exists> ctxts. get_parentfs_ctxts (enrich_proc s p p') tf = Some ctxts \<and> set ctxts = set ctxts'" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1101 |
proof- |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1102 |
fix tf ctxts' |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1103 |
assume a1: "is_dir s tf" and a2: "is_created_proc s p" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1104 |
and a4: "get_parentfs_ctxts s tf = Some ctxts'" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1105 |
from a2 pre |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1106 |
have pre': "\<And>f. f \<in> current_files s \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1107 |
and vd_enrich': "valid (enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1108 |
by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1109 |
hence csf: "cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1110 |
using a1 by (auto simp:is_dir_in_current) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1111 |
from a1 obtain sf where csf_some: "cf2sfile s tf = Some sf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1112 |
apply (case_tac "cf2sfile s tf") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1113 |
apply (drule current_file_has_sfile') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1114 |
apply (simp add:vd, simp add:is_dir_in_current, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1115 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1116 |
from a1 have a1': "is_dir (enrich_proc s p p') tf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1117 |
using enrich_proc_is_dir vd nodel all_procs by simp |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1118 |
from a1 have a5: "\<not> is_file s tf" using vd by (simp add:is_dir_not_file) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1119 |
from a1' vd have a5': "\<not> is_file (enrich_proc s p p') tf" by (simp add:is_dir_not_file) |
85 | 1120 |
|
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1121 |
from a1' pre_vd a2 obtain ctxts |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1122 |
where a3: "get_parentfs_ctxts (enrich_proc s p p') tf = Some ctxts" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1123 |
apply (case_tac "get_parentfs_ctxts (enrich_proc s p p') tf") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1124 |
apply (drule get_pfs_secs_prop', simp+) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1125 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1126 |
moreover have "set ctxts = set ctxts'" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1127 |
proof (cases tf) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1128 |
case Nil |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1129 |
with a3 a4 vd vd_enrich' |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1130 |
show ?thesis |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1131 |
by (simp add:get_parentfs_ctxts.simps root_sec_remains split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1132 |
next |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1133 |
case (Cons a ff) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1134 |
with csf csf_some a5 a5' vd_enrich' vd a3 a4 |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1135 |
show ?thesis |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1136 |
apply (auto simp:cf2sfile_def split:option.splits if_splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1137 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1138 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1139 |
ultimately |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1140 |
show "\<exists> ctxts. get_parentfs_ctxts (enrich_proc s p p') tf = Some ctxts \<and> set ctxts = set ctxts'" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1141 |
by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1142 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1143 |
have b1: "\<And> proc f' flags fd' opt. e = Open proc f' flags fd' opt |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1144 |
\<Longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1145 |
proof- |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1146 |
fix proc f' flags fd' opt |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1147 |
assume ev: "e = Open proc f' flags fd' opt" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1148 |
have b1': "cf2sfile (e # enrich_proc s p p') f = cf2sfile (e # s) f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1149 |
proof (cases opt) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1150 |
case None |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1151 |
thus ?thesis |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1152 |
using vd_cons' vd_enrich a1 created_cons |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1153 |
by (simp add:cf2sfile_open_none ev pre_sf |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1154 |
is_created_proc_simps current_files_simps) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1155 |
next |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1156 |
case (Some inum) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1157 |
show ?thesis |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1158 |
proof (cases "f' = f") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1159 |
case True |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1160 |
from a1 obtain sf where csf: "cf2sfile (e # s) f = Some sf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1161 |
apply (case_tac "cf2sfile (e # s) f") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1162 |
apply (drule current_file_has_sfile') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1163 |
apply (simp add:vd_cons', simp, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1164 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1165 |
from a1 ev os Some True obtain pf where parent: "parent f = Some pf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1166 |
and pdir: "is_dir s pf" and proc_in: "proc \<in> current_procs s" by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1167 |
have f_in: "f \<in> current_files (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1168 |
using ev True Some |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1169 |
by (simp add:current_files_open) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1170 |
thus ?thesis using ev Some csf vd_enrich True created_cons vd_cons' a1 parent pdir proc_in |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1171 |
apply (simp add:is_created_proc_simps cf2sfile_open) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1172 |
apply (simp add:sectxt_of_obj_simps sec_dir sec_proc split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1173 |
apply (drule_tac tf = pf in secs_dir, simp+) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1174 |
apply (erule exE, erule conjE, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1175 |
apply (case_tac aa, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1176 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1177 |
next |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1178 |
case False |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1179 |
have f_in: "f \<in> current_files (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1180 |
using ev False Some vd_enrich a1 created_cons nodel vd |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1181 |
by (simp add:current_files_open is_created_proc_simps enrich_proc_cur_files) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1182 |
with ev Some a1 vd_enrich vd_cons' created_cons False |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1183 |
show ?thesis |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1184 |
apply (simp add:is_created_proc_simps cf2sfile_open) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1185 |
apply (simp add:current_files_simps pre_sf) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1186 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1187 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1188 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1189 |
show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1190 |
using ev vd_enrich_cons |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1191 |
apply simp |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1192 |
apply (rule conjI, rule impI) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1193 |
apply (simp add:cf2sfile_open_none) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1194 |
using b1' apply (auto dest:vd_cons) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1195 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1196 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1197 |
have b2: "\<And> proc f' inum. e = Mkdir proc f' inum |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1198 |
\<Longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1199 |
proof- |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1200 |
fix proc f' inum |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1201 |
assume ev: "e = Mkdir proc f' inum" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1202 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1203 |
show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1204 |
proof (cases "f' = f") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1205 |
case True |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1206 |
from a1 obtain sf where csf: "cf2sfile (e # s) f = Some sf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1207 |
apply (case_tac "cf2sfile (e # s) f") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1208 |
apply (drule current_file_has_sfile') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1209 |
apply (simp add:vd_cons', simp, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1210 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1211 |
from a1 ev os True obtain pf where parent: "parent f = Some pf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1212 |
and pdir: "is_dir s pf" and proc_in: "proc \<in> current_procs s" by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1213 |
have f_in: "f \<in> current_files (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1214 |
using ev True |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1215 |
by (simp add:current_files_mkdir) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1216 |
thus ?thesis using ev csf vd_enrich True created_cons vd_cons' a1 parent pdir proc_in |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1217 |
apply (simp add:is_created_proc_simps cf2sfile_mkdir) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1218 |
apply (simp add:sectxt_of_obj_simps sec_dir sec_proc split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1219 |
apply (drule_tac tf = pf in secs_dir, simp+) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1220 |
apply (erule exE, erule conjE, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1221 |
apply (case_tac aa, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1222 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1223 |
next |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1224 |
case False |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1225 |
have f_in: "f \<in> current_files (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1226 |
using ev False vd_enrich a1 created_cons nodel vd |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1227 |
by (simp add:current_files_mkdir is_created_proc_simps enrich_proc_cur_files) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1228 |
with ev a1 vd_enrich vd_cons' created_cons False |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1229 |
show ?thesis |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1230 |
apply (simp add:is_created_proc_simps cf2sfile_mkdir) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1231 |
apply (simp add:current_files_simps pre_sf) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1232 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1233 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1234 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1235 |
have b3: "\<And> proc f' f''. e = LinkHard proc f' f'' |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1236 |
\<Longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1237 |
proof- |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1238 |
fix proc f' f'' |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1239 |
assume ev: "e = LinkHard proc f' f''" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1240 |
show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1241 |
proof (cases "f'' = f") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1242 |
case True |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1243 |
from a1 obtain sf where csf: "cf2sfile (e # s) f = Some sf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1244 |
apply (case_tac "cf2sfile (e # s) f") |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1245 |
apply (drule current_file_has_sfile') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1246 |
apply (simp add:vd_cons', simp, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1247 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1248 |
from a1 ev os True obtain pf where parent: "parent f'' = Some pf" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1249 |
and pdir: "is_dir s pf" and proc_in: "proc \<in> current_procs s" by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1250 |
have f_in: "f \<in> current_files (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1251 |
using ev True vd_enrich created_cons |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1252 |
by (simp add:current_files_simps is_created_proc_simps) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1253 |
thus ?thesis using ev csf vd_enrich True created_cons vd_cons' a1 parent pdir proc_in |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1254 |
apply (simp add:is_created_proc_simps cf2sfile_linkhard) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1255 |
apply (simp add:sectxt_of_obj_simps sec_dir sec_proc split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1256 |
apply (drule_tac tf = pf in secs_dir, simp+) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1257 |
apply (erule exE, erule conjE, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1258 |
apply (case_tac aa, simp) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1259 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1260 |
next |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1261 |
case False |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1262 |
have f_in: "f \<in> current_files (e # enrich_proc s p p')" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1263 |
using ev False vd_enrich a1 created_cons nodel vd vd_cons' |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1264 |
by (simp add:current_files_linkhard is_created_proc_simps enrich_proc_cur_files) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1265 |
with ev a1 vd_enrich vd_cons' created_cons False |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1266 |
show ?thesis |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1267 |
apply (simp add:is_created_proc_simps cf2sfile_linkhard) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1268 |
apply (simp add:current_files_simps pre_sf) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1269 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1270 |
qed |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1271 |
qed |
85 | 1272 |
show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1273 |
apply (case_tac e) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1274 |
prefer 6 apply (erule b1) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1275 |
prefer 11 apply (erule b2) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1276 |
prefer 11 apply (erule b3) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1277 |
using vd created_cons nodel_cons vd_enrich_cons vd_cons' a1 a1' |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1278 |
apply (auto intro!:pre_sf simp:cf2sfile_simps is_created_proc_simps current_files_simps |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1279 |
split:if_splits dest:vd_cons cf2sfile_other') |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1280 |
done |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1281 |
qed |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1282 |
moreover have "\<forall>tp fd. fd \<in> proc_file_fds (e # s) tp \<longrightarrow> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1283 |
cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
83 | 1284 |
proof clarify |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1285 |
fix tp fd |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1286 |
assume a1: "fd \<in> proc_file_fds (e # s) tp" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1287 |
from a1 obtain f where a1': "file_of_proc_fd (e # s) tp fd = Some f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1288 |
by (auto simp:proc_file_fds_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1289 |
from pre have pre_sfd: "\<And> tp fd. \<lbrakk>fd \<in> proc_file_fds s tp; is_created_proc s p\<rbrakk> \<Longrightarrow> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1290 |
cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd" by auto |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1291 |
hence pre_sfd': "\<And> tp fd f. \<lbrakk>file_of_proc_fd s tp fd = Some f; is_created_proc s p\<rbrakk> \<Longrightarrow> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1292 |
cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd" by (auto simp:proc_file_fds_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1293 |
hence pre_sfd'': "\<And> tp fd f proc. \<lbrakk>file_of_proc_fd s tp fd = Some f; is_created_proc s p; p = proc\<rbrakk> \<Longrightarrow> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1294 |
cfd2sfd (enrich_proc s proc p') tp fd = cfd2sfd s tp fd" by (auto simp:proc_file_fds_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1295 |
from a1' all_procs_cons vd_cons' have a2: "tp \<noteq> p'" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1296 |
apply (drule_tac not_all_procs_prop3) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1297 |
apply (drule proc_fd_in_procs, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1298 |
by (rule notI, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1299 |
have a3: "p' \<noteq> p" using all_procs_cons created_cons |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1300 |
apply (drule_tac not_all_procs_prop3) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1301 |
apply (rule notI, simp add:is_created_proc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1302 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1303 |
have a4: "file_of_proc_fd (enrich_proc (e # s) p p') tp fd = Some f" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1304 |
using a1' nodel_cons all_procs_cons a1' created_cons vd_cons' |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1305 |
apply (frule_tac enrich_proc_filefd, simp_all) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1306 |
done |
85 | 1307 |
have sec_proc: |
1308 |
"\<And> tp. \<lbrakk>tp \<in> current_procs s; is_created_proc s p\<rbrakk> |
|
1309 |
\<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_proc tp) = sectxt_of_obj s (O_proc tp)" |
|
1310 |
using pre |
|
1311 |
apply (clarsimp) |
|
1312 |
apply (erule_tac x = tp in allE, auto simp:cp2sproc_def split:option.splits) |
|
1313 |
done |
|
1314 |
have sec_proc': |
|
1315 |
"\<And> tp. \<lbrakk>tp \<in> current_procs s; is_created_proc s p; p = tp\<rbrakk> |
|
1316 |
\<Longrightarrow> sectxt_of_obj (enrich_proc s tp p') (O_proc tp) = sectxt_of_obj s (O_proc tp)" |
|
1317 |
apply (drule_tac sec_proc, simp+) |
|
1318 |
done |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1319 |
show "cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1320 |
proof- |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1321 |
have b1: "\<And> proc f' fds. e = Execve proc f' fds |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1322 |
\<Longrightarrow> cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1323 |
using a4 vd_enrich_cons a1' vd_cons' created_cons |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1324 |
apply (simp split:if_splits del:file_of_proc_fd.simps add:a2) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1325 |
apply (simp only:cfd2sfd_execve) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1326 |
apply (drule_tac s = "Execve proc f' fds # enrich_proc s proc p'" in vd_cons) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1327 |
apply (simp split:if_splits add:a2) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1328 |
apply (drule_tac p' = proc and fd' = fd and s = "enrich_proc s proc p'" in cfd2sfd_execve, simp+) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1329 |
apply (erule_tac pre_sfd'', simp add:is_created_proc_simps, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1330 |
apply (drule_tac p' = tp and fd' = fd in cfd2sfd_execve, simp+) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1331 |
apply (erule_tac pre_sfd'', simp add:is_created_proc_simps, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1332 |
apply (simp only:cfd2sfd_execve) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1333 |
apply (rule_tac pre_sfd') |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1334 |
apply (auto split:if_splits simp:is_created_proc_simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1335 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1336 |
have b2: "\<And> proc proc' fds. e = Clone proc proc' fds |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1337 |
\<Longrightarrow> cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1338 |
using a4 vd_enrich_cons a1' vd_cons' created_cons |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1339 |
apply (simp split:if_splits del:file_of_proc_fd.simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1340 |
apply (simp add:cfd2sfd_clone add:a2) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1341 |
apply (simp add:cfd2sfd_clone split:if_splits) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1342 |
apply (erule pre_sfd'', simp add:is_created_proc_simps, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1343 |
apply (erule pre_sfd', simp add:is_created_proc_simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1344 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1345 |
have b3: "\<And> proc f' flags fd' opt. e = Open proc f' flags fd' opt |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1346 |
\<Longrightarrow> cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
85 | 1347 |
using a4 a1' vd_enrich_cons vd_cons' created_cons |
1348 |
apply (simp split:if_splits del:file_of_proc_fd.simps) |
|
1349 |
||
1350 |
apply (simp add:cfd2sfd_open sec_open is_created_proc_simps a2 del:file_of_proc_fd.simps) |
|
1351 |
apply (tactic {*my_clarify_tac 1*}) |
|
1352 |
apply (drule vd_cons) |
|
1353 |
apply (simp add:cfd2sfd_open sec_open a3 a2 split:if_splits) |
|
1354 |
apply (case_tac "proc \<in> current_procs s") |
|
1355 |
apply (simp add:sec_proc') |
|
1356 |
apply (case_tac "sectxt_of_obj s (O_proc proc)", simp+) |
|
1357 |
apply (case_tac "f \<in> current_files (e # s)") |
|
1358 |
apply (drule sf_cons[rule_format], simp) |
|
1359 |
using vd_enrich_cons |
|
1360 |
apply (simp add:cf2sfile_open_none) |
|
1361 |
using os |
|
1362 |
apply (simp add:current_files_simps is_file_in_current split:option.splits) |
|
1363 |
using os |
|
1364 |
apply (simp split:option.splits) |
|
1365 |
apply (rule impI) |
|
1366 |
apply (simp add:cfd2sfd_open sec_open a3 a2 split:if_splits) |
|
1367 |
apply (drule vd_cons) |
|
1368 |
apply (drule_tac p' = tp and fd' = fd and f' = f and s = "enrich_proc s proc p'" in cfd2sfd_open) |
|
1369 |
apply (simp, rule impI, simp) |
|
1370 |
apply (simp split:if_splits, rule conjI, rule impI, simp) |
|
1371 |
apply (drule pre_sfd', simp, simp) |
|
1372 |
||
1373 |
apply (simp add:cfd2sfd_open sec_open is_created_proc_simps a2 del:file_of_proc_fd.simps) |
|
1374 |
apply (case_tac "proc \<in> current_procs s") |
|
1375 |
apply (simp add:sec_proc) |
|
1376 |
apply (case_tac "f' \<in> current_files (e # s)") |
|
1377 |
apply (drule sf_cons[rule_format], simp) |
|
1378 |
apply (simp split:option.splits) |
|
1379 |
apply (rule impI|rule conjI)+ |
|
1380 |
apply (drule current_has_sec', simp add:vd, simp add:os) |
|
1381 |
apply (rule impI, rule impI) |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1382 |
apply (simp split:if_splits) |
85 | 1383 |
apply (simp add:pre_sfd') |
1384 |
using os |
|
1385 |
apply (simp add:current_files_simps is_file_in_current split:option.splits) |
|
1386 |
using os |
|
1387 |
apply (simp split:option.splits) |
|
1388 |
done |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1389 |
have b4: "\<And> proc fd'. e = ReadFile proc fd' |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1390 |
\<Longrightarrow> cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1391 |
using a4 vd_enrich_cons a1' vd_cons' created_cons |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1392 |
apply (simp split:if_splits del:file_of_proc_fd.simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1393 |
apply (frule_tac s = "ReadFile proc fd' # enrich_proc s proc p'" in vd_cons) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1394 |
apply (simp add:cfd2sfd_other) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1395 |
apply (erule pre_sfd'', simp add:is_created_proc_simps, simp) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1396 |
apply (simp add:cfd2sfd_other) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1397 |
apply (erule pre_sfd', simp add:is_created_proc_simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1398 |
done |
83 | 1399 |
show ?thesis |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1400 |
apply (case_tac e) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1401 |
apply (erule b1, erule b2) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1402 |
prefer 4 apply (erule b3) prefer 4 apply (erule b4) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1403 |
using vd created_cons nodel_cons a1' a4 vd_enrich_cons vd_cons' |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1404 |
apply (auto intro!:pre_sfd' simp:cfd2sfd_simps is_created_proc_simps |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1405 |
simp del:file_of_proc_fd.simps split:if_splits dest:vd_cons enrich_proc_filefd) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1406 |
apply (simp_all) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1407 |
done |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1408 |
qed |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1409 |
qed |
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1410 |
moreover have "\<forall>q. q \<in> current_msgqs (e # s) \<longrightarrow> cq2smsgq (enrich_proc (e # s) p p') q = cq2smsgq (e # s) q" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1411 |
proof clarify |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1412 |
fix q |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1413 |
assume a1: "q \<in> current_msgqs (e # s)" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1414 |
from pre have pre_smsgq: "\<And> q. \<lbrakk>q \<in> current_msgqs s; is_created_proc s p\<rbrakk> |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1415 |
\<Longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1416 |
by auto |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1417 |
show "cq2smsgq (enrich_proc (e # s) p p') q = cq2smsgq (e # s) q" |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1418 |
using vd_enrich_cons a1 created_cons nodel_cons vd_cons' os |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1419 |
apply (case_tac e) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1420 |
apply (auto simp:cq2smsgq_simps cq2smsg_createmsgq is_created_proc_simps sec_proc |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1421 |
dest:cq2smsgq_other intro!:pre_smsgq split:if_splits dest:vd_cons) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1422 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1423 |
apply (simp add:sectxt_of_obj_simps split:option.splits) |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1424 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1425 |
thm sec_proc |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1426 |
thm cq2smsgq_simps |
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1427 |
thm cq2smsg_createmsgq |
82 | 1428 |
sorry |
86
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
1429 |
moreover have "\<forall>tp. tp \<in> current_procs (e # s) \<longrightarrow> cp2sproc (enrich_proc (e # s) p p') tp = cp2sproc (e # s) tp" |
82 | 1430 |
sorry |
1431 |
moreover have "cp2sproc (enrich_proc (e # s) p p') p' = cp2sproc (e # s) p" |
|
1432 |
proof- |
|
1433 |
from pre have b0: "is_created_proc s p \<Longrightarrow> cp2sproc (enrich_proc s p p') p' = cp2sproc s p" by simp |
|
1434 |
have b1: "\<And> tp f fds. \<lbrakk>valid (enrich_proc (Execve tp f fds # s) p p'); valid (Execve tp f fds # s); |
|
1435 |
is_created_proc (Execve tp f fds # s) p; p' \<notin> all_procs (Execve tp f fds # s)\<rbrakk> |
|
1436 |
\<Longrightarrow> cp2sproc (enrich_proc (Execve tp f fds # s) p p') p' = cp2sproc (Execve tp f fds # s) p" |
|
1437 |
proof- |
|
1438 |
fix tp f fds |
|
1439 |
assume a1: "valid (enrich_proc (Execve tp f fds # s) p p')" |
|
1440 |
and a2: "valid (Execve tp f fds # s)" and a3: "is_created_proc (Execve tp f fds # s) p" |
|
1441 |
and a4: "p' \<notin> all_procs (Execve tp f fds # s)" |
|
1442 |
show "cp2sproc (enrich_proc (Execve tp f fds # s) p p') p' = cp2sproc (Execve tp f fds # s) p" |
|
1443 |
proof (cases "tp = p") |
|
1444 |
case True |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1445 |
show ?thesis using True a1 a2 a3 a4 b0 vd |
82 | 1446 |
thm not_all_procs_prop3 |
83 | 1447 |
apply (frule_tac not_all_procs_prop2) |
1448 |
apply (frule not_all_procs_prop3) |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1449 |
apply (simp add:is_created_proc_simps) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1450 |
apply (frule vd_cons) (* |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1451 |
apply (frule_tac vt_grant_os) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1452 |
apply (frule_tac \<tau> = "enrich_proc s p p'" in vt_grant_os) *) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1453 |
apply (frule_tac s = "enrich_proc s p p'" in vd_cons) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1454 |
apply (frule_tac \<tau> = s in vt_grant_os) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1455 |
apply (case_tac "p' = p", simp) (* |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1456 |
apply (auto simp add:cp2sproc_execve sectxt_of_obj_simps enrich_proc_dup_in |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1457 |
split:option.splits dest!:current_has_sec' dest:vt_grant is_file) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1458 |
apply (simp_all add:is_created_proc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1459 |
apply (auto simp:cp2sproc_def) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1460 |
apply (simp_all add:enrich_proc_dup_in) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1461 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1462 |
|
83 | 1463 |
apply (auto simp:sectxt_of_obj_simps split:option.splits dest:valid.cases) |
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1464 |
*) |
82 | 1465 |
sorry |
1466 |
next |
|
1467 |
case False |
|
1468 |
show ?thesis sorry |
|
1469 |
qed |
|
1470 |
qed |
|
1471 |
have b2: "\<And> tp fd. cp2sproc (enrich_proc (ReadFile tp fd # s) p p') p' = cp2sproc (ReadFile tp fd # s) p" |
|
1472 |
sorry |
|
1473 |
have b3: "\<And> tp. cp2sproc (enrich_proc (Exit tp # s) p p') p' = cp2sproc (Exit tp # s) p" |
|
1474 |
sorry |
|
1475 |
have b4: "\<And> tp tp'. cp2sproc (enrich_proc (Kill tp tp' # s) p p') p' = cp2sproc (Kill tp tp' # s) p" |
|
1476 |
sorry |
|
1477 |
have b5: "\<And> tp tp' fds. cp2sproc (enrich_proc (Clone tp tp' fds # s) p p') p' = |
|
1478 |
cp2sproc (Clone tp tp' fds # s) p" |
|
1479 |
sorry |
|
1480 |
have b6: "\<And> tp f flags fd opt. cp2sproc (enrich_proc (Open tp f flags fd opt # s) p p') p' = |
|
1481 |
cp2sproc (Open tp f flags fd opt # s) p" |
|
1482 |
sorry |
|
1483 |
have b7: "\<And> tp fd. cp2sproc (enrich_proc (CloseFd tp fd # s) p p') p' = cp2sproc (CloseFd tp fd # s) p" |
|
1484 |
sorry |
|
1485 |
show ?thesis using vd_enrich_cons |
|
1486 |
apply (case_tac e) |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1487 |
using vd_cons' created_cons all_procs_cons |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1488 |
apply (auto intro!:b1 b2 b3 b4 b5 b6 b7 simp del:enrich_proc.simps) |
83 | 1489 |
using created_cons vd_enrich_cons vd_cons' b0 |
82 | 1490 |
apply (auto simp:cp2sproc_other is_created_proc_def) |
1491 |
done |
|
1492 |
qed |
|
1493 |
moreover have "\<forall> fd. fd \<in> proc_file_fds (e # s) p \<longrightarrow> |
|
1494 |
cfd2sfd (enrich_proc (e # s) p p') p' fd = cfd2sfd (e # s) p fd" |
|
1495 |
sorry |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1496 |
ultimately show ?case using vd_enrich_cons |
82 | 1497 |
by simp |
1498 |
qed |
|
1499 |
||
88 | 1500 |
lemma enrich_proc_s2ss: |
1501 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s\<rbrakk> \<Longrightarrow> s2ss (enrich_proc s p p') = s2ss s" |
|
82 | 1502 |
|
1503 |
lemma enrich_proc_valid: |
|
1504 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s\<rbrakk> \<Longrightarrow> valid (enrich_proc s p p')" |
|
1505 |
by (auto dest:enrich_proc_prop) |
|
1506 |
||
1507 |
lemma enrich_proc_valid: |
|
1508 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s\<rbrakk> \<Longrightarrow> " |
|
1509 |
||
1510 |
lemma enrich_proc_tainted: |
|
1511 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; valid s\<rbrakk> |
|
1512 |
\<Longrightarrow> tainted (enrich_proc s p p') = (if (O_proc p \<in> tainted s) |
|
1513 |
then tainted s \<union> {O_proc p'} else tainted s)" |
|
1514 |
apply (induct s) |
|
1515 |
apply (simp add:is_created_proc_def) |
|
1516 |
apply (frule vt_grant_os, frule vd_cons, simp) |
|
1517 |
apply (frule enrich_proc_dup_in, simp+) |
|
1518 |
apply (frule not_all_procs_prop3) |
|
1519 |
apply (case_tac a) |
|
1520 |
prefer 3 |
|
1521 |
apply (simp split:if_splits) |
|
1522 |
apply (rule impI|rule conjI)+ |
|
1523 |
apply (simp add:is_created_proc_def) |
|
1524 |
apply (auto simp:is_created_proc_def split:if_splits dest:tainted_in_current)[1] |
|
1525 |
apply (simp add:is_created_proc_def) |
|
1526 |
||
1527 |
prefer 4 |
|
1528 |
apply (simp split:if_splits) |
|
1529 |
apply (rule impI|rule conjI)+ |
|
1530 |
apply (simp add:is_created_proc_def) |
|
1531 |
apply (auto simp:is_created_proc_def split:if_splits dest:tainted_in_current)[1] |
|
1532 |
apply (simp add:is_created_proc_def) |
|
1533 |
||
1534 |
prefer 4 |
|
1535 |
apply (auto simp:is_created_proc_def split:if_splits option.splits dest:tainted_in_current)[1] |
|
1536 |
||
1537 |
prefer 4 |
|
1538 |
apply (auto simp:is_created_proc_def split:if_splits option.splits dest:tainted_in_current enrich_proc_dup_ffd enrich_proc_dup_ffd')[1] |
|
1539 |
||
1540 |
||
1541 |
||
1542 |
lemma enrich_proc_dup_tainted: |
|
1543 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; valid s\<rbrakk> |
|
1544 |
\<Longrightarrow> (O_proc p' \<in> tainted (enrich_proc s p p')) = (O_proc p \<in> tainted s)" |
|
1545 |
apply (induct s) |
|
1546 |
apply (simp add:is_created_proc_def) |
|
1547 |
apply (frule vt_grant_os, frule vd_cons) |
|
1548 |
apply (case_tac a) |
|
1549 |
apply (auto simp:is_created_proc_def)[1] |
|
1550 |
||
1551 |
||
1552 |
lemma enrich_proc_tainted: |
|
84
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1553 |
|
82 | 1554 |
|
1555 |
||
1556 |
end |
|
1557 |
||
1558 |
end |