author | chunhan |
Mon, 02 Dec 2013 10:52:40 +0800 | |
changeset 74 | 271e9818b6f6 |
permissions | -rw-r--r-- |
74
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
1 |
theory Dynamic_static |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
2 |
imports Main Flask Static Init_prop Valid_prop Tainted_prop Delete_prop Co2sobj_prop S2ss_prop S2ss_prop2 |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
3 |
Temp |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
4 |
begin |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
5 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
6 |
context tainting_s begin |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
7 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
8 |
fun remove_create_flag :: "t_open_flags \<Rightarrow> t_open_flags" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
9 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
10 |
"remove_create_flag (mflag, oflags) = (mflag, oflags - {OF_CREAT})" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
11 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
12 |
fun all_procs :: "t_state \<Rightarrow> t_process set" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
13 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
14 |
"all_procs [] = init_procs" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
15 |
| "all_procs (Clone p p' fds shms # s) = insert p' (all_procs s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
16 |
| "all_procs (e # s) = all_procs s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
17 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
18 |
definition brandnew_proc :: "t_state \<Rightarrow> t_process" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
19 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
20 |
"brandnew_proc s \<equiv> next_nat (all_procs s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
21 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
22 |
(* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
23 |
definition brandnew_proc :: "t_state \<Rightarrow> t_process" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
24 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
25 |
"brandnew_proc s \<equiv> next_nat ({p | p s'. p \<in> current_procs s' \<and> s' \<preceq> s})" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
26 |
another approach: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
27 |
brandnew_proc = next_nat (all_procs s), |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
28 |
where all_procs is a event-trace listener *) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
29 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
30 |
(* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
31 |
lemma brandnew_proc_prop1: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
32 |
"\<lbrakk>s' \<preceq> s; valid s\<rbrakk> \<Longrightarrow> brandnew_proc s \<notin> current_procs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
33 |
apply (frule vd_preceq, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
34 |
apply (simp add:brandnew_proc_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
35 |
apply (auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
36 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
37 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
38 |
lemma brandnew_proc_prop2: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
39 |
"\<lbrakk>p \<in> current_procs s'; s' \<preceq> s; valid s\<rbrakk> \<Longrightarrow> brandnew_proc s \<noteq> p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
40 |
by (auto dest:brandnew_proc_prop1) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
41 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
42 |
lemma brandnew_proc_prop3: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
43 |
"\<lbrakk>p \<in> current_procs s; valid (e # s)\<rbrakk> \<Longrightarrow> brandnew_proc (e # s) \<noteq> p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
44 |
apply (rule brandnew_proc_prop2, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
45 |
apply (rule no_juniorI, simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
46 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
47 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
48 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
49 |
(* enrich s target_proc duplicated_pro *) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
50 |
fun enrich_proc :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> t_state" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
51 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
52 |
"enrich_proc [] tp dp = []" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
53 |
| "enrich_proc (Execve p f fds # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
54 |
if (tp = p) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
55 |
then Execve dp f (fds \<inter> proc_file_fds s p) # Execve p f fds # (enrich_proc s tp dp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
56 |
else Execve p f fds # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
57 |
| "enrich_proc (Clone p p' fds shms # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
58 |
if (tp = p') |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
59 |
then Clone p dp (fds \<inter> proc_file_fds s p) shms # Clone p p' fds shms # s |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
60 |
else Clone p p' fds shms # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
61 |
| "enrich_proc (Open p f flags fd opt # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
62 |
if (tp = p) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
63 |
then Open dp f (remove_create_flag flags) fd opt # Open p f flags fd opt # (enrich_proc s tp dp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
64 |
else Open p f flags fd opt # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
65 |
| "enrich_proc (CloseFd p fd # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
66 |
if (tp = p) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
67 |
then CloseFd dp fd # CloseFd p fd # (enrich_proc s tp dp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
68 |
else CloseFd p fd # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
69 |
| "enrich_proc (Attach p h flag # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
70 |
if (tp = p) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
71 |
then Attach dp h flag # Attach p h flag # (enrich_proc s tp dp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
72 |
else Attach p h flag # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
73 |
| "enrich_proc (Detach p h # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
74 |
if (tp = p) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
75 |
then Detach dp h # Detach p h # (enrich_proc s tp dp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
76 |
else Detach p h # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
77 |
| "enrich_proc (Kill p p' # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
78 |
if (tp = p) then Kill p p' # s |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
79 |
else Kill p p' # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
80 |
| "enrich_proc (Exit p # s) tp dp = ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
81 |
if (tp = p) then Exit p # s |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
82 |
else Exit p # (enrich_proc s tp dp))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
83 |
| "enrich_proc (e # s) tp dp = e # (enrich_proc s tp dp)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
84 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
85 |
definition is_created_proc:: "t_state \<Rightarrow> t_process \<Rightarrow> bool" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
86 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
87 |
"is_created_proc s p \<equiv> p \<in> init_procs \<longrightarrow> deleted (O_proc p) s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
88 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
89 |
lemma enrich_search_check: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
90 |
assumes grant: "search_check s (up, rp, tp) f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
91 |
and cf2sf: "\<forall> f. f \<in> current_files s \<longrightarrow> cf2sfile s' f = cf2sfile s f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
92 |
and vd: "valid s" and f_in: "is_file s f" and f_in': "is_file s' f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
93 |
and sec: "sectxt_of_obj s' (O_file f) = sectxt_of_obj s (O_file f)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
94 |
shows "search_check s' (up, rp, tp) f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
95 |
proof (cases f) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
96 |
case Nil |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
97 |
with f_in vd have "False" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
98 |
by (auto dest:root_is_dir') |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
99 |
thus ?thesis by simp |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
100 |
next |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
101 |
case (Cons n pf) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
102 |
from vd f_in obtain sf where sf: "cf2sfile s f = Some sf" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
103 |
apply (drule_tac is_file_in_current, drule_tac current_file_has_sfile, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
104 |
apply (erule exE, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
105 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
106 |
then obtain psfs where psfs: "get_parentfs_ctxts s pf = Some psfs" using Cons |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
107 |
by (auto simp:cf2sfile_def split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
108 |
from sf cf2sf f_in have sf': "cf2sfile s' f = Some sf" by (auto dest:is_file_in_current) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
109 |
then obtain psfs' where psfs': "get_parentfs_ctxts s' pf = Some psfs'"using Cons |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
110 |
by (auto simp:cf2sfile_def split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
111 |
with sf sf' psfs have psfs_eq: "set psfs' = set psfs" using Cons f_in f_in' |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
112 |
apply (simp add:cf2sfile_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
113 |
apply (case_tac sf, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
114 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
115 |
show ?thesis using grant f_in f_in' psfs psfs' psfs_eq sec |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
116 |
apply (simp add:Cons split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
117 |
by (case_tac a, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
118 |
qed |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
119 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
120 |
lemma proc_filefd_has_sfd: "\<lbrakk>fd \<in> proc_file_fds s p; valid s\<rbrakk> \<Longrightarrow> \<exists> sfd. cfd2sfd s p fd = Some sfd" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
121 |
apply (simp add:proc_file_fds_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
122 |
apply (auto dest: current_filefd_has_sfd) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
123 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
124 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
125 |
lemma enrich_inherit_fds_check: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
126 |
assumes grant: "inherit_fds_check s (up, nr, nt) p fds" and vd: "valid s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
127 |
and cp2sp: "\<forall> p. p \<in> current_procs s \<longrightarrow> cp2sproc s' p = cp2sproc s p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
128 |
and p_in: "p \<in> current_procs s" and p_in': "p \<in> current_procs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
129 |
and fd_in: "fds \<subseteq> proc_file_fds s p" and fd_in': "fds \<subseteq> proc_file_fds s' p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
130 |
shows "inherit_fds_check s' (up, nr, nt) p fds" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
131 |
proof- |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
132 |
have "\<And> fd. fd \<in> fds \<Longrightarrow> sectxt_of_obj s' (O_fd p fd) = sectxt_of_obj s (O_fd p fd)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
133 |
proof- |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
134 |
fix fd |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
135 |
assume fd_in_fds: "fd \<in> fds" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
136 |
hence fd_in_cfds: "fd \<in> proc_file_fds s p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
137 |
and fd_in_cfds': "fd \<in> proc_file_fds s' p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
138 |
using fd_in fd_in' by auto |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
139 |
from p_in vd obtain sp where csp: "cp2sproc s p = Some sp" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
140 |
by (drule_tac current_proc_has_sp, simp, erule_tac exE, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
141 |
with cp2sp have "cpfd2sfds s p = cpfd2sfds s' p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
142 |
apply (erule_tac x = p in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
143 |
by (auto simp:cp2sproc_def split:option.splits simp:p_in) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
144 |
hence "cfd2sfd s p fd = cfd2sfd s' p fd" using fd_in_cfds fd_in_cfds' |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
145 |
apply (simp add:cpfd2sfds_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
146 |
apply (frule proc_filefd_has_sfd, simp add:vd, erule exE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
147 |
apply (drule_tac x = sfd in eqset_imp_iff, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
148 |
(* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
149 |
thm inherit_fds_check_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
150 |
thm sectxts_of_fds_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
151 |
thm cpfd2sfds_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
152 |
apply ( |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
153 |
*)sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
154 |
show "sectxt_of_obj s' (O_fd p fd) = sectxt_of_obj s (O_fd p fd)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
155 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
156 |
qed |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
157 |
hence "sectxts_of_fds s' p fds = sectxts_of_fds s p fds" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
158 |
by (simp add:sectxts_of_fds_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
159 |
thus ?thesis using grant |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
160 |
by (simp add:inherit_fds_check_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
161 |
qed |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
162 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
163 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
164 |
lemma enrich_proc_aux1: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
165 |
assumes vs': "valid s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
166 |
and os: "os_grant s e" and grant: "grant s e" and vd: "valid s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
167 |
and alive: "\<forall> obj. alive s obj \<longrightarrow> alive s' obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
168 |
and cp2sp: "\<forall> p. p \<in> current_procs s \<longrightarrow> cp2sproc s' p = cp2sproc s p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
169 |
and cf2sf: "\<forall> f. f \<in> current_files s \<longrightarrow> cf2sfile s' f = cf2sfile s f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
170 |
shows "valid (e # s')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
171 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
172 |
sorry (* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
173 |
proof (cases e) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
174 |
case (Execve p f fds) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
175 |
have p_in: "p \<in> current_procs s'" using os alive |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
176 |
apply (erule_tac x = "O_proc p" in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
177 |
by (auto simp:Execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
178 |
have f_in: "is_file s' f" using os alive |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
179 |
apply (erule_tac x = "O_file f" in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
180 |
by (auto simp:Execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
181 |
have fd_in: "fds \<subseteq> current_proc_fds s' p" using os alive |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
182 |
apply (auto simp:Execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
183 |
by (erule_tac x = "O_fd p x" in allE, auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
184 |
have "os_grant s' e" using p_in f_in fd_in by (simp add:Execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
185 |
moreover have "grant s' e" apply (simp add:Execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
186 |
proof- |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
187 |
from grant obtain up rp tp uf rf tf |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
188 |
where p1: "sectxt_of_obj s (O_proc p) = Some (up, rp, tp)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
189 |
and p2: "sectxt_of_obj s (O_file f) = Some (uf, rf, tf)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
190 |
by (simp add:Execve split:option.splits, blast) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
191 |
with grant obtain pu nr nt where p3: "npctxt_execve (up, rp, tp) (uf, rf, tf) = Some (pu, nr, nt)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
192 |
by (simp add:Execve split:option.splits del:npctxt_execve.simps, blast) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
193 |
from p1 have p1': "sectxt_of_obj s' (O_proc p) = Some (up, rp, tp)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
194 |
using os cp2sp |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
195 |
apply (erule_tac x = p in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
196 |
by (auto simp:Execve co2sobj.simps cp2sproc_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
197 |
from os have f_in': "is_file s f" by (simp add:Execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
198 |
from vd os have "\<exists> sf. cf2sfile s f = Some sf" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
199 |
by (auto dest!:is_file_in_current current_file_has_sfile simp:Execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
200 |
hence p2': "sectxt_of_obj s' (O_file f) = Some (uf, rf, tf)" using f_in f_in' p2 cf2sf |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
201 |
apply (erule_tac x = f in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
202 |
apply (auto dest:is_file_in_current simp:cf2sfile_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
203 |
apply (case_tac f, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
204 |
apply (drule_tac s = s in root_is_dir', simp add:vd, simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
205 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
206 |
show ? |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
207 |
proof- |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
208 |
have |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
209 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
210 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
211 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
212 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
213 |
lemma enrich_proc_prop: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
214 |
"\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
215 |
\<Longrightarrow> valid (enrich_proc s p p') \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
216 |
(p \<in> current_procs s \<longrightarrow> co2sobj (enrich_proc s p p') (O_proc p') = co2sobj (enrich_proc s p p') (O_proc p)) \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
217 |
(\<forall> obj. alive s obj \<longrightarrow> alive (enrich_proc s p p') obj) \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
218 |
(\<forall> p'. p' \<in> current_procs s \<longrightarrow> cp2sproc (enrich_proc s p p') p' = cp2sproc s p) \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
219 |
(\<forall> f. f \<in> current_files s \<longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f) \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
220 |
(Tainted (enrich_proc s p p') = (Tainted s \<union> (if (O_proc p \<in> Tainted s) then {O_proc p'} else {})))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
221 |
sorry (* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
222 |
proof (induct s) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
223 |
case Nil |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
224 |
thus ?case by (auto simp:is_created_proc_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
225 |
next |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
226 |
case (Cons e s) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
227 |
hence p1: "\<lbrakk>valid s; is_created_proc s p; p' \<notin> all_procs s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
228 |
\<Longrightarrow> valid (enrich_proc s p p') \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
229 |
(p \<in> current_procs s \<longrightarrow> co2sobj (enrich_proc s p p') (O_proc p') = co2sobj (enrich_proc s p p') (O_proc p)) \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
230 |
(alive s obj \<longrightarrow> alive (enrich_proc s p p') obj \<and> co2sobj (enrich_proc s p p') obj = co2sobj s obj)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
231 |
and p2: "valid (e # s)" and p3: "is_created_proc (e # s) p" and p4: "p' \<notin> all_procs (e # s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
232 |
by auto |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
233 |
from p2 have vd: "valid s" and os: "os_grant s e" and grant: "grant s e" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
234 |
by (auto dest:vd_cons vt_grant vt_grant_os) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
235 |
from p4 have p4': "p' \<notin> all_procs s" by (case_tac e, auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
236 |
from p1 p4' have a1: "is_created_proc s p \<Longrightarrow> valid (enrich_proc s p p')" by (auto simp:vd) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
237 |
have c1: "valid (enrich_proc (e # s) p p')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
238 |
apply (case_tac e) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
239 |
using a1 os p3 |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
240 |
apply (auto simp:is_created_proc_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
241 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
242 |
moreover have c2: "p' \<in> current_procs (enrich_proc (e # s) p p')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
243 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
244 |
moreover have c3: "co2sobj (enrich_proc (e # s) p p') (O_proc p') = co2sobj (enrich_proc (e # s) p p') (O_proc p)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
245 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
246 |
moreover have c4: "alive (e # s) obj \<longrightarrow> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
247 |
alive (enrich_proc (e # s) p p') obj \<and> co2sobj (enrich_proc (e # s) p p') obj = co2sobj (e # s) obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
248 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
249 |
ultimately show ?case by auto |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
250 |
qed |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
251 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
252 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
253 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
254 |
lemma "alive s obj \<Longrightarrow> alive (enrich_proc s p p') obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
255 |
apply (induct s, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
256 |
apply (case_tac a, case_tac[!] obj) sorry (* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
257 |
apply (auto simp:is_file_def is_dir_def split:option.splits t_inode_tag.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
258 |
thm is_file_other |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
259 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
260 |
lemma enrich_proc_valid: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
261 |
"\<lbrakk>p \<in> current_procs s; valid s; p \<in> init_procs \<longrightarrow> deleted (O_proc p) s; p' \<notin> current_procs s\<rbrakk> \<Longrightarrow> valid (enrich_proc s p p')" (* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
262 |
apply (induct s, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
263 |
apply (frule vd_cons, frule vt_grant, frule vt_grant_os, case_tac a) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
264 |
apply (auto intro!:valid.intros(2)) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
265 |
prefer 28 |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
266 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
267 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
268 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
269 |
end |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
270 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
271 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
272 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
273 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
274 |
(* for any created obj, we can enrich trace with events that create new objs with the same static-properties *) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
275 |
definition enriched:: "t_state \<Rightarrow> t_object set \<Rightarrow> t_state \<Rightarrow> bool" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
276 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
277 |
"enriched s objs s' \<equiv> \<forall> obj \<in> objs. \<exists> obj'. \<not> alive s obj' \<and> obj' \<notin> objs \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
278 |
alive s' obj' \<and> co2sobj s' obj' = co2sobj s' obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
279 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
280 |
definition reserved:: "t_state \<Rightarrow> t_object set \<Rightarrow> t_state \<Rightarrow> bool" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
281 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
282 |
"reserved s objs s' \<equiv> \<forall> obj. alive s obj \<longrightarrow> alive s' obj \<and> co2sobj s' obj = co2sobj s obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
283 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
284 |
definition enrichable :: "t_state \<Rightarrow> t_object set \<Rightarrow> bool" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
285 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
286 |
"enrichable s objs \<equiv> \<exists> s'. valid s' \<and> s2ss s' = s2ss s \<and> enriched s objs s' \<and> reserved s objs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
287 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
288 |
fun is_created :: "t_state \<Rightarrow> t_object \<Rightarrow> bool" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
289 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
290 |
"is_created s (O_file f) = (\<forall> f' \<in> same_inode_files s f. init_alive (O_file f') \<longrightarrow> deleted (O_file f') s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
291 |
| "is_created s obj = (init_alive obj \<longrightarrow> deleted obj s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
292 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
293 |
definition is_inited :: "t_state \<Rightarrow> t_object \<Rightarrow> bool" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
294 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
295 |
"is_inited s obj \<equiv> init_alive obj \<and> \<not> deleted obj s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
296 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
297 |
(* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
298 |
lemma is_inited_eq_not_created: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
299 |
"is_inited s obj = (\<not> is_created s obj)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
300 |
by (auto simp:is_created_def is_inited_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
301 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
302 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
303 |
lemma many_sq_imp_sms: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
304 |
"\<lbrakk>S_msgq (Create, sec, sms) \<in> ss; ss \<in> static\<rbrakk> \<Longrightarrow> \<forall> sm \<in> (set sms). is_many_smsg sm" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
305 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
306 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
307 |
(* recorded in our static world *) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
308 |
fun recorded :: "t_object \<Rightarrow> bool" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
309 |
where |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
310 |
"recorded (O_proc p) = True" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
311 |
| "recorded (O_file f) = True" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
312 |
| "recorded (O_dir f) = True" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
313 |
| "recorded (O_node n) = False" (* cause socket is temperary not considered *) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
314 |
| "recorded (O_shm h) = True" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
315 |
| "recorded (O_msgq q) = True" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
316 |
| "recorded _ = False" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
317 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
318 |
lemma cf2sfile_fi_init_file: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
319 |
"\<lbrakk>cf2sfile s f = Some (Init f', sec, psec, asecs); is_file s f; valid s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
320 |
\<Longrightarrow> is_init_file f \<and> \<not> deleted (O_file f) s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
321 |
apply (simp add:cf2sfile_def sroot_def split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
322 |
apply (case_tac f, simp, drule root_is_dir', simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
323 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
324 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
325 |
lemma root_not_deleted: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
326 |
"valid s \<Longrightarrow> \<not> deleted (O_dir []) s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
327 |
apply (induct s, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
328 |
apply (frule vd_cons, frule vt_grant_os, case_tac a) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
329 |
by auto |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
330 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
331 |
lemma cf2sfile_fi_init_dir: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
332 |
"\<lbrakk>cf2sfile s f = Some (Init f', sec, psec, asecs); is_dir s f; valid s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
333 |
\<Longrightarrow> is_init_dir f \<and> \<not> deleted (O_dir f) s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
334 |
apply (simp add:cf2sfile_def sroot_def split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
335 |
apply (case_tac f, simp add:root_is_init_dir root_not_deleted, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
336 |
apply (drule file_dir_conflict, simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
337 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
338 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
339 |
lemma is_created_imp_many: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
340 |
"\<lbrakk>is_created s obj; co2sobj s obj = Some sobj; alive s obj; valid s\<rbrakk> \<Longrightarrow> is_many sobj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
341 |
apply (case_tac obj, auto simp:co2sobj.simps split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
342 |
apply (case_tac [!] a) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
343 |
apply (auto simp:cp2sproc_def ch2sshm_def cq2smsgq_def cf2sfiles_def same_inode_files_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
344 |
split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
345 |
apply (frule cf2sfile_fi_init_file, simp add:is_file_def, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
346 |
apply (erule_tac x = f' in allE, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
347 |
apply (frule cf2sfile_fi_init_dir, simp+)+ |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
348 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
349 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
350 |
lemma anotherp_imp_manysp: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
351 |
"\<lbrakk>cp2sproc s p = Some sp; co2sobj s (O_proc p') = co2sobj s (O_proc p); p' \<noteq> p; |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
352 |
p' \<in> current_procs s; p \<in> current_procs s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
353 |
\<Longrightarrow> is_many_sproc sp" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
354 |
by (case_tac sp, auto simp:cp2sproc_def co2sobj.simps split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
355 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
356 |
lemma is_file_has_sfs: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
357 |
"\<lbrakk>is_file s f; valid s; cf2sfile s f = Some sf\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
358 |
\<Longrightarrow> \<exists> sfs. co2sobj s (O_file f) = Some (S_file sfs (O_file f \<in> Tainted s)) \<and> sf \<in> sfs" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
359 |
apply (rule_tac x = "{sf' | f' sf'. cf2sfile s f' = Some sf' \<and> f' \<in> same_inode_files s f}" in exI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
360 |
apply (auto simp:co2sobj.simps cf2sfiles_def tainted_eq_Tainted) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
361 |
apply (rule_tac x = f in exI, simp add:same_inode_files_prop9) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
362 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
363 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
364 |
declare Product_Type.split_paired_Ex Product_Type.split_paired_All [simp del] |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
365 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
366 |
lemma current_proc_in_s2ss: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
367 |
"\<lbrakk>cp2sproc s p = Some sp; p \<in> current_procs s; valid s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
368 |
\<Longrightarrow> S_proc sp (O_proc p \<in> Tainted s) \<in> s2ss s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
369 |
apply (simp add:s2ss_def, rule_tac x = "O_proc p" in exI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
370 |
apply (auto simp:co2sobj.simps tainted_eq_Tainted) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
371 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
372 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
373 |
lemma current_file_in_s2ss: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
374 |
"\<lbrakk>co2sobj s (O_file f) = Some (S_file sfs tagf); is_file s f; valid s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
375 |
\<Longrightarrow> S_file sfs tagf \<in> s2ss s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
376 |
by (simp add:s2ss_def, rule_tac x = "O_file f" in exI, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
377 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
378 |
declare npctxt_execve.simps grant_execve.simps search_check.simps [simp del] |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
379 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
380 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
381 |
lemma npctxt_execve_eq_sec: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
382 |
"\<lbrakk>sectxt_of_obj (Execve p f fds # s) (O_proc p) = Some sec'; sectxt_of_obj s (O_proc p) = Some sec; |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
383 |
sectxt_of_obj s (O_file f) = Some fsec; valid (Execve p f fds # s)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
384 |
\<Longrightarrow> npctxt_execve sec fsec = Some sec'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
385 |
by (case_tac sec, case_tac fsec, auto simp:npctxt_execve.simps sectxt_of_obj_simps split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
386 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
387 |
lemma npctxt_execve_eq_cp2sproc: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
388 |
"\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s); |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
389 |
cp2sproc s p = Some (pi, sec, sfds, shms); cf2sfile s f = Some (fi, fsec, psec, asecs)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
390 |
\<Longrightarrow> npctxt_execve sec fsec = Some sec'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
391 |
apply (frule vt_grant_os, frule vd_cons) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
392 |
apply (rule npctxt_execve_eq_sec, auto simp:cp2sproc_def cf2sfile_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
393 |
apply (case_tac f, auto dest:root_is_dir') |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
394 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
395 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
396 |
lemma seach_check_eq_static: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
397 |
"\<lbrakk>cf2sfile s f = Some sf; valid s; is_dir s f \<or> is_file s f\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
398 |
\<Longrightarrow> search_check_s sec sf (is_file s f) = search_check s sec f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
399 |
apply (case_tac sf) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
400 |
apply (induct f) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
401 |
apply (auto simp:search_check_s_def search_check.simps cf2sfile_def sroot_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
402 |
root_sec_remains init_sectxt_prop sec_of_root_valid |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
403 |
dest!:root_is_dir' current_has_sec' split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
404 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
405 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
406 |
lemma grant_execve_intro_execve: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
407 |
"\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s); |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
408 |
cp2sproc s p = Some (pi, sec, sfds, shms); cf2sfile s f = Some (fi, fsec, psec, asecs)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
409 |
\<Longrightarrow> grant_execve sec fsec sec'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
410 |
apply (frule vt_grant_os, frule vd_cons, frule vt_grant) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
411 |
apply (auto split:option.splits dest!:current_has_sec' simp del:grant_execve.simps simp add:cp2sproc_execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
412 |
apply (erule_tac x = aba in allE, erule_tac x = aca in allE, erule_tac x = bb in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
413 |
apply (auto simp del:grant_execve.simps simp add:cp2sproc_def cf2sfile_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
414 |
apply (case_tac f, simp, drule root_is_dir', simp, simp, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
415 |
apply (simp add:sectxt_of_obj_simps) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
416 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
417 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
418 |
lemma search_check_intro_execve: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
419 |
"\<lbrakk>cp2sproc s p = Some (pi, sec, sfds, shms); valid (Execve p f fds # s)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
420 |
\<Longrightarrow> search_check s sec f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
421 |
apply (frule vt_grant_os, frule vd_cons, frule vt_grant) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
422 |
apply (auto split:option.splits dest!:current_has_sec' simp del:grant_execve.simps simp add:cp2sproc_execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
423 |
apply (erule_tac x = aaa in allE, erule_tac x = ab in allE, erule_tac x = ba in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
424 |
apply (auto simp add:cp2sproc_def cf2sfile_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
425 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
426 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
427 |
lemma inherit_fds_check_intro_execve: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
428 |
"\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
429 |
\<Longrightarrow> inherit_fds_check s sec' p fds" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
430 |
apply (frule vt_grant_os, frule vd_cons, frule vt_grant) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
431 |
apply (auto split:option.splits dest!:current_has_sec' simp add:cp2sproc_execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
432 |
apply (erule_tac x = aba in allE, erule_tac x = aca in allE, erule_tac x = bb in allE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
433 |
apply (auto simp add:cp2sproc_def cf2sfile_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
434 |
apply (simp add:sectxt_of_obj_simps) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
435 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
436 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
437 |
lemma execve_sfds_subset: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
438 |
"\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s); |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
439 |
cp2sproc s p = Some (pi, sec, sfds, shms)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
440 |
\<Longrightarrow> sfds' \<subseteq> sfds" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
441 |
apply (frule vt_grant_os) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
442 |
apply (auto simp:cp2sproc_def cpfd2sfds_execve split:option.splits dest!:current_has_sec') |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
443 |
apply (simp add:cpfd2sfds_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
444 |
apply (rule_tac x = fd in bexI, auto simp:proc_file_fds_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
445 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
446 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
447 |
lemma inherit_fds_check_imp_static: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
448 |
"\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
449 |
inherit_fds_check s sec' p fds; valid (Execve p f fds # s)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
450 |
\<Longrightarrow> inherit_fds_check_s sec' sfds'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
451 |
apply (frule vt_grant_os, frule vd_cons, frule vt_grant) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
452 |
apply (auto simp:cp2sproc_def cpfd2sfds_execve inherit_fds_check_def inherit_fds_check_s_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
453 |
sorry (* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
454 |
apply (erule_tac x = "(ad, ae, bc)" in ballE, auto simp:sectxts_of_sfds_def sectxts_of_fds_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
455 |
apply (erule_tac x = fd in ballE, auto simp:cfd2sfd_def split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
456 |
done *) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
457 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
458 |
lemma d2s_main_execve_grant_aux: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
459 |
"\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s); |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
460 |
cp2sproc s p = Some (pi, sec, sfds, shms); cf2sfile s f = Some (fi, fsec, psec, asecs)\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
461 |
\<Longrightarrow> (npctxt_execve sec fsec = Some sec') \<and> grant_execve sec fsec sec' \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
462 |
search_check_s sec (fi, fsec, psec, asecs) (is_file s f) \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
463 |
inherit_fds_check_s sec' sfds' \<and> sfds' \<subseteq> sfds" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
464 |
apply (rule conjI, erule_tac pi = pi and sec = sec and sfds = sfds and |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
465 |
shms = shms and fi = fi and fsec = fsec and psec = psec and |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
466 |
asecs = asecs in npctxt_execve_eq_cp2sproc, simp, simp, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
467 |
apply (rule conjI, erule_tac pi = pi and sec = sec and sfds = sfds and |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
468 |
shms = shms and fi = fi and fsec = fsec and psec = psec and |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
469 |
asecs = asecs in grant_execve_intro_execve, simp, simp, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
470 |
apply (rule conjI, drule_tac sec = sec in search_check_intro_execve, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
471 |
apply (frule vd_cons, frule vt_grant_os) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
472 |
apply (drule_tac sec = sec in seach_check_eq_static, simp, simp, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
473 |
apply (rule conjI, rule inherit_fds_check_imp_static, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
474 |
apply (erule inherit_fds_check_intro_execve, simp, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
475 |
apply (erule_tac pi = pi and sfds = sfds and shms = shms in execve_sfds_subset, simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
476 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
477 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
478 |
lemma d2s_main_execve: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
479 |
"\<lbrakk>valid (Execve p f fds # s); s2ss s \<propto> static\<rbrakk> \<Longrightarrow> s2ss (Execve p f fds # s) \<propto> static" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
480 |
apply (frule vd_cons, frule vt_grant_os, clarsimp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
481 |
apply (frule is_file_has_sfile', simp, erule exE, frule is_file_has_sfs, simp+, erule exE, erule conjE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
482 |
apply (auto simp:s2ss_execve split:if_splits option.splits dest:current_proc_has_sp') |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
483 |
apply (clarsimp simp add:init_ss_in_def init_ss_eq_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
484 |
apply (rule_tac x = "update_ss ss' (S_proc (ah, (ai, aj, bd), ak, be) (O_proc p \<in> Tainted s)) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
485 |
(S_proc (ad, (ae, af, bb), ag, bc) (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s))" in bexI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
486 |
apply (auto simp:update_ss_def elim:Set.subset_insertI2 simp:anotherp_imp_manysp)[1] |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
487 |
apply (case_tac "ah = ad", case_tac "bc = {}", simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
488 |
apply (erule_tac sfs = sfs and fi = a and fsec = "(aa, ab,b)" and pfsec = ac and asecs = ba in s_execve, |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
489 |
auto intro:current_proc_in_s2ss current_file_in_s2ss split:option.splits dest:d2s_main_execve_grant_aux)[1] |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
490 |
apply (simp add:cp2sproc_execve split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
491 |
apply (simp add:cp2sproc_def split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
492 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
493 |
apply (clarsimp simp add:init_ss_in_def init_ss_eq_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
494 |
apply (rule_tac x = "update_ss ss' (S_proc (ah, (ai, aj, bd), ak, be) (O_proc p \<in> Tainted s)) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
495 |
(S_proc (ad, (ae, af, bb), ag, bc) (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s))" in bexI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
496 |
apply (rule conjI, simp add:update_ss_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
497 |
apply (rule conjI, simp add:update_ss_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
498 |
apply (auto)[1] |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
499 |
apply (simp add:update_ss_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
500 |
apply (rule conjI, rule impI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
501 |
apply (rule subsetI, clarsimp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
502 |
apply (erule impE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
503 |
apply (erule set_mp, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
504 |
apply (case_tac ah, simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
505 |
apply (rule impI, rule subsetI, clarsimp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
506 |
apply (erule set_mp, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
507 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
508 |
apply (case_tac "ah = ad", case_tac "bc = {}", simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
509 |
apply (erule_tac sfs = sfs and fi = a and fsec = "(aa, ab,b)" and pfsec = ac and asecs = ba in s_execve, |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
510 |
auto intro:current_proc_in_s2ss current_file_in_s2ss split:option.splits dest:d2s_main_execve_grant_aux)[1] |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
511 |
apply (simp add:cp2sproc_execve split:option.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
512 |
apply (simp add:cp2sproc_def split:option.splits if_splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
513 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
514 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
515 |
lemma co2sobj_eq_alive_proc_imp: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
516 |
"\<lbrakk>co2sobj s obj = co2sobj s (O_proc p); alive s (O_proc p); valid s\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
517 |
\<Longrightarrow> \<exists> p'. obj = O_proc p'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
518 |
by (auto simp add:co2sobj.simps split:option.splits dest:current_proc_has_sp' intro:co2sobj_sproc_imp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
519 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
520 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
521 |
lemma enrichable_execve: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
522 |
assumes p1: "\<And> objs. \<forall> obj \<in> objs. alive s obj \<and> is_created s obj \<and> recorded obj |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
523 |
\<Longrightarrow> \<exists> s'. valid s' \<and> s2ss s' = s2ss s \<and> enriched s objs s' \<and> reserved s objs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
524 |
and p2: "valid (e # s)" and p3: "\<forall>obj\<in>objs. alive (e # s) obj \<and> is_created (e # s) obj \<and> recorded obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
525 |
and p4: "e = Execve p f fds" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
526 |
shows "enrichable (e # s) objs" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
527 |
proof- |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
528 |
from p2 have os: "os_grant s e" and se: "grant s e" and vd: "valid s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
529 |
by (auto dest:vt_grant_os vd_cons vt_grant) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
530 |
from p3 have recorded: "\<forall> obj \<in> objs. recorded obj" by auto |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
531 |
from p3 p4 p2 have p1': "\<forall> obj \<in> objs. alive s obj \<and> is_created s obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
532 |
apply clarify |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
533 |
apply (erule_tac x = obj in ballE, simp add:alive_simps) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
534 |
apply (case_tac obj, auto simp:same_inode_files_simps) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
535 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
536 |
then obtain s' where a1: "valid s'" and a2: "s2ss s' = s2ss s" and a3: "enriched s objs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
537 |
and a4: "reserved s objs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
538 |
using p1 recorded by metis |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
539 |
show ?thesis |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
540 |
proof (cases "O_proc p \<in> objs") |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
541 |
case True |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
542 |
hence p_in: "p \<in> current_procs s'" using a4 os p4 |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
543 |
by (auto simp:reserved_def elim:allE[where x = "O_proc p"]) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
544 |
with a1 a3 True obtain p' where b1: "\<not> alive s (O_proc p')" and b2: "O_proc p' \<notin> objs" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
545 |
and b3: "alive s' (O_proc p')" and b4: "co2sobj s' (O_proc p') = co2sobj s' (O_proc p)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
546 |
apply (simp only:enriched_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
547 |
apply (erule_tac x = "O_proc p" in ballE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
548 |
apply (erule exE|erule conjE)+ |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
549 |
apply (frule co2sobj_eq_alive_proc_imp, auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
550 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
551 |
have "valid (Execve p' f fds # e # s')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
552 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
553 |
moreover have "s2ss (Execve p' f fds # e # s') = s2ss (e # s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
554 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
555 |
moreover have "enriched (e # s) objs (Execve p' f fds # e # s')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
556 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
557 |
moreover have "reserved (e # s) objs (Execve p' f fds # e # s')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
558 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
559 |
ultimately show ?thesis |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
560 |
apply (simp add:enrichable_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
561 |
apply (rule_tac x = "Execve p' f fds # e # s'" in exI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
562 |
by auto |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
563 |
next |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
564 |
case False |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
565 |
from a4 os p4 have "p \<in> current_procs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
566 |
apply (simp add:reserved_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
567 |
by (erule_tac x = "O_proc p" in allE, auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
568 |
moreover from a4 os p4 have "is_file s' f" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
569 |
apply (simp add:reserved_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
570 |
by (erule_tac x = "O_file f" in allE, auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
571 |
moreover from a4 os p4 vd have "fds \<subseteq> proc_file_fds s' p" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
572 |
apply (rule_tac subsetI, clarsimp simp:reserved_def current_proc_fds.simps) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
573 |
apply (erule_tac x = "O_fd p x" in allE, erule impE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
574 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
575 |
ultimately have "os_grant s' e" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
576 |
by (simp add:p4) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
577 |
moreover have "grant s' e" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
578 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
579 |
ultimately have "valid (e # s')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
580 |
using a1 by (erule_tac valid.intros(2), simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
581 |
thus ?thesis |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
582 |
apply (simp add:enrichable_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
583 |
apply (rule_tac x = "e # s'" in exI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
584 |
apply (simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
585 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
586 |
qed |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
587 |
qed |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
588 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
589 |
lemma s2d_main_execve: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
590 |
"\<lbrakk>grant_execve pctxt fsec pctxt'; ss \<in> static; S_proc (pi, pctxt, fds, shms) tagp \<in> ss; S_file sfs tagf \<in> ss; |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
591 |
(fi, fsec, pfsec, asecs) \<in> sfs; npctxt_execve pctxt fsec = Some pctxt'; |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
592 |
search_check_s pctxt (fi, fsec, pfsec, asecs) True; inherit_fds_check_s pctxt' fds'; fds' \<subseteq> fds; valid s; |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
593 |
s2ss s = ss\<rbrakk> \<Longrightarrow> \<exists>s. valid s \<and> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
594 |
s2ss s = update_ss ss (S_proc (pi, pctxt, fds, shms) tagp) (S_proc (pi, pctxt', fds', {}) (tagp \<or> tagf))" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
595 |
apply (simp add:update_ss_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
596 |
thm update_ss_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
597 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
598 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
599 |
(* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
600 |
lemma s2d_main_execve: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
601 |
"ss \<in> static \<Longrightarrow> \<exists> s. valid s \<and> s2ss s = ss" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
602 |
apply (erule static.induct) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
603 |
apply (rule_tac x = "[]" in exI, simp add:s2ss_nil_prop valid.intros) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
604 |
apply (erule exE|erule conjE)+ |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
605 |
apply (rule s2d_main_execve, simp+) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
606 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
607 |
apply (erule exE|erule conjE)+ |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
608 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
609 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
610 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
611 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
612 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
613 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
614 |
(*********************** uppest-level 3 theorems ***********************) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
615 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
616 |
lemma enrichability: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
617 |
"\<lbrakk>valid s; \<forall> obj \<in> objs. alive s obj \<and> is_created s obj \<and> recorded obj\<rbrakk> |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
618 |
\<Longrightarrow> enrichable s objs" sorry (* |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
619 |
proof (induct s arbitrary:objs) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
620 |
case Nil |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
621 |
hence "objs = {}" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
622 |
apply (auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
623 |
apply (erule_tac x = x in ballE) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
624 |
apply (case_tac x) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
625 |
apply (auto simp:init_alive_prop) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
626 |
sorry (* done *) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
627 |
thus ?case using Nil unfolding enrichable_def enriched_def reserved_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
628 |
by (rule_tac x = "[]" in exI, auto) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
629 |
next |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
630 |
case (Cons e s) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
631 |
hence p1: "\<And> objs. \<forall> obj \<in> objs. alive s obj \<and> is_created s obj \<and> recorded obj |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
632 |
\<Longrightarrow> \<exists> s'. valid s' \<and> s2ss s' = s2ss s \<and> enriched s objs s' \<and> reserved s objs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
633 |
and p2: "valid (e # s)" and p3: "\<forall>obj\<in>objs. alive (e # s) obj \<and> is_created (e # s) obj \<and> recorded obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
634 |
and os: "os_grant s e" and se: "grant s e" and vd: "valid s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
635 |
by (auto dest:vt_grant_os vd_cons vt_grant simp:enrichable_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
636 |
show ?case |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
637 |
proof (cases e) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
638 |
case (Execve p f fds) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
639 |
hence p4: "e = Execve p f fds" by simp |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
640 |
from p3 have p5: "is_inited s (O_proc p) \<Longrightarrow> (O_proc p) \<notin> objs" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
641 |
by (auto simp:is_created_def is_inited_def p4 elim!:ballE[where x = "O_proc p"]) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
642 |
show "enrichable (e # s) objs" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
643 |
proof (cases "is_inited s (O_proc p)") |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
644 |
case True |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
645 |
with p5 have a1: "(O_proc p) \<notin> objs" by simp |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
646 |
with p3 p4 p2 have a2: "\<forall> obj \<in> objs. alive s obj \<and> is_created s obj" and a2': "\<forall> obj \<in> objs. recorded obj" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
647 |
apply (auto simp:is_created_def alive_simps is_inited_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
648 |
apply (erule_tac x = obj in ballE, auto simp:alive_simps split:t_object.splits) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
649 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
650 |
then obtain s' where a3: "valid s'" and a4: "s2ss s' = s2ss s" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
651 |
and a5: "enriched s objs s'" and a6: "reserved s objs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
652 |
using p1 apply (simp add:enrichable_def) sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
653 |
from a5 p4 p2 a2' have a7: "enriched s objs (e # s')" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
654 |
apply (clarsimp simp add:enriched_def co2sobj_execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
655 |
apply (erule_tac x = obj in ballE, clarsimp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
656 |
apply (rule_tac x = obj' in exI, auto simp:co2sobj_execve alive_simps) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
657 |
thm enriched_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
658 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
659 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
660 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
661 |
obtain s' where p6:"enriched s objs s'" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
662 |
apply (simp add: alive_simps enrichable_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
663 |
apply auto apply (rule ballI, rule_tac x = obj in exI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
664 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
665 |
have p6:"enriched (e # s) objs (e # s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
666 |
apply (simp add:enriched_def alive_simps) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
667 |
apply auto apply (rule ballI, rule_tac x = obj in exI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
668 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
669 |
have "enrich (e # s) objs (e # s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
670 |
apply (simp add:enrich_def p4) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
671 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
672 |
moreover have "reserve (e # s) objs (e # s)" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
673 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
674 |
ultimately show ?thesis using p2 |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
675 |
apply (simp add:enrichable_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
676 |
by (rule_tac x = "e # s" in exI, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
677 |
next |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
678 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
679 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
680 |
thm enrichable_def |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
681 |
apply (simp add:enrichable_def p4) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
682 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
683 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
684 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
685 |
apply auto |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
686 |
apply (auto simp:enrichable_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
687 |
apply (induct s) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
688 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
689 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
690 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
691 |
done |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
692 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
693 |
qed |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
694 |
*) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
695 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
696 |
lemma d2s_main: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
697 |
"valid s \<Longrightarrow> s2ss s \<propto> static" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
698 |
apply (induct s, simp add:s2ss_nil_prop init_ss_in_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
699 |
apply (rule_tac x = "init_static_state" in bexI, simp, simp add:s_init) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
700 |
apply (frule vd_cons, frule vt_grant_os, simp) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
701 |
apply (case_tac a) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
702 |
apply (clarsimp simp add:s2ss_execve) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
703 |
apply (rule conjI, rule impI) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
704 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
705 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
706 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
707 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
708 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
709 |
lemma s2d_main: |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
710 |
"ss \<in> static \<Longrightarrow> \<exists> s. valid s \<and> s2ss s = ss" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
711 |
apply (erule static.induct) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
712 |
apply (rule_tac x = "[]" in exI, simp add:s2ss_nil_prop valid.intros) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
713 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
714 |
apply (erule exE|erule conjE)+ |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
715 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
716 |
apply (simp add:update_ss_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
717 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
718 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
719 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
720 |
lemma s2d_main': |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
721 |
"ss \<in> static \<Longrightarrow> \<exists> s. valid s \<and> s2ss s \<doteq> ss" |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
722 |
apply (erule static.induct) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
723 |
apply (rule_tac x = "[]" in exI, simp add:s2ss_nil_prop valid.intros) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
724 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
725 |
apply (erule exE|erule conjE)+ |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
726 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
727 |
apply (simp add:update_ss_def) |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
728 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
729 |
sorry |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
730 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
731 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
732 |
end |
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
733 |
|
271e9818b6f6
remove shm and linkhard, make a simplified version of selinux
chunhan
parents:
diff
changeset
|
734 |
end |