no_shm_selinux/Dynamic_static.thy
author chunhan
Mon, 30 Dec 2013 23:41:58 +0800
changeset 86 690636b7b6f1
parent 77 6f7b9039715f
permissions -rw-r--r--
find bug: a created proc can be tainted by a message, which cannot remain and maynot be duplicated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
77
chunhan
parents:
diff changeset
     1
theory Dynamic_static
chunhan
parents:
diff changeset
     2
imports Main Flask Static Init_prop Valid_prop Tainted_prop Delete_prop Co2sobj_prop S2ss_prop S2ss_prop2
chunhan
parents:
diff changeset
     3
 Temp Enrich
chunhan
parents:
diff changeset
     4
begin
chunhan
parents:
diff changeset
     5
chunhan
parents:
diff changeset
     6
context tainting_s begin
chunhan
parents:
diff changeset
     7
chunhan
parents:
diff changeset
     8
chunhan
parents:
diff changeset
     9
chunhan
parents:
diff changeset
    10
lemma "alive s obj \<Longrightarrow> alive (enrich_proc s p p') obj"
chunhan
parents:
diff changeset
    11
apply (induct s, simp)
chunhan
parents:
diff changeset
    12
apply (case_tac a, case_tac[!] obj) sorry (*
chunhan
parents:
diff changeset
    13
apply (auto simp:is_file_def is_dir_def split:option.splits t_inode_tag.splits)
chunhan
parents:
diff changeset
    14
thm is_file_other
chunhan
parents:
diff changeset
    15
*)
chunhan
parents:
diff changeset
    16
lemma enrich_proc_valid:
chunhan
parents:
diff changeset
    17
  "\<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')" (* 
chunhan
parents:
diff changeset
    18
apply (induct s, simp)
chunhan
parents:
diff changeset
    19
apply (frule vd_cons, frule vt_grant, frule vt_grant_os, case_tac a)
chunhan
parents:
diff changeset
    20
apply (auto intro!:valid.intros(2))
chunhan
parents:
diff changeset
    21
prefer 28
chunhan
parents:
diff changeset
    22
       
chunhan
parents:
diff changeset
    23
chunhan
parents:
diff changeset
    24
chunhan
parents:
diff changeset
    25
end
chunhan
parents:
diff changeset
    26
*)
chunhan
parents:
diff changeset
    27
sorry
chunhan
parents:
diff changeset
    28
chunhan
parents:
diff changeset
    29
chunhan
parents:
diff changeset
    30
chunhan
parents:
diff changeset
    31
chunhan
parents:
diff changeset
    32
chunhan
parents:
diff changeset
    33
(* for any created obj, we can enrich trace with events that create new objs with the same static-properties *)
chunhan
parents:
diff changeset
    34
definition enriched:: "t_state \<Rightarrow> t_object set \<Rightarrow> t_state \<Rightarrow> bool"
chunhan
parents:
diff changeset
    35
where
chunhan
parents:
diff changeset
    36
  "enriched s objs s' \<equiv> \<forall> obj \<in> objs. \<exists> obj'. \<not> alive s obj' \<and> obj' \<notin> objs \<and>
chunhan
parents:
diff changeset
    37
                                                alive s' obj' \<and> co2sobj s' obj' = co2sobj s' obj"
chunhan
parents:
diff changeset
    38
chunhan
parents:
diff changeset
    39
definition reserved:: "t_state \<Rightarrow> t_object set \<Rightarrow> t_state \<Rightarrow> bool"
chunhan
parents:
diff changeset
    40
where
chunhan
parents:
diff changeset
    41
  "reserved s objs s' \<equiv> \<forall> obj. alive s obj \<longrightarrow> alive s' obj \<and> co2sobj s' obj = co2sobj s obj"
chunhan
parents:
diff changeset
    42
chunhan
parents:
diff changeset
    43
definition enrichable :: "t_state \<Rightarrow> t_object set \<Rightarrow> bool"
chunhan
parents:
diff changeset
    44
where
chunhan
parents:
diff changeset
    45
  "enrichable s objs \<equiv> \<exists> s'. valid s' \<and> s2ss s' = s2ss s \<and> enriched s objs s' \<and> reserved s objs s'"
chunhan
parents:
diff changeset
    46
chunhan
parents:
diff changeset
    47
fun is_created :: "t_state \<Rightarrow> t_object \<Rightarrow> bool"
chunhan
parents:
diff changeset
    48
where
chunhan
parents:
diff changeset
    49
  "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)"
chunhan
parents:
diff changeset
    50
| "is_created s obj        = (init_alive obj \<longrightarrow> deleted obj s)"
chunhan
parents:
diff changeset
    51
chunhan
parents:
diff changeset
    52
definition is_inited :: "t_state \<Rightarrow> t_object \<Rightarrow> bool"
chunhan
parents:
diff changeset
    53
where
chunhan
parents:
diff changeset
    54
  "is_inited s obj \<equiv> init_alive obj \<and> \<not> deleted obj s"
chunhan
parents:
diff changeset
    55
chunhan
parents:
diff changeset
    56
(*
chunhan
parents:
diff changeset
    57
lemma is_inited_eq_not_created:
chunhan
parents:
diff changeset
    58
  "is_inited s obj = (\<not> is_created s obj)"
chunhan
parents:
diff changeset
    59
by (auto simp:is_created_def is_inited_def)
chunhan
parents:
diff changeset
    60
*)
chunhan
parents:
diff changeset
    61
chunhan
parents:
diff changeset
    62
lemma many_sq_imp_sms:
chunhan
parents:
diff changeset
    63
  "\<lbrakk>S_msgq (Create, sec, sms) \<in> ss; ss \<in> static\<rbrakk> \<Longrightarrow> \<forall> sm \<in> (set sms). is_many_smsg sm"
chunhan
parents:
diff changeset
    64
sorry
chunhan
parents:
diff changeset
    65
chunhan
parents:
diff changeset
    66
(* recorded in our static world *)
chunhan
parents:
diff changeset
    67
fun recorded :: "t_object \<Rightarrow> bool"
chunhan
parents:
diff changeset
    68
where
chunhan
parents:
diff changeset
    69
  "recorded (O_proc p)     = True"
chunhan
parents:
diff changeset
    70
