author | chunhan |
Mon, 30 Dec 2013 23:41:58 +0800 | |
changeset 86 | 690636b7b6f1 |
parent 85 | 1d1aa5bdd37d |
child 87 | 8d18cfc845dd |
permissions | -rw-r--r-- |
82 | 1 |
theory Enrich |
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 |
||
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
|
8 |
(* \<And> *) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
9 |
lemma current_proc_fds_in_curp: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
10 |
"\<lbrakk>fd \<in> current_proc_fds s p; valid s\<rbrakk> \<Longrightarrow> p \<in> current_procs 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
|
11 |
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
|
12 |
apply (simp add:init_fds_of_proc_prop1) |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
13 |
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
|
14 |
apply (case_tac a, auto split:if_splits option.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
|
15 |
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
|
16 |
|
82 | 17 |
lemma get_parentfs_ctxts_prop: |
18 |
"\<lbrakk>get_parentfs_ctxts s (a # f) = Some ctxts; sectxt_of_obj s (O_dir f) = Some ctxt; valid s\<rbrakk> |
|
19 |
\<Longrightarrow> ctxt \<in> set (ctxts)" |
|
20 |
apply (induct f) |
|
21 |
apply (auto split:option.splits) |
|
22 |
done |
|
23 |
||
24 |
lemma search_check_allp_intro: |
|
25 |
"\<lbrakk>search_check s sp pf; get_parentfs_ctxts s pf = Some ctxts; valid s; is_dir s pf\<rbrakk> |
|
26 |
\<Longrightarrow> search_check_allp sp (set ctxts)" |
|
27 |
apply (case_tac pf) |
|
28 |
apply (simp split:option.splits if_splits add:search_check_allp_def) |
|
29 |
apply (rule ballI) |
|
30 |
apply (auto simp:search_check_ctxt_def search_check_dir_def split:if_splits option.splits) |
|
31 |
apply (auto simp:search_check_allp_def search_check_file_def) |
|
32 |
apply (frule is_dir_not_file, simp) |
|
33 |
done |
|
34 |
||
35 |
lemma search_check_leveling_f: |
|
36 |
"\<lbrakk>search_check s sp pf; parent f = Some pf; is_file s f; valid s; |
|
37 |
sectxt_of_obj s (O_file f) = Some fctxt; search_check_file sp fctxt\<rbrakk> |
|
38 |
\<Longrightarrow> search_check s sp f" |
|
39 |
apply (case_tac f, simp+) |
|
40 |
apply (auto split:option.splits simp:search_check_ctxt_def) |
|
41 |
apply (frule parentf_is_dir_prop2, simp) |
|
42 |
apply (erule get_pfs_secs_prop, simp) |
|
43 |
apply (erule_tac search_check_allp_intro, simp_all) |
|
44 |
apply (simp add:parentf_is_dir_prop2) |
|
45 |
done |
|
46 |
||
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
|
47 |
lemma enrich_proc_dup_ffds': |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
48 |
"\<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> |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
49 |
\<Longrightarrow> fd \<notin> proc_file_fds s p \<and> file_of_proc_fd 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
|
50 |
apply (auto simp:enrich_proc_dup_ffds_eq_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
|
51 |
apply (simp add: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
|
52 |
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
|
53 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
54 |
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
|
55 |
"\<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
|
56 |
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
|
57 |
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
|
58 |
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
|
59 |
apply (case_tac a, 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
|
60 |
apply (auto split:option.splits simp del:grant.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
|
61 |
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
|
62 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
63 |
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
|
64 |
"\<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
|
65 |
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
|
66 |
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
|
67 |
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
|
68 |
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
|
69 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
70 |
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
|
71 |
"\<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
|
72 |
\<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
|
73 |
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
|
74 |
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
|
75 |
apply (frule vd_cons, frule 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
|
76 |
apply (case_tac a, auto split:option.splits simp: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
|
77 |
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
|
78 |
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
|
79 |
apply (drule filefd_socket_conflict, simp_all add:current_sockets_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
|
80 |
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
|
81 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
82 |
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
|
83 |
"\<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
|
84 |
\<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
|
85 |
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
|
86 |
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
|
87 |
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
|
88 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
89 |
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
|
90 |
"\<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
|
91 |
\<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
|
92 |
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
|
93 |
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
|
94 |
apply (frule vd_cons, frule 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
|
95 |
apply (case_tac a, auto split:option.splits t_socket_type.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
|
96 |
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
|
97 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
98 |
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
|
99 |
"\<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
|
100 |
\<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
|
101 |
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
|
102 |
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
|
103 |
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
|
104 |
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
|
105 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
106 |
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
|
107 |
"\<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
|
108 |
\<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
|
109 |
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
|
110 |
apply (auto simp add:is_udp_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
|
111 |
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
|
112 |
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
|
113 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
114 |
lemma 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
|
115 |
"valid s \<Longrightarrow> current_msgqs (enrich_proc s p p') = current_msgqs 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
|
116 |
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
|
117 |
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
|
118 |
apply (case_tac a, 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
|
119 |
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
|
120 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
121 |
lemma enrich_proc_cur_msgs: |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
122 |
"valid s \<Longrightarrow> msgs_of_queue (enrich_proc s p p') q = msgs_of_queue s q " |
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
123 |
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
|
124 |
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
|
125 |
apply (case_tac a, 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
|
126 |
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
|
127 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
128 |
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
|
129 |
"\<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
|
130 |
\<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
|
131 |
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
|
132 |
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
|
133 |
apply (case_tac a, 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
|
134 |
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
|
135 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
136 |
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
|
137 |
"\<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
|
138 |
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
|
139 |
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
|
140 |
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
|
141 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
142 |
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
|
143 |
"\<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
|
144 |
\<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
|
145 |
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
|
146 |
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
|
147 |
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
|
148 |
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
|
149 |
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
|
150 |
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
|
151 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
152 |
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
|
153 |
"\<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
|
154 |
\<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
|
155 |
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
|
156 |
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
|
157 |
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
|
158 |
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
|
159 |
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
|
160 |
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
|
161 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
162 |
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
|
163 |
"\<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
|
164 |
\<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
|
165 |
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
|
166 |
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
|
167 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
168 |
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
|
169 |
"\<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
|
170 |
\<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
|
171 |
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
|
172 |
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
|
173 |
enrich_proc_cur_msgqs enrich_proc_cur_msgs 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
|
174 |
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
|
175 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
176 |
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
|
177 |
"\<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
|
178 |
\<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
|
179 |
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
|
180 |
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
|
181 |
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
|
182 |
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
|
183 |
apply (auto simp:is_created_proc_simps dest:proc_fd_in_procs 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
|
184 |
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
|
185 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
186 |
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
|
187 |
"\<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
|
188 |
\<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
|
189 |
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
|
190 |
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
|
191 |
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
|
192 |
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
|
193 |
apply (auto simp:is_created_proc_simps dest:proc_fd_in_procs current_fflag_has_ffd split:if_splits option.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
|
194 |
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
|
195 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
196 |
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
|
197 |
"\<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
|
198 |
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
|
199 |
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
|
200 |
apply (case_tac a, auto simp:files_hung_by_del.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
|
201 |
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
|
202 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
203 |
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
|
204 |
"\<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
|
205 |
\<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
|
206 |
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
|
207 |
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
|
208 |
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
|
209 |
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
|
210 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
211 |
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
|
212 |
"\<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
|
213 |
\<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
|
214 |
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
|
215 |
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
|
216 |
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
|
217 |
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
|
218 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
219 |
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
|
220 |
"\<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
|
221 |
\<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
|
222 |
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
|
223 |
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
|
224 |
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
|
225 |
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
|
226 |
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
|
227 |
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
|
228 |
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
|
229 |
|
82 | 230 |
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
|
231 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s; no_del_event s\<rbrakk> |
82 | 232 |
\<Longrightarrow> valid (enrich_proc s p p') \<and> |
233 |
(\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp) \<and> |
|
234 |
(\<forall> f. f \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f) \<and> |
|
235 |
(\<forall> q. q \<in> current_msgqs s \<longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q) \<and> |
|
236 |
(\<forall> tp fd. fd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd) \<and> |
|
237 |
(cp2sproc (enrich_proc s p p') p' = cp2sproc s p) \<and> |
|
238 |
(\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd)" |
|
239 |
proof (induct s) |
|
240 |
case Nil |
|
241 |
thus ?case by (auto simp:is_created_proc_def) |
|
242 |
next |
|
243 |
case (Cons e s) |
|
83 | 244 |
hence vd_cons': "valid (e # s)" and created_cons: "is_created_proc (e # s) p" |
82 | 245 |
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
|
246 |
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
|
247 |
and nodel_cons: "no_del_event (e # s)" |
83 | 248 |
by (auto dest:vd_cons' vt_grant_os vt_grant) |
82 | 249 |
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
|
250 |
from nodel_cons have nodel: "no_del_event s" by (case_tac e, auto) |
82 | 251 |
from Cons have pre: "is_created_proc s p \<Longrightarrow> valid (enrich_proc s p p') \<and> |
252 |
(\<forall>tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp) \<and> |
|
253 |
(\<forall>f. f \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f) \<and> |
|
254 |
(\<forall>q. q \<in> current_msgqs s \<longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q) \<and> |
|
255 |
(\<forall>tp fd. fd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd) \<and> |
|
256 |
(cp2sproc (enrich_proc s p p') p' = cp2sproc s p) \<and> |
|
257 |
(\<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
|
258 |
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
|
259 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
260 |
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
|
261 |
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
|
262 |
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
|
263 |
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
|
264 |
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
|
265 |
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
|
266 |
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
|
267 |
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
|
268 |
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
|
269 |
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
|
270 |
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
|
271 |
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
|
272 |
done |
82 | 273 |
have vd_enrich_cons: "valid (enrich_proc (e # s) p p')" |
274 |
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
|
275 |
have "\<And>f fds. \<lbrakk>valid (Execve p f fds # enrich_proc s p p'); is_created_proc s p; |
82 | 276 |
valid (Execve p f fds # s); p' \<notin> all_procs s\<rbrakk> |
277 |
\<Longrightarrow> valid (Execve p' f (fds \<inter> proc_file_fds s p) # Execve p f fds # enrich_proc s p p')" |
|
278 |
proof- |
|
279 |
fix f fds |
|
280 |
assume a1: "valid (Execve p f fds # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
281 |
and a3: "valid (Execve p f fds # s)" and a0: "p' \<notin> all_procs s" |
|
282 |
have cp2sp: "\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp" |
|
283 |
and cf2sf: "\<forall> tf. tf \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
|
284 |
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" |
|
285 |
and dup_sp: "cp2sproc (enrich_proc s p p') p' = cp2sproc s p" |
|
286 |
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
|
287 |
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
|
288 |
by auto |
82 | 289 |
show "valid (Execve p' f (fds \<inter> proc_file_fds s p) # Execve p f fds # enrich_proc s p p')" |
290 |
proof- |
|
291 |
from a0 a3 have a0': "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3) |
|
292 |
from a3 have grant: "grant s (Execve p f fds)" and os: "os_grant s (Execve p f fds)" |
|
293 |
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
|
294 |
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
|
295 |
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
|
296 |
by (auto dest:vt_grant_os simp:enrich_proc_is_file) |
82 | 297 |
moreover have a5: "proc_file_fds s p \<subseteq> proc_file_fds (Execve p f fds # enrich_proc s p p') p'" |
298 |
using a3 a0' |
|
299 |
apply (frule_tac vt_grant_os) |
|
300 |
apply (auto simp:proc_file_fds_def) |
|
301 |
apply (rule_tac x = fa in exI) |
|
302 |
apply (erule enrich_proc_dup_ffd) |
|
303 |
apply (simp_all add:vd all_procs a2) |
|
304 |
done |
|
305 |
ultimately have "os_grant (Execve p f fds # enrich_proc s p p') (Execve p' f (fds \<inter> proc_file_fds s p))" |
|
306 |
apply (auto simp:is_file_simps enrich_proc_dup_in a2 vd all_procs a1 enrich_proc_dup_ffds) |
|
307 |
done |
|
308 |
moreover have "grant (Execve p f fds # enrich_proc s p p') (Execve p' f (fds \<inter> proc_file_fds s p))" |
|
309 |
proof- |
|
310 |
from grant obtain up rp tp uf rf tf |
|
311 |
where p1: "sectxt_of_obj s (O_proc p) = Some (up, rp, tp)" |
|
312 |
and p2: "sectxt_of_obj s (O_file f) = Some (uf, rf, tf)" |
|
313 |
by (simp split:option.splits, blast) |
|
314 |
with grant obtain pu nr nt where p3: "npctxt_execve (up, rp, tp) (uf, rf, tf) = Some (pu, nr, nt)" |
|
315 |
by (simp split:option.splits del:npctxt_execve.simps, blast) |
|
316 |
have p1': "sectxt_of_obj (Execve p f fds # enrich_proc s p p') (O_proc p') = Some (up, rp, tp)" |
|
317 |
using p1 dup_sp a1 a0' |
|
318 |
apply (simp add:sectxt_of_obj_simps) |
|
319 |
by (simp add:cp2sproc_def split:option.splits) |
|
320 |
from os have f_in': "is_file s f" by simp |
|
321 |
from vd os have "\<exists> sf. cf2sfile s f = Some sf" |
|
322 |
by (auto dest!:is_file_in_current current_file_has_sfile) |
|
323 |
hence p2': "sectxt_of_obj (Execve p f fds # enrich_proc s p p') (O_file f) = Some (uf, rf, tf)" |
|
324 |
using f_in p2 cf2sf os a1 |
|
325 |
apply (erule_tac x = f in allE) |
|
326 |
apply (auto dest:is_file_in_current simp:cf2sfile_def sectxt_of_obj_simps split:option.splits) |
|
327 |
apply (case_tac f, simp) |
|
328 |
apply (drule_tac s = s in root_is_dir', simp add:vd, simp+) |
|
329 |
done |
|
330 |
from dup_sfd a5 have "\<forall>fd. fd \<in> proc_file_fds s p \<longrightarrow> |
|
331 |
cfd2sfd (Execve p f fds # enrich_proc s p p') p' fd = cfd2sfd s p fd" |
|
332 |
apply (rule_tac allI) |
|
333 |
apply (erule_tac x = fd in allE, clarsimp) |
|
334 |
apply (drule set_mp, simp) |
|
335 |
apply (auto simp:cfd2sfd_execve proc_file_fds_def a1) |
|
336 |
done |
|
337 |
hence "inherit_fds_check (Execve p f fds # enrich_proc s p p') (up, nr, nt) p' (fds \<inter> proc_file_fds s p)" |
|
338 |
using grant os p1 p2 p3 vd |
|
339 |
apply (clarsimp) |
|
340 |
apply (rule_tac s = s and p = p and fds = fds in enrich_inherit_fds_check_dup) |
|
341 |
apply simp_all |
|
342 |
done |
|
343 |
moreover have "search_check (Execve p f fds # enrich_proc s p p') (up, rp, tp) f" |
|
344 |
using p1 p2 p2' vd cf2sf f_in f_in' grant p3 f_in a1 |
|
345 |
apply (rule_tac s = s in enrich_search_check) |
|
346 |
apply (simp_all add:is_file_simps) |
|
347 |
apply (rule allI, rule impI, erule_tac x = fa in allE, simp) |
|
348 |
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
|
349 |
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
|
350 |
done |
82 | 351 |
ultimately show ?thesis |
352 |
using p1' p2' p3 |
|
353 |
apply (simp split:option.splits) |
|
354 |
using grant p1 p2 |
|
355 |
apply simp |
|
356 |
done |
|
357 |
qed |
|
358 |
ultimately show ?thesis using a1 |
|
359 |
by (erule_tac valid.intros(2), auto) |
|
360 |
qed |
|
361 |
qed |
|
362 |
moreover have "\<And>tp fds. \<lbrakk>valid (Clone tp p fds # s); p' \<noteq> p; p' \<notin> all_procs s\<rbrakk> \<Longrightarrow> |
|
363 |
valid (Clone tp p' (fds \<inter> proc_file_fds s tp) # Clone tp p fds # s)" |
|
364 |
apply (frule vt_grant_os, frule vt_grant, drule not_all_procs_prop3) |
|
365 |
apply (rule valid.intros(2)) |
|
366 |
apply (simp_all split:option.splits add:sectxt_of_obj_simps) |
|
367 |
apply (auto simp add:proc_file_fds_def)[1] |
|
368 |
apply (auto simp:inherit_fds_check_def sectxt_of_obj_simps sectxts_of_fds_def inherit_fds_check_ctxt_def) |
|
369 |
done |
|
370 |
moreover have "\<And>f flags fd opt. \<lbrakk>valid (Open p f flags fd opt # enrich_proc s p p'); |
|
371 |
is_created_proc s p; valid (Open p f flags fd opt # s); p' \<notin> all_procs s\<rbrakk> |
|
372 |
\<Longrightarrow> valid (Open p' f (remove_create_flag flags) fd None # Open p f flags fd opt # enrich_proc s p p')" |
|
373 |
proof- |
|
374 |
fix f flags fd opt |
|
375 |
assume a1: "valid (Open p f flags fd opt # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
376 |
and a3: "valid (Open p f flags fd opt # s)" and a4: "p' \<notin> all_procs s" |
|
377 |
have cp2sp: "\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp" |
|
378 |
and cf2sf: "\<forall> tf. tf \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
|
379 |
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" |
|
380 |
and dup_sp: "cp2sproc (enrich_proc s p p') p' = cp2sproc s p" |
|
381 |
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" |
|
382 |
using pre a2 by auto |
|
383 |
from a4 a3 have a0: "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3 split:option.splits) |
|
384 |
have a5: "p' \<in> current_procs (enrich_proc s p p')" |
|
385 |
using a2 a3 vd |
|
386 |
apply (erule_tac enrich_proc_dup_in) |
|
387 |
by (simp_all add:vd a4) |
|
388 |
have a6: "is_file (Open p f flags fd opt # enrich_proc s p p') f" |
|
389 |
using a1 a3 |
|
390 |
by (auto simp:is_file_open dest:vt_grant_os) |
|
391 |
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
|
392 |
using a2 a4 vd nodel |
82 | 393 |
apply (simp add:enrich_proc_dup_ffds_eq_fds) |
394 |
apply (rule notI) |
|
395 |
apply (drule_tac p = p in file_fds_subset_pfds) |
|
396 |
apply (drule set_mp, simp) |
|
397 |
using a3 |
|
398 |
apply (drule_tac vt_grant_os) |
|
399 |
apply (auto split:option.splits) |
|
400 |
done |
|
401 |
from a1 have a8: "valid (enrich_proc s p p')" by (erule_tac valid.cases, auto) |
|
402 |
from a3 have grant: "grant s (Open p f flags fd opt)" and os: "os_grant s (Open p f flags fd opt)" |
|
403 |
by (auto dest:vt_grant_os vt_grant) |
|
404 |
show "valid (Open p' f (remove_create_flag flags) fd None # Open p f flags fd opt # enrich_proc s p p')" |
|
405 |
proof (cases opt) |
|
406 |
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
|
407 |
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
|
408 |
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
|
409 |
by (auto dest:vt_grant_os simp:enrich_proc_is_file) |
82 | 410 |
from grant None obtain up rp tp uf rf tf |
411 |
where p1: "sectxt_of_obj s (O_proc p) = Some (up, rp, tp)" |
|
412 |
and p2: "sectxt_of_obj s (O_file f) = Some (uf, rf, tf)" |
|
413 |
apply (simp split:option.splits) |
|
414 |
by (case_tac a, case_tac aa, blast) |
|
415 |
have p1': "sectxt_of_obj (Open p f flags fd opt # enrich_proc s p p') (O_proc p') = Some (up, rp, tp)" |
|
416 |
using p1 dup_sp a1 |
|
417 |
apply (simp add:sectxt_of_obj_simps) |
|
418 |
by (simp add:cp2sproc_def split:option.splits) |
|
419 |
from os None have f_in': "is_file s f" by simp |
|
420 |
from vd os None have "\<exists> sf. cf2sfile s f = Some sf" |
|
421 |
by (auto dest!:is_file_in_current current_file_has_sfile) |
|
422 |
hence p2': "sectxt_of_obj (Open p f flags fd opt # enrich_proc s p p') (O_file f) = Some (uf, rf, tf)" |
|
423 |
using p2 cf2sf os a1 None f_in' vd f_in |
|
424 |
apply (erule_tac x = f in allE) |
|
425 |
apply (auto dest:is_file_in_current simp:cf2sfile_def sectxt_of_obj_simps split:option.splits) |
|
426 |
apply (case_tac f, simp) |
|
427 |
apply (drule_tac s = s in root_is_dir', simp add:vd, simp+) |
|
428 |
done |
|
429 |
have "search_check (Open p f flags fd opt # enrich_proc s p p') (up, rp, tp) f" |
|
430 |
using p1 p2 p2' vd cf2sf f_in f_in' grant f_in a1 None |
|
431 |
apply (rule_tac s = s in enrich_search_check) |
|
432 |
apply (simp_all add:is_file_simps) |
|
433 |
apply (rule allI, rule impI, erule_tac x = fa in allE, simp) |
|
434 |
apply (simp add:cf2sfile_open_none) |
|
435 |
done |
|
436 |
thus ?thesis using a0 a5 a6 a7 None a1 |
|
437 |
apply (rule_tac valid.intros(2)) |
|
438 |
apply (simp_all add:a1) |
|
439 |
apply (case_tac flags, simp add:is_creat_excl_flag_def) |
|
440 |
using p1' p2' |
|
441 |
apply simp |
|
442 |
using grant p1 p2 |
|
443 |
apply (simp add:oflags_check_remove_create) |
|
444 |
done |
|
445 |
next |
|
446 |
case (Some inum) |
|
447 |
with os obtain pf where parent: "parent f = Some pf" by auto |
|
448 |
with grant Some obtain pu rp pt pfu pfr pft where |
|
449 |
p1: "sectxt_of_obj s (O_proc p) = Some (pu, rp, pt)" |
|
450 |
and p2: "sectxt_of_obj s (O_dir pf) = Some (pfu, pfr, pft)" |
|
451 |
apply (simp split:option.splits) |
|
452 |
apply (case_tac a, case_tac aa, blast) |
|
453 |
done |
|
454 |
from p1 have p1': "sectxt_of_obj (enrich_proc s p p') (O_proc p) = Some (pu, rp, pt)" |
|
455 |
using cp2sp os |
|
456 |
apply (erule_tac x = p in allE) |
|
457 |
apply (auto split:option.splits simp:cp2sproc_def) |
|
458 |
done |
|
459 |
from os parent Some |
|
460 |
have pf_in: "is_dir s pf" by auto |
|
461 |
hence "\<exists> sf. cf2sfile s pf = Some sf" using vd |
|
462 |
by (auto dest!:is_dir_in_current current_file_has_sfile) |
|
463 |
from a1 parent Some have pf_in': "is_dir (enrich_proc s p p') pf" |
|
464 |
apply (frule_tac vt_grant_os) |
|
465 |
by (clarsimp) |
|
466 |
have p2': "sectxt_of_obj (enrich_proc s p p') (O_dir pf) = Some (pfu, pfr, pft)" |
|
467 |
proof- |
|
468 |
have "cf2sfile (enrich_proc s p p') pf = cf2sfile s pf" |
|
469 |
using cf2sf pf_in |
|
470 |
apply (drule_tac is_dir_in_current) |
|
471 |
apply (erule_tac x = pf in allE) |
|
472 |
by simp |
|
473 |
with pf_in pf_in' p2 vd Some a8 |
|
474 |
show ?thesis |
|
475 |
apply (frule_tac is_dir_not_file) |
|
476 |
apply (frule_tac s = "enrich_proc s p p'" in is_dir_not_file) |
|
477 |
apply (simp add:cf2sfile_def) |
|
478 |
apply (case_tac pf, simp) |
|
479 |
apply (simp add:sroot_def root_sec_remains) |
|
480 |
by (auto split:option.splits dest!:current_has_sec' get_pfs_secs_prop' dest:parentf_is_dir_prop1) |
|
481 |
qed |
|
482 |
from p1 have dup: "sectxt_of_obj (Open p f flags fd (Some inum) # enrich_proc s p p') (O_proc p') |
|
483 |
= Some (pu, rp, pt)" |
|
484 |
using a1 Some |
|
485 |
apply (simp add:sec_open) |
|
486 |
using dup_sp |
|
487 |
apply (auto split:option.splits if_splits simp:cp2sproc_def) |
|
488 |
done |
|
489 |
have nsf: "sectxt_of_obj (Open p f flags fd (Some inum) # enrich_proc s p p') (O_file f) |
|
490 |
= Some (pu, R_object, type_transition pt pft C_file True)" |
|
491 |
using a1 Some p1 p2 parent p2' p1' |
|
492 |
by (simp add:sec_open) |
|
493 |
have "search_check (Open p f flags fd (Some inum) # enrich_proc s p p') (pu, rp, pt) f" |
|
494 |
proof- |
|
495 |
have "search_check (Open p f flags fd (Some inum) # enrich_proc s p p') (pu, rp, pt) pf" |
|
496 |
using grant Some parent p1 p2 vd a1 pf_in pf_in' p2' |
|
497 |
apply simp |
|
498 |
apply (rule_tac s = s in enrich_search_check') |
|
499 |
apply (simp_all add:is_dir_simps sectxt_of_obj_simps) |
|
500 |
apply (rule allI, rule impI) |
|
501 |
apply (case_tac "fa = f") |
|
502 |
using os Some |
|
503 |
apply simp |
|
504 |
apply (drule_tac f' = fa in cf2sfile_open) |
|
505 |
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
|
506 |
using enrich_proc_cur_files a2 nodel |
82 | 507 |
apply simp |
508 |
apply simp |
|
509 |
using cf2sf |
|
510 |
apply simp |
|
511 |
done |
|
512 |
moreover have "is_file (Open p f flags fd (Some inum) # enrich_proc s p p') f" |
|
513 |
using a1 Some |
|
514 |
by (simp add:is_file_open) |
|
515 |
ultimately |
|
516 |
show ?thesis |
|
517 |
using parent a1 Some nsf |
|
518 |
apply (erule_tac search_check_leveling_f) |
|
519 |
apply (simp_all) |
|
520 |
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
|
521 |
(* create new file, grant only check pf's SEARCH permission, not newfile itself, so we make assumptions of this case in the locale *) |
82 | 522 |
apply (simp add:permission_check.simps) |
523 |
sorry |
|
524 |
qed |
|
525 |
thus ?thesis using a0 a5 a6 a7 a1 Some |
|
526 |
apply (rule_tac valid.intros(2)) |
|
527 |
apply (simp add:a1) |
|
528 |
apply simp |
|
529 |
apply (case_tac flags, simp add:is_creat_excl_flag_def) |
|
530 |
using grant p1 p2 parent dup nsf |
|
531 |
apply (simp add:oflags_check_remove_create) |
|
532 |
done |
|
533 |
qed |
|
534 |
qed |
|
535 |
moreover have "\<And>fd. \<lbrakk>valid (CloseFd p fd # enrich_proc s p p'); is_created_proc s p; |
|
536 |
valid (CloseFd p fd # s); p' \<notin> all_procs s; fd \<in> proc_file_fds s p\<rbrakk> |
|
537 |
\<Longrightarrow> valid (CloseFd p' fd # CloseFd p fd # enrich_proc s p p')" |
|
538 |
proof- |
|
539 |
fix fd |
|
540 |
assume a1: "valid (CloseFd p fd # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
541 |
and a3: "p' \<notin> all_procs s" and a4: "valid (CloseFd p fd # s)" |
|
542 |
and a5: "fd \<in> proc_file_fds s p" |
|
543 |
from a4 a3 have a0: "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3) |
|
544 |
have "p' \<in> current_procs (enrich_proc s p p')" |
|
545 |
using a2 a3 vd |
|
546 |
by (auto intro:enrich_proc_dup_in) |
|
547 |
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
|
548 |
using a5 a2 a3 vd pre_vd nodel |
82 | 549 |
apply (simp) |
550 |
apply (drule_tac s = "enrich_proc s p p'" and p = p' in file_fds_subset_pfds) |
|
551 |
apply (erule set_mp) |
|
552 |
apply (simp add:enrich_proc_dup_ffds) |
|
553 |
done |
|
554 |
ultimately show "valid (CloseFd p' fd # CloseFd p fd # enrich_proc s p p')" |
|
555 |
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
|
556 |
apply (simp_all add:a1 a0 a2 pre_vd) |
82 | 557 |
done |
558 |
qed |
|
559 |
moreover have "\<And> fd. \<lbrakk>valid (ReadFile p fd # enrich_proc s p p'); |
|
560 |
is_created_proc s p; valid (ReadFile p fd # s); p' \<notin> all_procs s\<rbrakk> |
|
561 |
\<Longrightarrow> valid (ReadFile p' fd # ReadFile p fd # enrich_proc s p p')" |
|
562 |
proof- |
|
563 |
fix fd |
|
564 |
assume a1: "valid (ReadFile p fd # enrich_proc s p p')" and a2: "is_created_proc s p" |
|
565 |
and a3: "valid (ReadFile p fd # s)" and a4: "p' \<notin> all_procs s" |
|
566 |
from a3 have os: "os_grant s (ReadFile p fd)" and grant: "grant s (ReadFile p fd)" |
|
567 |
by (auto dest:vt_grant_os vt_grant) |
|
568 |
have cp2sp: "\<forall> tp. tp \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') tp = cp2sproc s tp" |
|
569 |
and cf2sf: "\<forall> tf. tf \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') tf = cf2sfile s tf" |
|
570 |
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" |
|
571 |
and dup_sp: "cp2sproc (enrich_proc s p p') p' = cp2sproc s p" |
|
572 |
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" |
|
573 |
using pre a2 by auto |
|
574 |
have vd_enrich: "valid (enrich_proc s p p')" using a1 by (auto dest:valid.cases) |
|
575 |
show "valid (ReadFile p' fd # ReadFile p fd # enrich_proc s p p')" |
|
576 |
proof- |
|
577 |
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
|
578 |
using a1 a2 a4 vd os nodel |
82 | 579 |
apply (clarsimp simp:current_files_simps enrich_proc_dup_in enrich_proc_dup_ffds_eq_fds) |
580 |
apply (simp add:proc_file_fds_def) |
|
581 |
apply (rule conjI) |
|
582 |
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
|
583 |
using enrich_proc_cur_files |
82 | 584 |
apply (simp) |
585 |
apply (drule enrich_proc_dup_fflags) |
|
586 |
apply simp_all |
|
587 |
apply (erule disjE) |
|
588 |
apply auto |
|
589 |
apply (simp add:is_read_flag_def) |
|
590 |
done |
|
591 |
moreover have "grant (ReadFile p fd # enrich_proc s p p') (ReadFile p' fd)" |
|
592 |
proof- |
|
593 |
from grant obtain f sp sfd sf where p1: "file_of_proc_fd s p fd = Some f" |
|
594 |
and p2: "sectxt_of_obj s (O_proc p) = Some sp" |
|
595 |
and p3: "sectxt_of_obj s (O_fd p fd) = Some sfd" |
|
596 |
and p4: "sectxt_of_obj s (O_file f) = Some sf" |
|
597 |
by (auto split:option.splits) |
|
598 |
from os obtain flag where p0: "flags_of_proc_fd s p fd = Some flag" |
|
599 |
by auto |
|
600 |
from os have f_in_s: "f \<in> current_files s" using p1 by simp |
|
601 |
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
|
602 |
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
|
603 |
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
|
604 |
by (auto simp:enrich_proc_is_file) |
82 | 605 |
from p0 obtain flag' where p0': "flags_of_proc_fd (enrich_proc s p p') p' fd = Some flag'" |
606 |
and p0'': "(flag' = flag) \<or> (flag' = remove_create_flag flag)" |
|
607 |
using a2 a4 vd |
|
608 |
apply (drule_tac enrich_proc_dup_fflags) |
|
609 |
apply auto |
|
610 |
apply (case_tac flag, auto) |
|
611 |
apply (case_tac flag, auto) |
|
612 |
done |
|
613 |
from p1 have p1': "file_of_proc_fd (enrich_proc s p p') p' fd = Some f" |
|
614 |
using a2 a4 vd |
|
615 |
by (simp add:enrich_proc_dup_ffd) |
|
616 |
from p2 have p2': "sectxt_of_obj (enrich_proc s p p') (O_proc p') = Some sp" |
|
617 |
using dup_sp |
|
618 |
by (auto simp:cp2sproc_def split:option.splits) |
|
619 |
from p3 p1 p1' p0 p0' os have p3': "sectxt_of_obj (enrich_proc s p p') (O_fd p' fd) = Some sfd" |
|
620 |
using dup_sfd |
|
621 |
apply (erule_tac x = fd in allE) |
|
622 |
apply (auto simp:proc_file_fds_def cfd2sfd_def split:option.splits) |
|
623 |
apply (drule current_file_has_sfile') |
|
624 |
apply (simp add:vd, simp) |
|
625 |
apply (drule current_file_has_sfile') |
|
626 |
apply (simp add:vd, simp) |
|
627 |
done |
|
628 |
from p4 have p4': "sectxt_of_obj (enrich_proc s p p') (O_file f) = Some sf" |
|
629 |
using f_in_s cf2sf isfile_s isfile_s' a1 vd_enrich vd |
|
630 |
apply (erule_tac x = f in allE) |
|
631 |
apply (simp) |
|
632 |
apply (auto simp:cf2sfile_def split:option.splits |
|
633 |
dest!:current_has_sec' get_pfs_secs_prop' dest:parentf_is_dir is_file_in_current) |
|
634 |
apply (case_tac f, simp, drule root_is_dir', simp, simp, simp) |
|
635 |
done |
|
636 |
show ?thesis using p1' p2' p3' p4' a1 |
|
637 |
apply (simp add:sectxt_of_obj_simps) |
|
638 |
using grant p1 p2 p3 p4 |
|
639 |
apply simp |
|
640 |
done |
|
641 |
qed |
|
642 |
ultimately show ?thesis |
|
643 |
using a1 |
|
644 |
by (erule_tac valid.intros(2), simp+) |
|
645 |
qed |
|
646 |
qed |
|
647 |
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
|
648 |
using vd_enrich created_cons vd_cons' all_procs_cons |
82 | 649 |
apply (case_tac e) |
650 |
apply (auto simp:is_created_proc_simps split:if_splits) |
|
651 |
done |
|
652 |
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
|
653 |
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
|
654 |
"\<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
|
655 |
\<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
|
656 |
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
|
657 |
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
|
658 |
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
|
659 |
done |
85 | 660 |
have sf_cons: |
661 |
"\<forall>f. f \<in> current_files (e # s) \<longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" |
|
662 |
proof clarify |
|
663 |
fix f |
|
664 |
assume a1: "f \<in> current_files (e # s)" |
|
665 |
from pre have pre_sf: "\<And> f. \<lbrakk>f \<in> current_files s; is_created_proc s p\<rbrakk> |
|
666 |
\<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f" |
|
667 |
by auto |
|
668 |
from a1 have a1': "f \<in> current_files (enrich_proc (e # s) p p')" |
|
669 |
using vd_cons' nodel_cons |
|
670 |
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
|
671 |
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
|
672 |
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
|
673 |
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
|
674 |
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
|
675 |
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
|
676 |
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
|
677 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
678 |
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
|
679 |
"\<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
|
680 |
\<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
|
681 |
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
|
682 |
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
|
683 |
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
|
684 |
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
|
685 |
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
|
686 |
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
|
687 |
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
|
688 |
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
|
689 |
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
|
690 |
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
|
691 |
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
|
692 |
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
|
693 |
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
|
694 |
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
|
695 |
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
|
696 |
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
|
697 |
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
|
698 |
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
|
699 |
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
|
700 |
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
|
701 |
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
|
702 |
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
|
703 |
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
|
704 |
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
|
705 |
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
|
706 |
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
|
707 |
"\<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
|
708 |
\<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
|
709 |
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
|
710 |
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
|
711 |
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
|
712 |
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
|
713 |
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
|
714 |
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
|
715 |
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
|
716 |
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
|
717 |
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
|
718 |
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
|
719 |
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
|
720 |
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
|
721 |
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
|
722 |
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
|
723 |
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
|
724 |
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
|
725 |
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
|
726 |
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
|
727 |
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
|
728 |
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
|
729 |
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
|
730 |
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
|
731 |
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
|
732 |
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
|
733 |
"\<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
|
734 |
\<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
|
735 |
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
|
736 |
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
|
737 |
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
|
738 |
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
|
739 |
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
|
740 |
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
|
741 |
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
|
742 |
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
|
743 |
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
|
744 |
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
|
745 |
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
|
746 |
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
|
747 |
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
|
748 |
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
|
749 |
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
|
750 |
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
|
751 |
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
|
752 |
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
|
753 |
from a1' vd have a5': "\<not> is_file (enrich_proc s p p') tf" by (simp add:is_dir_not_file) |
85 | 754 |
|
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
|
755 |
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
|
756 |
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
|
757 |
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
|
758 |
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
|
759 |
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
|
760 |
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
|
761 |
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
|
762 |
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
|
763 |
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
|
764 |
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
|
765 |
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
|
766 |
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
|
767 |
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
|
768 |
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
|
769 |
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
|
770 |
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
|
771 |
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
|
772 |
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
|
773 |
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
|
774 |
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
|
775 |
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
|
776 |
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
|
777 |
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
|
778 |
\<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
|
779 |
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
|
780 |
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
|
781 |
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
|
782 |
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
|
783 |
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
|
784 |
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
|
785 |
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
|
786 |
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
|
787 |
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
|
788 |
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
|
789 |
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
|
790 |
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
|
791 |
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
|
792 |
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
|
793 |
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
|
794 |
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
|
795 |
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
|
796 |
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
|
797 |
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
|
798 |
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
|
799 |
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
|
800 |
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
|
801 |
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
|
802 |
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
|
803 |
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
|
804 |
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
|
805 |
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
|
806 |
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
|
807 |
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
|
808 |
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
|
809 |
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
|
810 |
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
|
811 |
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
|
812 |
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
|
813 |
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
|
814 |
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
|
815 |
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
|
816 |
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
|
817 |
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
|
818 |
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
|
819 |
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
|
820 |
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
|
821 |
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
|
822 |
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
|
823 |
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
|
824 |
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
|
825 |
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
|
826 |
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
|
827 |
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
|
828 |
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
|
829 |
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
|
830 |
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
|
831 |
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
|
832 |
\<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
|
833 |
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
|
834 |
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
|
835 |
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
|
836 |
|
690636b7b6f1
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
chunhan
parents:
85
diff
changeset
|
837 |
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
|
838 |
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
|
839 |
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
|
840 |
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
|
841 |
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
|
842 |
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
|
843 |
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
|
844 |
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
|
845 |
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
|
846 |
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
|
847 |
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
|
848 |
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
|
849 |
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
|
850 |
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
|
851 |
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
|
852 |
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
|
853 |
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
|
854 |
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
|
855 |
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
|
856 |
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
|
857 |
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
|
858 |
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
|
859 |
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
|
860 |
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
|
861 |
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
|
862 |
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
|
863 |
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
|
864 |
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
|
865 |
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
|
866 |
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
|
867 |
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
|
868 |
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
|
869 |
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
|
870 |
\<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
|
871 |
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
|
872 |
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
|
873 |
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
|
874 |
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
|
875 |
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
|
876 |
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
|
877 |
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
|
878 |
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
|
879 |
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
|
880 |
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
|
881 |
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
|
882 |
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
|
883 |
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
|
884 |
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
|
885 |
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
|
886 |
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
|
887 |
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
|
888 |
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
|
889 |
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
|
890 |
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
|
891 |
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
|
892 |
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
|
893 |
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
|
894 |
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
|
895 |
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
|
896 |
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
|
897 |
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
|
898 |
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
|
899 |
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
|
900 |
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
|
901 |
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
|
902 |
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
|
903 |
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
|
904 |
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
|
905 |
qed |
85 | 906 |
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
|
907 |
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
|
908 |
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
|
909 |
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
|
910 |
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
|
911 |
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
|
912 |
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
|
913 |
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
|
914 |
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
|
915 |
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
|
916 |
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
|
917 |
cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
83 | 918 |
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
|
919 |
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
|
920 |
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
|
921 |
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
|
922 |
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
|
923 |
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
|
924 |
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
|
925 |
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
|
926 |
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
|
927 |
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
|
928 |
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
|
929 |
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
|
930 |
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
|
931 |
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
|
932 |
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
|
933 |
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
|
934 |
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
|
935 |
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
|
936 |
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
|
937 |
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
|
938 |
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
|
939 |
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
|
940 |
done |
85 | 941 |
have sec_proc: |
942 |
"\<And> tp. \<lbrakk>tp \<in> current_procs s; is_created_proc s p\<rbrakk> |
|
943 |
\<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_proc tp) = sectxt_of_obj s (O_proc tp)" |
|
944 |
using pre |
|
945 |
apply (clarsimp) |
|
946 |
apply (erule_tac x = tp in allE, auto simp:cp2sproc_def split:option.splits) |
|
947 |
done |
|
948 |
have sec_proc': |
|
949 |
"\<And> tp. \<lbrakk>tp \<in> current_procs s; is_created_proc s p; p = tp\<rbrakk> |
|
950 |
\<Longrightarrow> sectxt_of_obj (enrich_proc s tp p') (O_proc tp) = sectxt_of_obj s (O_proc tp)" |
|
951 |
apply (drule_tac sec_proc, simp+) |
|
952 |
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
|
953 |
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
|
954 |
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
|
955 |
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
|
956 |
\<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
|
957 |
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
|
958 |
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
|
959 |
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
|
960 |
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
|
961 |
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
|
962 |
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
|
963 |
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
|
964 |
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
|
965 |
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
|
966 |
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
|
967 |
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
|
968 |
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
|
969 |
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
|
970 |
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
|
971 |
\<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
|
972 |
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
|
973 |
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
|
974 |
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
|
975 |
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
|
976 |
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
|
977 |
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
|
978 |
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
|
979 |
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
|
980 |
\<Longrightarrow> cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd" |
85 | 981 |
using a4 a1' vd_enrich_cons vd_cons' created_cons |
982 |
apply (simp split:if_splits del:file_of_proc_fd.simps) |
|
983 |
||
984 |
apply (simp add:cfd2sfd_open sec_open is_created_proc_simps a2 del:file_of_proc_fd.simps) |
|
985 |
apply (tactic {*my_clarify_tac 1*}) |
|
986 |
apply (drule vd_cons) |
|
987 |
apply (simp add:cfd2sfd_open sec_open a3 a2 split:if_splits) |
|
988 |
apply (case_tac "proc \<in> current_procs s") |
|
989 |
apply (simp add:sec_proc') |
|
990 |
apply (case_tac "sectxt_of_obj s (O_proc proc)", simp+) |
|
991 |
apply (case_tac "f \<in> current_files (e # s)") |
|
992 |
apply (drule sf_cons[rule_format], simp) |
|
993 |
using vd_enrich_cons |
|
994 |
apply (simp add:cf2sfile_open_none) |
|
995 |
using os |
|
996 |
apply (simp add:current_files_simps is_file_in_current split:option.splits) |
|
997 |
using os |
|
998 |
apply (simp split:option.splits) |
|
999 |
apply (rule impI) |
|
1000 |
apply (simp add:cfd2sfd_open sec_open a3 a2 split:if_splits) |
|
1001 |
apply (drule vd_cons) |
|
1002 |
apply (drule_tac p' = tp and fd' = fd and f' = f and s = "enrich_proc s proc p'" in cfd2sfd_open) |
|
1003 |
apply (simp, rule impI, simp) |
|
1004 |
apply (simp split:if_splits, rule conjI, rule impI, simp) |
|
1005 |
apply (drule pre_sfd', simp, simp) |
|
1006 |
||
1007 |
apply (simp add:cfd2sfd_open sec_open is_created_proc_simps a2 del:file_of_proc_fd.simps) |
|
1008 |
apply (case_tac "proc \<in> current_procs s") |
|
1009 |
apply (simp add:sec_proc) |
|
1010 |
apply (case_tac "f' \<in> current_files (e # s)") |
|
1011 |
apply (drule sf_cons[rule_format], simp) |
|
1012 |
apply (simp split:option.splits) |
|
1013 |
apply (rule impI|rule conjI)+ |
|
1014 |
apply (drule current_has_sec', simp add:vd, simp add:os) |
|
1015 |
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
|
1016 |
apply (simp split:if_splits) |
85 | 1017 |
apply (simp add:pre_sfd') |
1018 |
using os |
|
1019 |
apply (simp add:current_files_simps is_file_in_current split:option.splits) |
|
1020 |
using os |
|
1021 |
apply (simp split:option.splits) |
|
1022 |
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
|
1023 |
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
|
1024 |
\<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
|
1025 |
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
|
1026 |
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
|
1027 |
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
|
1028 |
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
|
1029 |
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
|
1030 |
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
|
1031 |
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
|
1032 |
done |
83 | 1033 |
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
|
1034 |
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
|
1035 |
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
|
1036 |
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
|
1037 |
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
|
1038 |
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
|
1039 |
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
|
1040 |
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
|
1041 |
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
|
1042 |
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
|
1043 |
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
|
1044 |
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
|
1045 |
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
|
1046 |
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
|
1047 |
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
|
1048 |
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
|
1049 |
\<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
|
1050 |
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
|
1051 |
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
|
1052 |
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
|
1053 |
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
|
1054 |
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
|
1055 |
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
|
1056 |
|
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 (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
|
1058 |
|
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 |
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
|
1060 |
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
|
1061 |
thm cq2smsg_createmsgq |
82 | 1062 |
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
|
1063 |
moreover have "\<forall>tp. tp \<in> current_procs (e # s) \<longrightarrow> cp2sproc (enrich_proc (e # s) p p') tp = cp2sproc (e # s) tp" |
82 | 1064 |
sorry |
1065 |
moreover have "cp2sproc (enrich_proc (e # s) p p') p' = cp2sproc (e # s) p" |
|
1066 |
proof- |
|
1067 |
from pre have b0: "is_created_proc s p \<Longrightarrow> cp2sproc (enrich_proc s p p') p' = cp2sproc s p" by simp |
|
1068 |
have b1: "\<And> tp f fds. \<lbrakk>valid (enrich_proc (Execve tp f fds # s) p p'); valid (Execve tp f fds # s); |
|
1069 |
is_created_proc (Execve tp f fds # s) p; p' \<notin> all_procs (Execve tp f fds # s)\<rbrakk> |
|
1070 |
\<Longrightarrow> cp2sproc (enrich_proc (Execve tp f fds # s) p p') p' = cp2sproc (Execve tp f fds # s) p" |
|
1071 |
proof- |
|
1072 |
fix tp f fds |
|
1073 |
assume a1: "valid (enrich_proc (Execve tp f fds # s) p p')" |
|
1074 |
and a2: "valid (Execve tp f fds # s)" and a3: "is_created_proc (Execve tp f fds # s) p" |
|
1075 |
and a4: "p' \<notin> all_procs (Execve tp f fds # s)" |
|
1076 |
show "cp2sproc (enrich_proc (Execve tp f fds # s) p p') p' = cp2sproc (Execve tp f fds # s) p" |
|
1077 |
proof (cases "tp = p") |
|
1078 |
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
|
1079 |
show ?thesis using True a1 a2 a3 a4 b0 vd |
82 | 1080 |
thm not_all_procs_prop3 |
83 | 1081 |
apply (frule_tac not_all_procs_prop2) |
1082 |
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
|
1083 |
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
|
1084 |
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
|
1085 |
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
|
1086 |
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
|
1087 |
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
|
1088 |
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
|
1089 |
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
|
1090 |
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
|
1091 |
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
|
1092 |
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
|
1093 |
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
|
1094 |
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
|
1095 |
|
cebdef333899
cfd2sfd, OF_create flag should not be in the sfd, cause all-duplicated sfd could not have this flag
chunhan
parents:
83
diff
changeset
|
1096 |
|
83 | 1097 |
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
|
1098 |
*) |
82 | 1099 |
sorry |
1100 |
next |
|
1101 |
case False |
|
1102 |
show ?thesis sorry |
|
1103 |
qed |
|
1104 |
qed |
|
1105 |
have b2: "\<And> tp fd. cp2sproc (enrich_proc (ReadFile tp fd # s) p p') p' = cp2sproc (ReadFile tp fd # s) p" |
|
1106 |
sorry |
|
1107 |
have b3: "\<And> tp. cp2sproc (enrich_proc (Exit tp # s) p p') p' = cp2sproc (Exit tp # s) p" |
|
1108 |
sorry |
|
1109 |
have b4: "\<And> tp tp'. cp2sproc (enrich_proc (Kill tp tp' # s) p p') p' = cp2sproc (Kill tp tp' # s) p" |
|
1110 |
sorry |
|
1111 |
have b5: "\<And> tp tp' fds. cp2sproc (enrich_proc (Clone tp tp' fds # s) p p') p' = |
|
1112 |
cp2sproc (Clone tp tp' fds # s) p" |
|
1113 |
sorry |
|
1114 |
have b6: "\<And> tp f flags fd opt. cp2sproc (enrich_proc (Open tp f flags fd opt # s) p p') p' = |
|
1115 |
cp2sproc (Open tp f flags fd opt # s) p" |
|
1116 |
sorry |
|
1117 |
have b7: "\<And> tp fd. cp2sproc (enrich_proc (CloseFd tp fd # s) p p') p' = cp2sproc (CloseFd tp fd # s) p" |
|
1118 |
sorry |
|
1119 |
show ?thesis using vd_enrich_cons |
|
1120 |
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
|
1121 |
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
|
1122 |
apply (auto intro!:b1 b2 b3 b4 b5 b6 b7 simp del:enrich_proc.simps) |
83 | 1123 |
using created_cons vd_enrich_cons vd_cons' b0 |
82 | 1124 |
apply (auto simp:cp2sproc_other is_created_proc_def) |
1125 |
done |
|
1126 |
qed |
|
1127 |
moreover have "\<forall> fd. fd \<in> proc_file_fds (e # s) p \<longrightarrow> |
|
1128 |
cfd2sfd (enrich_proc (e # s) p p') p' fd = cfd2sfd (e # s) p fd" |
|
1129 |
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
|
1130 |
ultimately show ?case using vd_enrich_cons |
82 | 1131 |
by simp |
1132 |
qed |
|
1133 |
||
1134 |
||
1135 |
lemma enrich_proc_valid: |
|
1136 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s\<rbrakk> \<Longrightarrow> valid (enrich_proc s p p')" |
|
1137 |
by (auto dest:enrich_proc_prop) |
|
1138 |
||
1139 |
lemma enrich_proc_valid: |
|
1140 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s\<rbrakk> \<Longrightarrow> " |
|
1141 |
||
1142 |
lemma enrich_proc_tainted: |
|
1143 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; valid s\<rbrakk> |
|
1144 |
\<Longrightarrow> tainted (enrich_proc s p p') = (if (O_proc p \<in> tainted s) |
|
1145 |
then tainted s \<union> {O_proc p'} else tainted s)" |
|
1146 |
apply (induct s) |
|
1147 |
apply (simp add:is_created_proc_def) |
|
1148 |
apply (frule vt_grant_os, frule vd_cons, simp) |
|
1149 |
apply (frule enrich_proc_dup_in, simp+) |
|
1150 |
apply (frule not_all_procs_prop3) |
|
1151 |
apply (case_tac a) |
|
1152 |
prefer 3 |
|
1153 |
apply (simp split:if_splits) |
|
1154 |
apply (rule impI|rule conjI)+ |
|
1155 |
apply (simp add:is_created_proc_def) |
|
1156 |
apply (auto simp:is_created_proc_def split:if_splits dest:tainted_in_current)[1] |
|
1157 |
apply (simp add:is_created_proc_def) |
|
1158 |
||
1159 |
prefer 4 |
|
1160 |
apply (simp split:if_splits) |
|
1161 |
apply (rule impI|rule conjI)+ |
|
1162 |
apply (simp add:is_created_proc_def) |
|
1163 |
apply (auto simp:is_created_proc_def split:if_splits dest:tainted_in_current)[1] |
|
1164 |
apply (simp add:is_created_proc_def) |
|
1165 |
||
1166 |
prefer 4 |
|
1167 |
apply (auto simp:is_created_proc_def split:if_splits option.splits dest:tainted_in_current)[1] |
|
1168 |
||
1169 |
prefer 4 |
|
1170 |
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] |
|
1171 |
||
1172 |
||
1173 |
||
1174 |
lemma enrich_proc_dup_tainted: |
|
1175 |
"\<lbrakk>is_created_proc s p; p' \<notin> all_procs s; valid s\<rbrakk> |
|
1176 |
\<Longrightarrow> (O_proc p' \<in> tainted (enrich_proc s p p')) = (O_proc p \<in> tainted s)" |
|
1177 |
apply (induct s) |
|
1178 |
apply (simp add:is_created_proc_def) |
|
1179 |
apply (frule vt_grant_os, frule vd_cons) |
|
1180 |
apply (case_tac a) |
|
1181 |
apply (auto simp:is_created_proc_def)[1] |
|
1182 |
||
1183 |
||
1184 |
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
|
1185 |
|
82 | 1186 |
|
1187 |
||
1188 |
end |
|
1189 |
||
1190 |
end |