author | chunhan |
Mon, 24 Jun 2013 15:22:37 +0800 | |
changeset 26 | b6333712cb02 |
parent 25 | 259a50be4381 |
child 27 | fc749f19b894 |
permissions | -rw-r--r-- |
19 | 1 |
(*<*) |
18 | 2 |
theory Current_prop |
3 |
imports Main Flask_type Flask My_list_prefix Init_prop Valid_prop Delete_prop |
|
4 |
begin |
|
19 | 5 |
(*>*) |
18 | 6 |
|
7 |
context flask begin |
|
8 |
||
9 |
lemma procs_of_shm_prop1: "\<lbrakk> p_flag \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> h \<in> current_shms s" |
|
10 |
apply (induct s arbitrary:p_flag) |
|
11 |
apply (case_tac p_flag, simp, drule init_procs_has_shm, simp) |
|
12 |
apply (frule vd_cons, frule vt_grant_os) |
|
13 |
apply (case_tac a, auto split:if_splits option.splits) |
|
14 |
done |
|
15 |
||
16 |
lemma procs_of_shm_prop2: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> p \<in> current_procs s" |
|
17 |
apply (induct s arbitrary:p flag) |
|
18 |
apply (simp, drule init_procs_has_shm, simp) |
|
19 |
apply (frule vd_cons, frule vt_grant_os) |
|
20 |
apply (case_tac a, auto split:if_splits option.splits) |
|
21 |
done |
|
22 |
||
26 | 23 |
lemma procs_of_shm_prop2': |
24 |
"\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> \<forall> flag h. (p, flag) \<notin> procs_of_shm s h" |
|
25 |
by (auto dest:procs_of_shm_prop2) |
|
26 |
||
18 | 27 |
lemma procs_of_shm_prop3: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; (p, flag') \<in> procs_of_shm s h; valid s\<rbrakk> |
28 |
\<Longrightarrow> flag = flag'" |
|
29 |
apply (induct s arbitrary:p flag flag') |
|
30 |
apply (simp, drule_tac flag = flag in init_procs_has_shm, drule_tac flag = flag' in init_procs_has_shm, simp) |
|
31 |
apply (frule vd_cons, frule vt_grant_os) |
|
32 |
apply (case_tac a, auto split:if_splits option.splits dest:procs_of_shm_prop2) |
|
33 |
done |
|
34 |
||
35 |
lemma procs_of_shm_prop4: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> flag_of_proc_shm s p h = Some flag" |
|
36 |
apply (induct s arbitrary:p flag) |
|
37 |
apply (simp, drule init_procs_has_shm, simp) |
|
38 |
apply (frule vd_cons, frule vt_grant_os) |
|
39 |
apply (case_tac a, auto split:if_splits option.splits dest:procs_of_shm_prop2) |
|
40 |
done |
|
41 |
||
42 |
lemma procs_of_shm_prop4': |
|
43 |
"\<lbrakk>flag_of_proc_shm s p h = None; valid s\<rbrakk> \<Longrightarrow> \<forall> flag. (p, flag) \<notin> procs_of_shm s h" |
|
44 |
by (auto dest:procs_of_shm_prop4) |
|
45 |
||
46 |
lemma not_init_intro_proc: |
|
47 |
"\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> deleted (O_proc p) s \<or> p \<notin> init_procs" |
|
48 |
using not_deleted_init_proc by auto |
|
49 |
||
50 |
lemma not_init_intro_proc': |
|
51 |
"\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> \<not> (\<not> deleted (O_proc p) s \<and> p \<in> init_procs)" |
|
52 |
using not_deleted_init_proc by auto |
|
53 |
||
23
25e55731ed01
locale of tainting for seeds when same shm/inode bugs
chunhan
parents:
19
diff
changeset
|
54 |
lemma info_shm_flow_in_procs: |
25e55731ed01
locale of tainting for seeds when same shm/inode bugs
chunhan
parents:
19
diff
changeset
|
55 |
"\<lbrakk>info_flow_shm s p p'; valid s\<rbrakk> \<Longrightarrow> p \<in> current_procs s \<and> p' \<in> current_procs s" |
26 | 56 |
by (auto intro:procs_of_shm_prop2 simp:info_flow_shm_def one_flow_shm_def) |
25
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
57 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
58 |
(*********** simpset for info_flow_shm **************) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
59 |
|
26 | 60 |
lemma info_flow_shm_attach: |
61 |
"valid (Attach p h flag # s) \<Longrightarrow> info_flow_shm (Attach p h flag # s) = (\<lambda> pa pb. |
|
62 |
(pa = p \<and> flag = SHM_RDWR \<and> (\<exists> flagb. (pb, flagb) \<in> procs_of_shm s h)) \<or> |
|
63 |
(pb = p \<and> (pa, SHM_RDWR) \<in> procs_of_shm s h) \<or> |
|
64 |
(info_flow_shm s pa pb) )" |
|
65 |
apply (rule ext, rule ext, frule vt_grant_os) |
|
66 |
by (auto simp add:info_flow_shm_def one_flow_shm_def) |
|
67 |
||
68 |
lemma info_flow_shm_detach: |
|
69 |
"valid (Detach p h # s) \<Longrightarrow> info_flow_shm (Detach p h # s) = (\<lambda> pa pb. |
|
70 |
self_shm s pa pb \<or> ((p = pa \<or> p = pb) \<and> (\<exists> h'. h' \<noteq> h \<and> one_flow_shm s h' pa pb)) \<or> |
|
71 |
(pa \<noteq> p \<and> pb \<noteq> p \<and> info_flow_shm s pa pb) )" |
|
72 |
apply (rule ext, rule ext, frule vt_grant_os) |
|
73 |
by (auto simp:info_flow_shm_def one_flow_shm_def) |
|
74 |
||
75 |
lemma info_flow_shm_deleteshm: |
|
76 |
"valid (DeleteShM p h # s) \<Longrightarrow> info_flow_shm (DeleteShM p h # s) = (\<lambda> pa pb. |
|
77 |
self_shm s pa pb \<or> (\<exists> h'. h' \<noteq> h \<and> one_flow_shm s h' pa pb) )" |
|
78 |
apply (rule ext, rule ext, frule vt_grant_os) |
|
79 |
by (auto simp:info_flow_shm_def one_flow_shm_def) |
|
80 |
||
81 |
lemma info_flow_shm_clone: |
|
82 |
"valid (Clone p p' fds shms # s) \<Longrightarrow> info_flow_shm (Clone p p' fds shms # s) = (\<lambda> pa pb. |
|
83 |
(pa = p' \<and> pb = p') \<or> (pa = p' \<and> pb \<noteq> p' \<and> (\<exists> h \<in> shms. one_flow_shm s h p pb)) \<or> |
|
84 |
(pb = p' \<and> pa \<noteq> p' \<and> (\<exists> h \<in> shms. one_flow_shm s h pa p)) \<or> |
|
85 |
(pa \<noteq> p' \<and> pb \<noteq> p' \<and> info_flow_shm s pa pb))" |
|
86 |
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons, clarsimp) |
|
87 |
apply (frule_tac p = p' in procs_of_shm_prop2', simp) |
|
88 |
apply (auto simp:info_flow_shm_def one_flow_shm_def) |
|
89 |
done |
|
90 |
||
91 |
lemma info_flow_shm_execve: |
|
92 |
"valid (Execve p f fds # s) \<Longrightarrow> info_flow_shm (Execve p f fds # s) = (\<lambda> pa pb. |
|
93 |
(pa = p \<and> pb = p) \<or> (pa \<noteq> p \<and> pb \<noteq> p \<and> info_flow_shm s pa pb) )" |
|
94 |
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons) |
|
95 |
by (auto simp:info_flow_shm_def one_flow_shm_def) |
|
96 |
||
97 |
lemma info_flow_shm_kill: |
|
98 |
"valid (Kill p p' # s) \<Longrightarrow> info_flow_shm (Kill p p' # s) = (\<lambda> pa pb. |
|
99 |
pa \<noteq> p' \<and> pb \<noteq> p' \<and> info_flow_shm s pa pb )" |
|
100 |
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons) |
|
101 |
by (auto simp:info_flow_shm_def one_flow_shm_def) |
|
102 |
||
103 |
lemma info_flow_shm_exit: |
|
104 |
"valid (Exit p # s) \<Longrightarrow> info_flow_shm (Exit p # s) = (\<lambda> pa pb. |
|
105 |
pa \<noteq> p \<and> pb \<noteq> p \<and> info_flow_shm s pa pb )" |
|
106 |
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons) |
|
107 |
by (auto simp:info_flow_shm_def one_flow_shm_def) |
|
108 |
||
109 |
lemma info_flow_shm_other: |
|
110 |
"\<lbrakk>valid (e # s); |
|
111 |
\<forall> p h flag. e \<noteq> Attach p h flag; |
|
112 |
\<forall> p h. e \<noteq> Detach p h; |
|
113 |
\<forall> p h. e \<noteq> DeleteShM p h; |
|
114 |
\<forall> p p' fds shms. e \<noteq> Clone p p' fds shms; |
|
115 |
\<forall> p f fds. e \<noteq> Execve p f fds; |
|
116 |
\<forall> p p'. e \<noteq> Kill p p'; |
|
117 |
\<forall> p. e \<noteq> Exit p |
|
118 |
\<rbrakk> \<Longrightarrow> info_flow_shm (e # s) = info_flow_shm s" |
|
119 |
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons) |
|
120 |
apply (case_tac e, auto simp:info_flow_shm_def one_flow_shm_def dest:procs_of_shm_prop2) |
|
121 |
apply (erule_tac x = h in allE, simp) |
|
122 |
apply (drule procs_of_shm_prop1, auto) |
|
123 |
done |
|
124 |
||
125 |
||
126 |
(* |
|
25
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
127 |
lemma info_flow_shm_prop1: |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
128 |
"\<lbrakk>info_flow_shm s p p'; p \<noteq> p'; valid s\<rbrakk> |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
129 |
\<Longrightarrow> \<exists> h h' flag. (p, SHM_RDWR) \<in> procs_of_shm s h \<and> (p', flag) \<in> procs_of_shm s h'" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
130 |
by (induct rule: info_flow_shm.induct, auto) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
131 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
132 |
lemma info_flow_shm_cases: |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
133 |
"\<lbrakk>info_flow_shm \<tau> pa pb; \<And>p s. \<lbrakk>s = \<tau> ; pa = p; pb = p; p \<in> current_procs s\<rbrakk> \<Longrightarrow> P; |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
134 |
\<And>s p p' h p'' flag. \<lbrakk>s = \<tau>; pa = p; pb = p''; info_flow_shm s p p'; (p', SHM_RDWR) \<in> procs_of_shm s h; |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
135 |
(p'', flag) \<in> procs_of_shm s h\<rbrakk>\<Longrightarrow> P\<rbrakk> |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
136 |
\<Longrightarrow> P" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
137 |
by (erule info_flow_shm.cases, auto) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
138 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
139 |
definition one_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
140 |
where |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
141 |
"one_flow_shm s p p' \<equiv> p \<noteq> p' \<and> (\<exists> h flag. (p, SHM_RDWR) \<in> procs_of_shm s h \<and> (p', flag) \<in> procs_of_shm s h)" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
142 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
143 |
inductive flows_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
144 |
where |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
145 |
"p \<in> current_procs s \<Longrightarrow> flows_shm s p p" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
146 |
| "\<lbrakk>flows_shm s p p'; one_flow_shm s p' p''\<rbrakk> \<Longrightarrow> flows_shm s p p''" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
147 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
148 |
definition attached_procs :: "t_state \<Rightarrow> t_shm \<Rightarrow> t_process set" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
149 |
where |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
150 |
"attached_procs s h \<equiv> {p. \<exists> flag. (p, flag) \<in> procs_of_shm s h}" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
151 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
152 |
definition flowed_procs:: "t_state \<Rightarrow> t_shm \<Rightarrow> t_process set" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
153 |
where |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
154 |
"flowed_procs s h \<equiv> {p'. \<exists> p \<in> attached_procs s h. flows_shm s p p'}" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
155 |
|
26 | 156 |
inductive flowed_shm:: "t_state \<Rightarrow> t_process \<Rightarrow> t_shm set" |
157 |
||
25
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
158 |
fun Info_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process set" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
159 |
where |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
160 |
"Info_flow_shm [] = (\<lambda> p. {p'. flows_shm [] p p'})" |
26 | 161 |
| "Info_flow_shm (Attach p h flag # s) = (\<lambda> p'. |
162 |
if (p' = p) then flowed_procs s h |
|
163 |
else if () |
|
164 |
" |
|
25
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
165 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
166 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
167 |
lemma info_flow_shm_attach: |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
168 |
"valid (Attach p h flag # s) \<Longrightarrow> info_flow_shm (Attach p h flag # s) = (\<lambda> pa pb. (info_flow_shm s pa pb) \<or> |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
169 |
(if (pa = p) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
170 |
then (if (flag = SHM_RDWR) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
171 |
then (\<exists> flag. (pb, flag) \<in> procs_of_shm s h) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
172 |
else (pb = p)) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
173 |
else (if (pb = p) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
174 |
then (pa, SHM_RDWR) \<in> procs_of_shm s h |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
175 |
else info_flow_shm s pa pb)) )" |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
176 |
apply (frule vd_cons, frule vt_grant_os, rule ext, rule ext) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
177 |
apply (case_tac "info_flow_shm s pa pb", simp) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
178 |
|
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
179 |
thm info_flow_shm.cases |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
180 |
apply (auto split:if_splits intro:info_flow_shm.intros elim:info_flow_shm_cases) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
181 |
apply (erule info_flow_shm_cases, simp, simp split:if_splits) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
182 |
apply (rule_tac p = pa and p' = p' in info_flow_shm.intros(2), simp+) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
183 |
apply (rule notI, erule info_flow_shm.cases, simp+) |
259a50be4381
wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents:
23
diff
changeset
|
184 |
pr 5 |
26 | 185 |
*) |
186 |
lemmas info_flow_shm_simps = info_flow_shm_other info_flow_shm_attach info_flow_shm_detach info_flow_shm_deleteshm |
|
187 |
info_flow_shm_clone info_flow_shm_execve info_flow_shm_kill info_flow_shm_exit |
|
23
25e55731ed01
locale of tainting for seeds when same shm/inode bugs
chunhan
parents:
19
diff
changeset
|
188 |
|
19 | 189 |
lemma has_same_inode_in_current: |
190 |
"\<lbrakk>has_same_inode s f f'; valid s\<rbrakk> \<Longrightarrow> f \<in> current_files s \<and> f' \<in> current_files s" |
|
191 |
by (auto simp add:has_same_inode_def current_files_def) |
|
192 |
||
193 |
lemma has_same_inode_prop1: |
|
194 |
"\<lbrakk>has_same_inode s f f'; is_file s f; valid s\<rbrakk> \<Longrightarrow> is_file s f'" |
|
195 |
by (auto simp:has_same_inode_def is_file_def) |
|
196 |
||
197 |
lemma has_same_inode_prop1': |
|
198 |
"\<lbrakk>has_same_inode s f f'; is_file s f'; valid s\<rbrakk> \<Longrightarrow> is_file s f" |
|
199 |
by (auto simp:has_same_inode_def is_file_def) |
|
200 |
||
201 |
lemma has_same_inode_prop2: |
|
202 |
"\<lbrakk>has_same_inode s f f'; file_of_proc_fd s p fd = Some f; valid s\<rbrakk> \<Longrightarrow> is_file s f'" |
|
203 |
apply (drule has_same_inode_prop1) |
|
204 |
apply (simp add:file_of_pfd_is_file, simp+) |
|
205 |
done |
|
206 |
||
207 |
lemma has_same_inode_prop2': |
|
208 |
"\<lbrakk>has_same_inode s f f'; file_of_proc_fd s p fd = Some f'; valid s\<rbrakk> \<Longrightarrow> is_file s f" |
|
209 |
apply (drule has_same_inode_prop1') |
|
210 |
apply (simp add:file_of_pfd_is_file, simp+) |
|
211 |
done |
|
212 |
||
213 |
lemma tobj_in_init_alive: |
|
214 |
"tobj_in_init obj \<Longrightarrow> init_alive obj" |
|
215 |
by (case_tac obj, auto) |
|
216 |
||
217 |
lemma tobj_in_alive: |
|
218 |
"tobj_in_init obj \<Longrightarrow> alive [] obj" |
|
219 |
by (case_tac obj, auto simp:is_file_nil) |
|
220 |
||
18 | 221 |
end |
222 |
||
223 |
end |