| "recorded (O_file f)     = True"
chunhan
parents:
diff changeset
    71
| "recorded (O_dir  f)     = True"
chunhan
parents:
diff changeset
    72
| "recorded (O_node n)     = False" (* cause socket is temperary not considered *)
chunhan
parents:
diff changeset
    73
| "recorded (O_shm  h)     = True"
chunhan
parents:
diff changeset
    74
| "recorded (O_msgq q)     = True"
chunhan
parents:
diff changeset
    75
| "recorded _              = False"
chunhan
parents:
diff changeset
    76
chunhan
parents:
diff changeset
    77
lemma cf2sfile_fi_init_file:
chunhan
parents:
diff changeset
    78
  "\<lbrakk>cf2sfile s f = Some (Init f', sec, psec, asecs); is_file s f; valid s\<rbrakk> 
chunhan
parents:
diff changeset
    79
   \<Longrightarrow> is_init_file f \<and> \<not> deleted (O_file f) s"
chunhan
parents:
diff changeset
    80
apply (simp add:cf2sfile_def sroot_def split:option.splits if_splits)
chunhan
parents:
diff changeset
    81
apply (case_tac f, simp, drule root_is_dir', simp+)
chunhan
parents:
diff changeset
    82
done
chunhan
parents:
diff changeset
    83
chunhan
parents:
diff changeset
    84
lemma root_not_deleted:
chunhan
parents:
diff changeset
    85
  "valid s \<Longrightarrow> \<not> deleted (O_dir []) s"
chunhan
parents:
diff changeset
    86
apply (induct s, simp)
chunhan
parents:
diff changeset
    87
apply (frule vd_cons, frule vt_grant_os, case_tac a)
chunhan
parents:
diff changeset
    88
by auto
chunhan
parents:
diff changeset
    89
chunhan
parents:
diff changeset
    90
lemma cf2sfile_fi_init_dir:
chunhan
parents:
diff changeset
    91
  "\<lbrakk>cf2sfile s f = Some (Init f', sec, psec, asecs); is_dir s f; valid s\<rbrakk> 
chunhan
parents:
diff changeset
    92
   \<Longrightarrow> is_init_dir f \<and> \<not> deleted (O_dir f) s"
chunhan
parents:
diff changeset
    93
apply (simp add:cf2sfile_def sroot_def split:option.splits if_splits)
chunhan
parents:
diff changeset
    94
apply (case_tac f, simp add:root_is_init_dir root_not_deleted, simp)
chunhan
parents:
diff changeset
    95
apply (drule file_dir_conflict, simp+)
chunhan
parents:
diff changeset
    96
done
chunhan
parents:
diff changeset
    97
chunhan
parents:
diff changeset
    98
lemma is_created_imp_many: 
chunhan
parents:
diff changeset
    99
  "\<lbrakk>is_created s obj; co2sobj s obj = Some sobj; alive s obj; valid s\<rbrakk> \<Longrightarrow> is_many sobj"
chunhan
parents:
diff changeset
   100
apply (case_tac obj, auto simp:co2sobj.simps split:option.splits)
chunhan
parents:
diff changeset
   101
apply (case_tac [!] a)
chunhan
parents:
diff changeset
   102
apply (auto simp:cp2sproc_def ch2sshm_def cq2smsgq_def cf2sfiles_def same_inode_files_def
chunhan
parents:
diff changeset
   103
  split:option.splits if_splits)
chunhan
parents:
diff changeset
   104
apply (frule cf2sfile_fi_init_file, simp add:is_file_def, simp)
chunhan
parents:
diff changeset
   105
apply (erule_tac x = f' in allE, simp)
chunhan
parents:
diff changeset
   106
apply (frule cf2sfile_fi_init_dir, simp+)+
chunhan
parents:
diff changeset
   107
done
chunhan
parents:
diff changeset
   108
chunhan
parents:
diff changeset
   109
lemma anotherp_imp_manysp: 
chunhan
parents:
diff changeset
   110
  "\<lbrakk>cp2sproc s p = Some sp; co2sobj s (O_proc p') = co2sobj s (O_proc p); p' \<noteq> p;
chunhan
parents:
diff changeset
   111
    p' \<in> current_procs s; p \<in> current_procs s\<rbrakk> 
chunhan
parents:
diff changeset
   112
   \<Longrightarrow> is_many_sproc sp"
chunhan
parents:
diff changeset
   113
by (case_tac sp, auto simp:cp2sproc_def co2sobj.simps split:option.splits if_splits)
chunhan
parents:
diff changeset
   114
chunhan
parents:
diff changeset
   115
lemma is_file_has_sfs:
chunhan
parents:
diff changeset
   116
  "\<lbrakk>is_file s f; valid s; cf2sfile s f = Some sf\<rbrakk> 
chunhan
parents:
diff changeset
   117
   \<Longrightarrow> \<exists> sfs. co2sobj s (O_file f) = Some (S_file sfs (O_file f \<in> Tainted s)) \<and> sf \<in> sfs"
chunhan
parents:
diff changeset
   118
apply (rule_tac x = "{sf' | f' sf'. cf2sfile s f' = Some sf' \<and> f' \<in> same_inode_files s f}" in exI)
chunhan
parents:
diff changeset
   119
apply (auto simp:co2sobj.simps cf2sfiles_def tainted_eq_Tainted)
chunhan
parents:
diff changeset
   120
apply (rule_tac x = f in exI, simp add:same_inode_files_prop9)
chunhan
parents:
diff changeset
   121
done
chunhan
parents:
diff changeset
   122
chunhan
parents:
diff changeset
   123
declare Product_Type.split_paired_Ex Product_Type.split_paired_All [simp del]
chunhan
parents:
diff changeset
   124
chunhan
parents:
diff changeset
   125
lemma current_proc_in_s2ss:
chunhan
parents:
diff changeset
   126
  "\<lbrakk>cp2sproc s p = Some sp; p \<in> current_procs s; valid s\<rbrakk>
chunhan
parents:
diff changeset
   127
   \<Longrightarrow> S_proc sp (O_proc p \<in> Tainted s) \<in> s2ss s"
chunhan
parents:
diff changeset
   128
apply (simp add:s2ss_def, rule_tac x = "O_proc p" in exI)
chunhan
parents:
diff changeset
   129
apply (auto simp:co2sobj.simps tainted_eq_Tainted)
chunhan
parents:
diff changeset
   130
done
chunhan
parents:
diff changeset
   131
chunhan
parents:
diff changeset
   132
lemma current_file_in_s2ss:
chunhan
parents:
diff changeset
   133
  "\<lbrakk>co2sobj s (O_file f) = Some (S_file sfs tagf); is_file s f; valid s\<rbrakk>
chunhan
parents:
diff changeset
   134
   \<Longrightarrow> S_file sfs tagf \<in> s2ss s"
chunhan
parents:
diff changeset
   135
by (simp add:s2ss_def, rule_tac x = "O_file f" in exI, simp)
chunhan
parents:
diff changeset
   136
chunhan
parents:
diff changeset
   137
declare npctxt_execve.simps grant_execve.simps search_check.simps [simp del]
chunhan
parents:
diff changeset
   138
chunhan
parents:
diff changeset
   139
chunhan
parents:
diff changeset
   140
lemma npctxt_execve_eq_sec:
chunhan
parents:
diff changeset
   141
  "\<lbrakk>sectxt_of_obj (Execve p f fds # s) (O_proc p) = Some sec'; sectxt_of_obj s (O_proc p) = Some sec;
chunhan
parents:
diff changeset
   142
    sectxt_of_obj s (O_file f) = Some fsec; valid (Execve p f fds # s)\<rbrakk>
chunhan
parents:
diff changeset
   143
   \<Longrightarrow> npctxt_execve sec fsec = Some sec'"
chunhan
parents:
diff changeset
   144
by (case_tac sec, case_tac fsec, auto simp:npctxt_execve.simps sectxt_of_obj_simps split:option.splits)
chunhan
parents:
diff changeset
   145
chunhan
parents:
diff changeset
   146
lemma npctxt_execve_eq_cp2sproc:
chunhan
parents:
diff changeset
   147
  "\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s);
chunhan
parents:
diff changeset
   148
    cp2sproc s p = Some (pi, sec, sfds, shms); cf2sfile s f = Some (fi, fsec, psec, asecs)\<rbrakk>
chunhan
parents:
diff changeset
   149
   \<Longrightarrow> npctxt_execve sec fsec = Some sec'"
chunhan
parents:
diff changeset
   150
apply (frule vt_grant_os, frule vd_cons)
chunhan
parents:
diff changeset
   151
apply (rule npctxt_execve_eq_sec, auto simp:cp2sproc_def cf2sfile_def split:option.splits)
chunhan
parents:
diff changeset
   152
apply (case_tac f, auto dest:root_is_dir')
chunhan
parents:
diff changeset
   153
done
chunhan
parents:
diff changeset
   154
chunhan
parents:
diff changeset
   155
lemma seach_check_eq_static:
chunhan
parents:
diff changeset
   156
  "\<lbrakk>cf2sfile s f = Some sf; valid s; is_dir s f \<or> is_file s f\<rbrakk>
chunhan
parents:
diff changeset
   157
   \<Longrightarrow> search_check_s sec sf (is_file s f) = search_check s sec f"
chunhan
parents:
diff changeset
   158
apply (case_tac sf)
chunhan
parents:
diff changeset
   159
apply (induct f)
chunhan
parents:
diff changeset
   160
apply (auto simp:search_check_s_def search_check.simps cf2sfile_def sroot_def 
chunhan
parents:
diff changeset
   161
                 root_sec_remains init_sectxt_prop sec_of_root_valid
chunhan
parents:
diff changeset
   162
           dest!:root_is_dir' current_has_sec' split:option.splits)
chunhan
parents:
diff changeset
   163
done
chunhan
parents:
diff changeset
   164
chunhan
parents:
diff changeset
   165
lemma grant_execve_intro_execve:
chunhan
parents:
diff changeset
   166
  "\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s);
chunhan
parents:
diff changeset
   167
     cp2sproc s p = Some (pi, sec, sfds, shms); cf2sfile s f = Some (fi, fsec, psec, asecs)\<rbrakk>
chunhan
parents:
diff changeset
   168
    \<Longrightarrow> grant_execve sec fsec sec'"
chunhan
parents:
diff changeset
   169
apply (frule vt_grant_os, frule vd_cons, frule vt_grant)
chunhan
parents:
diff changeset
   170
apply (auto split:option.splits dest!:current_has_sec' simp del:grant_execve.simps simp add:cp2sproc_execve)
chunhan
parents:
diff changeset
   171
apply (erule_tac x = aba in allE, erule_tac x = aca in allE, erule_tac x = bb in allE)
chunhan
parents:
diff changeset
   172
apply (auto simp del:grant_execve.simps simp add:cp2sproc_def cf2sfile_def split:option.splits)
chunhan
parents:
diff changeset
   173
apply (case_tac f, simp, drule root_is_dir', simp, simp, simp)
chunhan
parents:
diff changeset
   174
apply (simp add:sectxt_of_obj_simps)
chunhan
parents:
diff changeset
   175
done
chunhan
parents:
diff changeset
   176
chunhan
parents:
diff changeset
   177
lemma search_check_intro_execve:
chunhan
parents:
diff changeset
   178
  "\<lbrakk>cp2sproc s p = Some (pi, sec, sfds, shms); valid (Execve p f fds # s)\<rbrakk>
chunhan
parents:
diff changeset
   179
   \<Longrightarrow> search_check s sec f"
chunhan
parents:
diff changeset
   180
apply (frule vt_grant_os, frule vd_cons, frule vt_grant)
chunhan
parents:
diff changeset
   181
apply (auto split:option.splits dest!:current_has_sec' simp del:grant_execve.simps simp add:cp2sproc_execve)
chunhan
parents:
diff changeset
   182
apply (erule_tac x = aaa in allE, erule_tac x = ab in allE, erule_tac x = ba in allE)
chunhan
parents:
diff changeset
   183
apply (auto simp add:cp2sproc_def cf2sfile_def split:option.splits)
chunhan
parents:
diff changeset
   184
done
chunhan
parents:
diff changeset
   185
chunhan
parents:
diff changeset
   186
lemma inherit_fds_check_intro_execve:
chunhan
parents:
diff changeset
   187
  "\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s)\<rbrakk>
chunhan
parents:
diff changeset
   188
    \<Longrightarrow> inherit_fds_check s sec' p fds"
chunhan
parents:
diff changeset
   189
apply (frule vt_grant_os, frule vd_cons, frule vt_grant)
chunhan
parents:
diff changeset
   190
apply (auto split:option.splits dest!:current_has_sec' simp add:cp2sproc_execve)
chunhan
parents:
diff changeset
   191
apply (erule_tac x = aba in allE, erule_tac x = aca in allE, erule_tac x = bb in allE)
chunhan
parents:
diff changeset
   192
apply (auto simp add:cp2sproc_def cf2sfile_def split:option.splits)
chunhan
parents:
diff changeset
   193
apply (simp add:sectxt_of_obj_simps)
chunhan
parents:
diff changeset
   194
done
chunhan
parents:
diff changeset
   195
chunhan
parents:
diff changeset
   196
lemma execve_sfds_subset: 
chunhan
parents:
diff changeset
   197
  "\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s);
chunhan
parents:
diff changeset
   198
    cp2sproc s p = Some (pi, sec, sfds, shms)\<rbrakk>
chunhan
parents:
diff changeset
   199
   \<Longrightarrow> sfds' \<subseteq> sfds"
chunhan
parents:
diff changeset
   200
apply (frule vt_grant_os)
chunhan
parents:
diff changeset
   201
apply (auto simp:cp2sproc_def cpfd2sfds_execve split:option.splits dest!:current_has_sec')
chunhan
parents:
diff changeset
   202
apply (simp add:cpfd2sfds_def)
chunhan
parents:
diff changeset
   203
apply (rule_tac x = fd in bexI, auto simp:proc_file_fds_def)
chunhan
parents:
diff changeset
   204
done
chunhan
parents:
diff changeset
   205
chunhan
parents:
diff changeset
   206
lemma inherit_fds_check_imp_static:
chunhan
parents:
diff changeset
   207
  "\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms');
chunhan
parents:
diff changeset
   208
    inherit_fds_check s sec' p fds; valid (Execve p f fds # s)\<rbrakk>
chunhan
parents:
diff changeset
   209
   \<Longrightarrow> inherit_fds_check_s sec' sfds'"
chunhan
parents:
diff changeset
   210
apply (frule vt_grant_os, frule vd_cons, frule vt_grant)
chunhan
parents:
diff changeset
   211
apply (auto simp:cp2sproc_def cpfd2sfds_execve inherit_fds_check_def inherit_fds_check_s_def split:option.splits)
chunhan
parents:
diff changeset
   212
sorry (*
chunhan
parents:
diff changeset
   213
apply (erule_tac x = "(ad, ae, bc)" in ballE, auto simp:sectxts_of_sfds_def sectxts_of_fds_def)
chunhan
parents:
diff changeset
   214
apply (erule_tac x = fd in ballE, auto simp:cfd2sfd_def split:option.splits)
chunhan
parents:
diff changeset
   215
done *)
chunhan
parents:
diff changeset
   216
chunhan
parents:
diff changeset
   217
lemma d2s_main_execve_grant_aux:
chunhan
parents:
diff changeset
   218
  "\<lbrakk>cp2sproc (Execve p f fds # s) p = Some (pi', sec', sfds', shms'); valid (Execve p f fds # s);
chunhan
parents:
diff changeset
   219
    cp2sproc s p = Some (pi, sec, sfds, shms); cf2sfile s f = Some (fi, fsec, psec, asecs)\<rbrakk>
chunhan
parents:
diff changeset
   220
   \<Longrightarrow> (npctxt_execve sec fsec = Some sec') \<and> grant_execve sec fsec sec' \<and> 
chunhan
parents:
diff changeset
   221
       search_check_s sec (fi, fsec, psec, asecs) (is_file s f) \<and> 
chunhan
parents:
diff changeset
   222
       inherit_fds_check_s sec' sfds' \<and> sfds' \<subseteq> sfds"
chunhan
parents:
diff changeset
   223
apply (rule conjI, erule_tac pi = pi and sec = sec and sfds = sfds and 
chunhan
parents:
diff changeset
   224
   shms = shms and fi = fi and fsec = fsec and psec = psec and 
chunhan
parents:
diff changeset
   225
   asecs = asecs in npctxt_execve_eq_cp2sproc, simp, simp, simp)
chunhan
parents:
diff changeset
   226
apply (rule conjI, erule_tac pi = pi and sec = sec and sfds = sfds and 
chunhan
parents:
diff changeset
   227
   shms = shms and fi = fi and fsec = fsec and psec = psec and 
chunhan
parents:
diff changeset
   228
   asecs = asecs in grant_execve_intro_execve, simp, simp, simp)
chunhan
parents:
diff changeset
   229
apply (rule conjI, drule_tac sec = sec in search_check_intro_execve, simp)
chunhan
parents:
diff changeset
   230
apply (frule vd_cons, frule vt_grant_os)
chunhan
parents:
diff changeset
   231
apply (drule_tac sec = sec in seach_check_eq_static, simp, simp, simp)
chunhan
parents:
diff changeset
   232
apply (rule conjI, rule inherit_fds_check_imp_static, simp)
chunhan
parents:
diff changeset
   233
apply (erule inherit_fds_check_intro_execve, simp, simp)
chunhan
parents:
diff changeset
   234
apply (erule_tac pi = pi and sfds = sfds and shms = shms in execve_sfds_subset, simp+)
chunhan
parents:
diff changeset
   235
done
chunhan
parents:
diff changeset
   236
chunhan
parents:
diff changeset
   237
lemma d2s_main_execve:
chunhan
parents:
diff changeset
   238
  "\<lbrakk>valid (Execve p f fds # s); s2ss s \<propto> static\<rbrakk> \<Longrightarrow> s2ss (Execve p f fds # s) \<propto> static"
chunhan
parents:
diff changeset
   239
apply (frule vd_cons, frule vt_grant_os, clarsimp)
chunhan
parents:
diff changeset
   240
apply (frule is_file_has_sfile', simp, erule exE, frule is_file_has_sfs, simp+, erule exE, erule conjE)
chunhan
parents:
diff changeset
   241
apply (auto simp:s2ss_execve split:if_splits option.splits dest:current_proc_has_sp')
chunhan
parents:
diff changeset
   242
apply (clarsimp simp add:init_ss_in_def init_ss_eq_def)
chunhan
parents:
diff changeset
   243
apply (rule_tac x = "update_ss ss' (S_proc (ah, (ai, aj, bd), ak, be) (O_proc p \<in> Tainted s))
chunhan
parents:
diff changeset
   244
  (S_proc (ad, (ae, af, bb), ag, bc) (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s))" in bexI)
chunhan
parents:
diff changeset
   245
apply (auto simp:update_ss_def elim:Set.subset_insertI2 simp:anotherp_imp_manysp)[1]
chunhan
parents:
diff changeset
   246
apply (case_tac "ah = ad", case_tac "bc = {}", simp)
chunhan
parents:
diff changeset
   247
apply (erule_tac sfs = sfs and fi = a and fsec = "(aa, ab,b)" and pfsec = ac and asecs = ba in s_execve,
chunhan
parents:
diff changeset
   248
  auto intro:current_proc_in_s2ss current_file_in_s2ss split:option.splits dest:d2s_main_execve_grant_aux)[1]
chunhan
parents:
diff changeset
   249
apply (simp add:cp2sproc_execve split:option.splits)
chunhan
parents:
diff changeset
   250
apply (simp add:cp2sproc_def split:option.splits if_splits)
chunhan
parents:
diff changeset
   251
chunhan
parents:
diff changeset
   252
apply (clarsimp simp add:init_ss_in_def init_ss_eq_def)
chunhan
parents:
diff changeset
   253
apply (rule_tac x = "update_ss ss' (S_proc (ah, (ai, aj, bd), ak, be) (O_proc p \<in> Tainted s))
chunhan
parents:
diff changeset
   254
  (S_proc (ad, (ae, af, bb), ag, bc) (O_proc p \<in> Tainted s \<or> O_file f \<in> Tainted s))" in bexI)
chunhan
parents:
diff changeset
   255
apply (rule conjI, simp add:update_ss_def)
chunhan
parents:
diff changeset
   256
apply (rule conjI, simp add:update_ss_def)
chunhan
parents:
diff changeset
   257
apply (auto)[1]
chunhan
parents:
diff changeset
   258
apply (simp add:update_ss_def)
chunhan
parents:
diff changeset
   259
apply (rule conjI, rule impI)
chunhan
parents:
diff changeset
   260
apply (rule subsetI, clarsimp)
chunhan
parents:
diff changeset
   261
apply (erule impE)
chunhan
parents:
diff changeset
   262
apply (erule set_mp, simp)
chunhan
parents:
diff changeset
   263
apply (case_tac ah, simp+)
chunhan
parents:
diff changeset
   264
apply (rule impI, rule subsetI, clarsimp)
chunhan
parents:
diff changeset
   265
apply (erule set_mp, simp)
chunhan
parents:
diff changeset
   266
chunhan
parents:
diff changeset
   267
apply (case_tac "ah = ad", case_tac "bc = {}", simp)
chunhan
parents:
diff changeset
   268
apply (erule_tac sfs = sfs and fi = a and fsec = "(aa, ab,b)" and pfsec = ac and asecs = ba in s_execve,
chunhan
parents:
diff changeset
   269
  auto intro:current_proc_in_s2ss current_file_in_s2ss split:option.splits dest:d2s_main_execve_grant_aux)[1]
chunhan
parents:
diff changeset
   270
apply (simp add:cp2sproc_execve split:option.splits)
chunhan
parents:
diff changeset
   271
apply (simp add:cp2sproc_def split:option.splits if_splits)
chunhan
parents:
diff changeset
   272
done
chunhan
parents:
diff changeset
   273
chunhan
parents:
diff changeset
   274
lemma co2sobj_eq_alive_proc_imp:
chunhan
parents:
diff changeset
   275
  "\<lbrakk>co2sobj s obj = co2sobj s (O_proc p); alive s (O_proc p); valid s\<rbrakk>
chunhan
parents:
diff changeset
   276
   \<Longrightarrow> \<exists> p'. obj = O_proc p'"
chunhan
parents:
diff changeset
   277
by (auto simp add:co2sobj.simps split:option.splits dest:current_proc_has_sp' intro:co2sobj_sproc_imp)
chunhan
parents:
diff changeset
   278
chunhan
parents:
diff changeset
   279
chunhan
parents:
diff changeset
   280
lemma enrichable_execve:
chunhan
parents:
diff changeset
   281
 assumes p1: "\<And> objs. \<forall> obj \<in> objs. alive s obj \<and> is_created s obj \<and> recorded obj
chunhan
parents:
diff changeset
   282
              \<Longrightarrow> \<exists> s'. valid s' \<and> s2ss s' = s2ss s \<and> enriched s objs s' \<and> reserved s objs s'"
chunhan
parents:
diff changeset
   283
  and p2: "valid (e # s)" and p3: "\<forall>obj\<in>objs. alive (e # s) obj \<and> is_created (e # s) obj \<and> recorded obj"
chunhan
parents:
diff changeset
   284
  and p4: "e = Execve p f fds" 
chunhan
parents:
diff changeset
   285
  shows "enrichable (e # s) objs"
chunhan
parents:
diff changeset
   286
proof-
chunhan
parents:
diff changeset
   287
  from p2 have os: "os_grant s e" and se: "grant s e" and vd: "valid s"
chunhan
parents:
diff changeset
   288
    by (auto dest:vt_grant_os vd_cons vt_grant)
chunhan
parents:
diff changeset
   289
  from p3 have recorded: "\<forall> obj \<in> objs. recorded obj" by auto
chunhan
parents:
diff changeset
   290
  from p3 p4 p2 have p1': "\<forall> obj \<in> objs. alive s obj \<and> is_created s obj"
chunhan
parents:
diff changeset
   291
    apply clarify
chunhan
parents:
diff changeset
   292
    apply (erule_tac x = obj in ballE, simp add:alive_simps)
chunhan
parents:
diff changeset
   293
    apply (case_tac obj, auto simp:same_inode_files_simps)
chunhan
parents:
diff changeset
   294
    done
chunhan
parents:
diff changeset
   295
  then obtain s' where a1: "valid s'" and a2: "s2ss s' = s2ss s" and a3: "enriched s objs s'"
chunhan
parents:
diff changeset
   296
    and a4: "reserved s objs s'"
chunhan
parents:
diff changeset
   297
    using p1 recorded by metis 
chunhan
parents:
diff changeset
   298
  show ?thesis
chunhan
parents:
diff changeset
   299
  proof (cases "O_proc p \<in> objs")
chunhan
parents:
diff changeset
   300
    case True
chunhan
parents:
diff changeset
   301
    hence p_in: "p \<in> current_procs s'" using a4 os p4
chunhan
parents:
diff changeset
   302
      by (auto simp:reserved_def elim:allE[where x = "O_proc p"])
chunhan
parents:
diff changeset
   303
    with a1 a3 True obtain p' where b1: "\<not> alive s (O_proc p')" and b2: "O_proc p' \<notin> objs" 
chunhan
parents:
diff changeset
   304
      and b3: "alive s' (O_proc p')" and b4: "co2sobj s' (O_proc p') = co2sobj s' (O_proc p)"
chunhan
parents:
diff changeset
   305
      apply (simp only:enriched_def)
chunhan
parents:
diff changeset
   306
      apply (erule_tac x = "O_proc p" in ballE)
chunhan
parents:
diff changeset
   307
      apply (erule exE|erule conjE)+
chunhan
parents:
diff changeset
   308
      apply (frule co2sobj_eq_alive_proc_imp, auto)
chunhan
parents:
diff changeset
   309
      done
chunhan
parents:
diff changeset
   310
    have "valid (Execve p' f fds # e # s')"
chunhan
parents:
diff changeset
   311
      sorry
chunhan
parents:
diff changeset
   312
    moreover have "s2ss (Execve p' f fds # e # s') = s2ss (e # s)"
chunhan
parents:
diff changeset
   313
      sorry
chunhan
parents:
diff changeset
   314
    moreover have "enriched (e # s) objs (Execve p' f fds # e # s')"
chunhan
parents:
diff changeset
   315
      sorry
chunhan
parents:
diff changeset
   316
    moreover have "reserved (e # s) objs (Execve p' f fds # e # s')"
chunhan
parents:
diff changeset
   317
      sorry
chunhan
parents:
diff changeset
   318
    ultimately show ?thesis
chunhan
parents:
diff changeset
   319
      apply (simp add:enrichable_def)
chunhan
parents:
diff changeset
   320
      apply (rule_tac x = "Execve p' f fds # e # s'" in exI)
chunhan
parents:
diff changeset
   321
      by auto
chunhan
parents:
diff changeset
   322
  next
chunhan
parents:
diff changeset
   323
    case False
chunhan
parents:
diff changeset
   324
    from a4 os p4 have "p \<in> current_procs s'"
chunhan
parents:
diff changeset
   325
      apply (simp add:reserved_def)
chunhan
parents:
diff changeset
   326
      by (erule_tac x = "O_proc p" in allE, auto)      
chunhan
parents:
diff changeset
   327
    moreover from a4 os p4 have "is_file s' f"
chunhan
parents:
diff changeset
   328
      apply (simp add:reserved_def)
chunhan
parents:
diff changeset
   329
      by (erule_tac x = "O_file f" in allE, auto)
chunhan
parents:
diff changeset
   330
    moreover from a4 os p4 vd have "fds \<subseteq> proc_file_fds s' p"
chunhan
parents:
diff changeset
   331
      apply (rule_tac subsetI, clarsimp simp:reserved_def current_proc_fds.simps)
chunhan
parents:
diff changeset
   332
      apply (erule_tac x = "O_fd p x" in allE, erule impE)
chunhan
parents:
diff changeset
   333
      sorry
chunhan
parents:
diff changeset
   334
    ultimately have "os_grant s' e" 
chunhan
parents:
diff changeset
   335
      by (simp add:p4)
chunhan
parents:
diff changeset
   336
    moreover have "grant s' e"
chunhan
parents:
diff changeset
   337
      sorry
chunhan
parents:
diff changeset
   338
    ultimately have "valid (e # s')"
chunhan
parents:
diff changeset
   339
      using a1 by (erule_tac valid.intros(2), simp+)
chunhan
parents:
diff changeset
   340
    thus ?thesis
chunhan
parents:
diff changeset
   341
      apply (simp add:enrichable_def)
chunhan
parents:
diff changeset
   342
      apply (rule_tac x = "e # s'" in exI)
chunhan
parents:
diff changeset
   343
      apply (simp)
chunhan
parents:
diff changeset
   344
    sorry
chunhan
parents:
diff changeset
   345
qed
chunhan
parents:
diff changeset
   346
qed
chunhan
parents:
diff changeset
   347
chunhan
parents:
diff changeset
   348
lemma s2d_main_execve:
chunhan
parents:
diff changeset
   349
  "\<lbrakk>grant_execve pctxt fsec pctxt'; ss \<in> static; S_proc (pi, pctxt, fds, shms) tagp \<in> ss; S_file sfs tagf \<in> ss;
chunhan
parents:
diff changeset
   350
     (fi, fsec, pfsec, asecs) \<in> sfs; npctxt_execve pctxt fsec = Some pctxt'; 
chunhan
parents:
diff changeset
   351
    search_check_s pctxt (fi, fsec, pfsec, asecs) True; inherit_fds_check_s pctxt' fds'; fds' \<subseteq> fds; valid s;
chunhan
parents:
diff changeset
   352
    s2ss s = ss\<rbrakk> \<Longrightarrow> \<exists>s. valid s \<and> 
chunhan
parents:
diff changeset
   353
    s2ss s = update_ss ss (S_proc (pi, pctxt, fds, shms) tagp) (S_proc (pi, pctxt', fds', {}) (tagp \<or> tagf))"
chunhan
parents:
diff changeset
   354
apply (simp add:update_ss_def)
chunhan
parents:
diff changeset
   355
thm update_ss_def
chunhan
parents:
diff changeset
   356
sorry
chunhan
parents:
diff changeset
   357
chunhan
parents:
diff changeset
   358
(*
chunhan
parents:
diff changeset
   359
lemma s2d_main_execve:
chunhan
parents:
diff changeset
   360
  "ss \<in> static \<Longrightarrow> \<exists> s. valid s \<and> s2ss s = ss"
chunhan
parents:
diff changeset
   361
apply (erule static.induct)
chunhan
parents:
diff changeset
   362
apply (rule_tac x = "[]" in exI, simp add:s2ss_nil_prop valid.intros)
chunhan
parents:
diff changeset
   363
apply (erule exE|erule conjE)+
chunhan
parents:
diff changeset
   364
apply (rule s2d_main_execve, simp+)
chunhan
parents:
diff changeset
   365
chunhan
parents:
diff changeset
   366
apply (erule exE|erule conjE)+
chunhan
parents:
diff changeset
   367
chunhan
parents:
diff changeset
   368
chunhan
parents:
diff changeset
   369
sorry
chunhan
parents:
diff changeset
   370
*)
chunhan
parents:
diff changeset
   371
chunhan
parents:
diff changeset
   372
chunhan
parents:
diff changeset
   373
(*********************** uppest-level 3 theorems ***********************)
chunhan
parents:
diff changeset
   374
chunhan
parents:
diff changeset
   375
lemma enrichability: 
chunhan
parents:
diff changeset
   376
  "\<lbrakk>valid s; \<forall> obj \<in> objs. alive s obj \<and> is_created s obj \<and> recorded obj\<rbrakk>
chunhan
parents:
diff changeset
   377
   \<Longrightarrow> enrichable s objs" sorry (* 
chunhan
parents:
diff changeset
   378
proof (induct s arbitrary:objs)
chunhan
parents:
diff changeset
   379
  case Nil
chunhan
parents:
diff changeset
   380
  hence "objs = {}" 
chunhan
parents:
diff changeset
   381
    apply (auto)
chunhan
parents:
diff changeset
   382
    apply (erule_tac x = x in ballE)
chunhan
parents:
diff changeset
   383
    apply (case_tac x)
chunhan
parents:
diff changeset
   384
    apply (auto simp:init_alive_prop)
chunhan
parents:
diff changeset
   385
    sorry (*     done *)
chunhan
parents:
diff changeset
   386
  thus ?case using Nil unfolding enrichable_def enriched_def reserved_def
chunhan
parents:
diff changeset
   387
    by (rule_tac x = "[]" in exI, auto)
chunhan
parents:
diff changeset
   388
next
chunhan
parents:
diff changeset
   389
  case (Cons e s)
chunhan
parents:
diff changeset
   390
  hence p1: "\<And> objs. \<forall> obj \<in> objs. alive s obj \<and> is_created s obj \<and> recorded obj
chunhan
parents:
diff changeset
   391
             \<Longrightarrow> \<exists> s'. valid s' \<and> s2ss s' = s2ss s \<and> enriched s objs s' \<and> reserved s objs s'"
chunhan
parents:
diff changeset
   392
    and p2: "valid (e # s)" and p3: "\<forall>obj\<in>objs. alive (e # s) obj \<and> is_created (e # s) obj \<and> recorded obj"
chunhan
parents:
diff changeset
   393
    and os: "os_grant s e" and se: "grant s e" and vd: "valid s"
chunhan
parents:
diff changeset
   394
    by (auto dest:vt_grant_os vd_cons vt_grant simp:enrichable_def)
chunhan
parents:
diff changeset
   395
  show ?case 
chunhan
parents:
diff changeset
   396
  proof (cases e)
chunhan
parents:
diff changeset
   397
    case (Execve p f fds) 
chunhan
parents:
diff changeset
   398
    hence p4: "e = Execve p f fds" by simp
chunhan
parents:
diff changeset
   399
    from p3 have p5: "is_inited s (O_proc p) \<Longrightarrow> (O_proc p) \<notin> objs" 
chunhan
parents:
diff changeset
   400
      by (auto simp:is_created_def is_inited_def p4 elim!:ballE[where x = "O_proc p"])
chunhan
parents:
diff changeset
   401
    show "enrichable (e # s) objs"
chunhan
parents:
diff changeset
   402
    proof (cases "is_inited s (O_proc p)")
chunhan
parents:
diff changeset
   403
      case True
chunhan
parents:
diff changeset
   404
      with p5 have a1: "(O_proc p) \<notin> objs" by simp
chunhan
parents:
diff changeset
   405
      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"
chunhan
parents:
diff changeset
   406
        apply (auto simp:is_created_def alive_simps is_inited_def)
chunhan
parents:
diff changeset
   407
        apply (erule_tac x = obj in ballE, auto simp:alive_simps split:t_object.splits)
chunhan
parents:
diff changeset
   408
        done
chunhan
parents:
diff changeset
   409
      then obtain s' where a3: "valid s'" and a4: "s2ss s' = s2ss s"
chunhan
parents:
diff changeset
   410
        and a5: "enriched s objs s'" and a6: "reserved s objs s'"
chunhan
parents:
diff changeset
   411
        using p1 apply (simp add:enrichable_def) sorry
chunhan
parents:
diff changeset
   412
      from a5 p4 p2 a2' have a7: "enriched s objs (e # s')"
chunhan
parents:
diff changeset
   413
        apply (clarsimp simp add:enriched_def co2sobj_execve)
chunhan
parents:
diff changeset
   414
        apply (erule_tac x = obj in ballE, clarsimp)
chunhan
parents:
diff changeset
   415
        apply (rule_tac x = obj' in exI, auto simp:co2sobj_execve alive_simps)
chunhan
parents:
diff changeset
   416
        thm enriched_def
chunhan
parents:
diff changeset
   417
chunhan
parents:
diff changeset
   418
chunhan
parents:
diff changeset
   419
chunhan
parents:
diff changeset
   420
obtain s' where p6:"enriched s objs s'"
chunhan
parents:
diff changeset
   421
        apply (simp add: alive_simps enrichable_def)       
chunhan
parents:
diff changeset
   422
        apply auto apply (rule ballI, rule_tac x = obj in exI)
chunhan
parents:
diff changeset
   423
chunhan
parents:
diff changeset
   424
        have p6:"enriched (e # s) objs (e # s)"
chunhan
parents:
diff changeset
   425
        apply (simp add:enriched_def alive_simps)       
chunhan
parents:
diff changeset
   426
        apply auto apply (rule ballI, rule_tac x = obj in exI)
chunhan
parents:
diff changeset
   427
chunhan
parents:
diff changeset
   428
      have "enrich (e # s) objs (e # s)"
chunhan
parents:
diff changeset
   429
        apply (simp add:enrich_def p4)
chunhan
parents:
diff changeset
   430
        sorry
chunhan
parents:
diff changeset
   431
      moreover have "reserve (e # s) objs (e # s)"
chunhan
parents:
diff changeset
   432
        sorry
chunhan
parents:
diff changeset
   433
      ultimately show ?thesis using p2
chunhan
parents:
diff changeset
   434
        apply (simp add:enrichable_def)
chunhan
parents:
diff changeset
   435
        by (rule_tac x = "e # s" in exI, simp)
chunhan
parents:
diff changeset
   436
    next
chunhan
parents:
diff changeset
   437
        
chunhan
parents:
diff changeset
   438
      
chunhan
parents:
diff changeset
   439
thm enrichable_def
chunhan
parents:
diff changeset
   440
      apply (simp add:enrichable_def p4)
chunhan
parents:
diff changeset
   441
chunhan
parents:
diff changeset
   442
      
chunhan
parents:
diff changeset
   443
  
chunhan
parents:
diff changeset
   444
    apply auto
chunhan
parents:
diff changeset
   445
    apply (auto simp:enrichable_def)
chunhan
parents:
diff changeset
   446
apply (induct s)
chunhan
parents:
diff changeset
   447
chunhan
parents:
diff changeset
   448
chunhan
parents:
diff changeset
   449
chunhan
parents:
diff changeset
   450
done
chunhan
parents:
diff changeset
   451
chunhan
parents:
diff changeset
   452
qed 
chunhan
parents:
diff changeset
   453
*)
chunhan
parents:
diff changeset
   454
chunhan
parents:
diff changeset
   455
lemma d2s_main:
chunhan
parents:
diff changeset
   456
  "valid s \<Longrightarrow> s2ss s \<propto> static"
chunhan
parents:
diff changeset
   457
apply (induct s, simp add:s2ss_nil_prop init_ss_in_def)
chunhan
parents:
diff changeset
   458
apply (rule_tac x = "init_static_state" in bexI, simp, simp add:s_init)
chunhan
parents:
diff changeset
   459
apply (frule vd_cons, frule vt_grant_os, simp)
chunhan
parents:
diff changeset
   460
apply (case_tac a) 
chunhan
parents:
diff changeset
   461
apply (clarsimp simp add:s2ss_execve)
chunhan
parents:
diff changeset
   462
apply (rule conjI, rule impI)
chunhan
parents:
diff changeset
   463
chunhan
parents:
diff changeset
   464
chunhan
parents:
diff changeset
   465
chunhan
parents:
diff changeset
   466
sorry
chunhan
parents:
diff changeset
   467
chunhan
parents:
diff changeset
   468
lemma s2d_main:
chunhan
parents:
diff changeset
   469
  "ss \<in> static \<Longrightarrow> \<exists> s. valid s \<and> s2ss s = ss"
chunhan
parents:
diff changeset
   470
apply (erule static.induct)
chunhan
parents:
diff changeset
   471
apply (rule_tac x = "[]" in exI, simp add:s2ss_nil_prop valid.intros)
chunhan
parents:
diff changeset
   472
chunhan
parents:
diff changeset
   473
apply (erule exE|erule conjE)+
chunhan
parents:
diff changeset
   474
chunhan
parents:
diff changeset
   475
apply (simp add:update_ss_def)
chunhan
parents:
diff changeset
   476
chunhan
parents:
diff changeset
   477
sorry
chunhan
parents:
diff changeset
   478
chunhan
parents:
diff changeset
   479
lemma deleted_imp_deleted_s:
chunhan
parents:
diff changeset
   480
  "\<lbrakk>deleted obj s; valid s\<rbrakk> \<Longrightarrow> \<exists> ss \<in> static. deleted_s ss obj "
chunhan
parents:
diff changeset
   481
sorry
chunhan
parents:
diff changeset
   482
chunhan
parents:
diff changeset
   483
lemma deleted_s_imp_deleted:
chunhan
parents:
diff changeset
   484
  "\<lbrakk>deleted_s ss obj; ss \<in> static\<rbrakk> \<Longrightarrow> \<exists> s. valid s \<and> deleted obj s"
chunhan
parents:
diff changeset
   485
sorry
chunhan
parents:
diff changeset
   486
chunhan
parents:
diff changeset
   487
lemma updeletable_s_sound_comp:
chunhan
parents:
diff changeset
   488
  "undeletable_s obj = undeletable obj"
chunhan
parents:
diff changeset
   489
apply (simp add:undeletable_def undeletable_s_def)
chunhan
parents:
diff changeset
   490
apply (auto dest:deleted_imp_deleted_s deleted_s_imp_deleted)
chunhan
parents:
diff changeset
   491
done
chunhan
parents:
diff changeset
   492
chunhan
parents:
diff changeset
   493
chunhan
parents:
diff changeset
   494
chunhan
parents:
diff changeset
   495
end
chunhan
parents:
diff changeset
   496
chunhan
parents:
diff changeset
   497
end
chunhan
parents:
diff changeset
   498
chunhan
parents:
diff changeset
   499
(* 
chunhan
parents:
diff changeset
   500
lemma s2d_main':
chunhan
parents:
diff changeset
   501
  "ss \<in> static \<Longrightarrow> \<exists> s. valid s \<and> s2ss s \<doteq> ss"
chunhan
parents:
diff changeset
   502
apply (erule static.induct)
chunhan
parents:
diff changeset
   503
apply (rule_tac x = "[]" in exI, simp add:s2ss_nil_prop valid.intros)
chunhan
parents:
diff changeset
   504
chunhan
parents:
diff changeset
   505
apply (erule exE|erule conjE)+
chunhan
parents:
diff changeset
   506
chunhan
parents:
diff changeset
   507
apply (simp add:update_ss_def)
chunhan
parents:
diff changeset
   508
chunhan
parents:
diff changeset
   509
sorry
chunhan
parents:
diff changeset
   510
chunhan
parents:
diff changeset
   511
*)