Current_prop.thy
author chunhan
Tue, 09 Jul 2013 14:43:51 +0800
changeset 27 fc749f19b894
parent 26 b6333712cb02
child 28 e298d755bc35
permissions -rw-r--r--
Info_flow_shm_attach_prop
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
     1
(*<*)
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     2
theory Current_prop
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     3
imports Main Flask_type Flask My_list_prefix Init_prop Valid_prop Delete_prop
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     4
begin
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
     5
(*>*)
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     6
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     7
context flask begin
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     8
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     9
lemma procs_of_shm_prop1: "\<lbrakk> p_flag \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> h \<in> current_shms s"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    10
apply (induct s arbitrary:p_flag)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    11
apply (case_tac p_flag, simp, drule init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    12
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    13
apply (case_tac a, auto split:if_splits option.splits)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    14
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    15
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    16
lemma procs_of_shm_prop2: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> p \<in> current_procs s"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    17
apply (induct s arbitrary:p flag)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    18
apply (simp, drule init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    19
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    20
apply (case_tac a, auto split:if_splits option.splits)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    21
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    22
26
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
    23
lemma procs_of_shm_prop2':
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
    24
  "\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> \<forall> flag h. (p, flag) \<notin> procs_of_shm s h"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
    25
by (auto dest:procs_of_shm_prop2)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
    26
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    27
lemma procs_of_shm_prop3: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; (p, flag') \<in> procs_of_shm s h; valid s\<rbrakk>
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    28
  \<Longrightarrow> flag = flag'"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    29
apply (induct s arbitrary:p flag flag')
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    30
apply (simp, drule_tac flag = flag in init_procs_has_shm, drule_tac flag = flag' in init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    31
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    32
apply (case_tac a, auto split:if_splits option.splits dest:procs_of_shm_prop2)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    33
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    34
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    35
lemma procs_of_shm_prop4: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> flag_of_proc_shm s p h = Some flag"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    36
apply (induct s arbitrary:p flag)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    37
apply (simp, drule init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    38
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    39
apply (case_tac a, auto split:if_splits option.splits dest:procs_of_shm_prop2)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    40
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    41
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    42
lemma procs_of_shm_prop4':
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    43
  "\<lbrakk>flag_of_proc_shm s p h = None; valid s\<rbrakk> \<Longrightarrow> \<forall> flag. (p, flag) \<notin> procs_of_shm s h"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    44
by (auto dest:procs_of_shm_prop4)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    45
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    46
lemma not_init_intro_proc:
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    47
  "\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> deleted (O_proc p) s \<or> p \<notin> init_procs"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    48
using not_deleted_init_proc by auto
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    49
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    50
lemma not_init_intro_proc':
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    51
  "\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> \<not> (\<not> deleted (O_proc p) s \<and> p \<in> init_procs)"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    52
using not_deleted_init_proc by auto
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    53
23
25e55731ed01 locale of tainting for seeds when same shm/inode bugs
chunhan
parents: 19
diff changeset
    54
lemma info_shm_flow_in_procs:
25e55731ed01 locale of tainting for seeds when same shm/inode bugs
chunhan
parents: 19
diff changeset
    55
  "\<lbrakk>info_flow_shm s p p'; valid s\<rbrakk> \<Longrightarrow> p \<in> current_procs s \<and> p' \<in> current_procs s"
26
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
    56
by (auto intro:procs_of_shm_prop2 simp:info_flow_shm_def one_flow_shm_def)
25
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
    57
27
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    58
lemma flag_of_proc_shm_prop1:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    59
  "\<lbrakk>flag_of_proc_shm s p h = Some flag; valid s\<rbrakk> \<Longrightarrow> (p, flag) \<in> procs_of_shm s h"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    60
apply (induct s arbitrary:p flag)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    61
apply (simp, drule init_shmflag_has_proc, simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    62
apply (frule vd_cons, frule vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    63
apply (case_tac a, auto split:if_splits option.splits dest:procs_of_shm_prop2)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    64
done
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    65
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    66
(*********** simpset for one_flow_shm **************)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    67
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    68
lemma one_flow_not_self:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    69
  "one_flow_shm s h p p \<Longrightarrow> False"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    70
by (simp add:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    71
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    72
lemma one_flow_shm_attach:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    73
  "valid (Attach p h flag # s) \<Longrightarrow> one_flow_shm (Attach p h flag # s) = (\<lambda> h' pa pb. 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    74
     if (h' = h) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    75
     then (pa = p \<and> pb \<noteq> p \<and> flag = SHM_RDWR \<and> (\<exists> flagb. (pb, flagb) \<in> procs_of_shm s h)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    76
          (pb = p \<and> pa \<noteq> p \<and> (pa, SHM_RDWR) \<in> procs_of_shm s h) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    77
          (one_flow_shm s h pa pb)               
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    78
     else one_flow_shm s h' pa pb        )"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    79
apply (rule ext, rule ext, rule ext, frule vd_cons, frule vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    80
by (auto simp add: one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    81
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    82
lemma one_flow_shm_detach:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    83
  "valid (Detach p h # s) \<Longrightarrow> one_flow_shm (Detach p h # s) = (\<lambda> h' pa pb.
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    84
     if (h' = h) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    85
     then (pa \<noteq> p \<and> pb \<noteq> p \<and> one_flow_shm s h' pa pb)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    86
     else one_flow_shm s h' pa pb)"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    87
apply (rule ext, rule ext, rule ext, frule vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    88
by (auto simp:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    89
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    90
lemma one_flow_shm_deleteshm:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    91
  "valid (DeleteShM p h # s) \<Longrightarrow> one_flow_shm (DeleteShM p h # s) = (\<lambda> h' pa pb. 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    92
     if (h' = h) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    93
     then False
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    94
     else one_flow_shm s h' pa pb)"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    95
apply (rule ext, rule ext, rule ext, frule vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    96
by (auto simp: one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    97
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    98
lemma one_flow_shm_clone:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
    99
  "valid (Clone p p' fds shms # s) \<Longrightarrow> one_flow_shm (Clone p p' fds shms # s) = (\<lambda> h pa pb. 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   100
     if (pa = p' \<and> pb \<noteq> p' \<and> h \<in> shms)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   101
     then (if (pb = p) then (flag_of_proc_shm s p h = Some SHM_RDWR) else one_flow_shm s h p pb)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   102
     else if (pb = p' \<and> pa \<noteq> p' \<and> h \<in> shms)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   103
          then (if (pa = p) then (flag_of_proc_shm s p h = Some SHM_RDWR) else one_flow_shm s h pa p)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   104
          else one_flow_shm s h pa pb)"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   105
apply (rule ext, rule ext, rule ext, frule vt_grant_os, frule vd_cons, clarsimp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   106
apply (frule_tac p = p' in procs_of_shm_prop2', simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   107
apply (auto simp:one_flow_shm_def intro:procs_of_shm_prop4 flag_of_proc_shm_prop1)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   108
done
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   109
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   110
lemma one_flow_shm_execve:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   111
  "valid (Execve p f fds # s) \<Longrightarrow> one_flow_shm (Execve p f fds # s) = (\<lambda> h pa pb. 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   112
     pa \<noteq> p \<and> pb \<noteq> p \<and> one_flow_shm s h pa pb    )"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   113
apply (rule ext, rule ext, rule ext, frule vt_grant_os, frule vd_cons)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   114
by (auto simp:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   115
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   116
lemma one_flow_shm_kill:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   117
  "valid (Kill p p' # s) \<Longrightarrow> one_flow_shm (Kill p p' # s) = (\<lambda> h pa pb. 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   118
     pa \<noteq> p' \<and> pb \<noteq> p' \<and> one_flow_shm s h pa pb                 )"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   119
apply (rule ext, rule ext, rule ext, frule vt_grant_os, frule vd_cons)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   120
by (auto simp:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   121
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   122
lemma one_flow_shm_exit:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   123
  "valid (Exit p # s) \<Longrightarrow> one_flow_shm (Exit p # s) = (\<lambda> h pa pb. 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   124
     pa \<noteq> p \<and> pb \<noteq> p \<and> one_flow_shm s h pa pb                          )"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   125
apply (rule ext, rule ext, rule ext, frule vt_grant_os, frule vd_cons)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   126
by (auto simp:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   127
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   128
lemma one_flow_shm_other:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   129
  "\<lbrakk>valid (e # s); 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   130
    \<forall> p h flag. e \<noteq> Attach p h flag;
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   131
    \<forall> p h. e \<noteq> Detach p h;
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   132
    \<forall> p h. e \<noteq> DeleteShM p h;
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   133
    \<forall> p p' fds shms. e \<noteq> Clone p p' fds shms;
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   134
    \<forall> p f fds. e \<noteq> Execve p f fds;
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   135
    \<forall> p p'. e \<noteq> Kill p p';
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   136
    \<forall> p. e \<noteq> Exit p
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   137
   \<rbrakk> \<Longrightarrow> one_flow_shm (e # s) = one_flow_shm s"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   138
apply (rule ext, rule ext, rule ext, frule vt_grant_os, frule vd_cons)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   139
apply (case_tac e, auto simp:one_flow_shm_def dest:procs_of_shm_prop2)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   140
apply (drule procs_of_shm_prop1, auto)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   141
done
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   142
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   143
lemmas one_flow_shm_simps = one_flow_shm_other one_flow_shm_attach one_flow_shm_detach one_flow_shm_deleteshm
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   144
  one_flow_shm_clone one_flow_shm_execve one_flow_shm_kill one_flow_shm_exit
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   145
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   146
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   147
inductive Info_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   148
where
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   149
  ifs_self: "p \<in> current_procs s \<Longrightarrow> Info_flow_shm s p p"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   150
| ifs_flow:"\<lbrakk>Info_flow_shm s p p'; one_flow_shm s h p' p''\<rbrakk> \<Longrightarrow> Info_flow_shm s p p''"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   151
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   152
lemma Info_flow_trans_aux:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   153
  "Info_flow_shm s p' p'' \<Longrightarrow> \<forall>p. Info_flow_shm s p p' \<longrightarrow> Info_flow_shm s p p''"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   154
apply (erule Info_flow_shm.induct)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   155
by (auto intro:Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   156
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   157
lemma Info_flow_trans:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   158
  "\<lbrakk>Info_flow_shm s p p'; Info_flow_shm s p' p''\<rbrakk> \<Longrightarrow> Info_flow_shm s p p''"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   159
by (auto dest:Info_flow_trans_aux)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   160
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   161
lemma one_flow_flows:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   162
  "\<lbrakk>one_flow_shm s h p p'; valid s\<rbrakk> \<Longrightarrow> Info_flow_shm s p p'"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   163
apply (rule Info_flow_shm.intros(2), simp_all)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   164
apply (rule Info_flow_shm.intros(1))
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   165
apply (auto intro:procs_of_shm_prop2 simp:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   166
done
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   167
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   168
lemma ifs_flow': "\<lbrakk>one_flow_shm s h p p'; Info_flow_shm s p' p''; valid s\<rbrakk> \<Longrightarrow> Info_flow_shm s p p''"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   169
apply (drule one_flow_flows, simp+)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   170
apply (erule Info_flow_trans, simp+)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   171
done
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   172
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   173
lemma Info_flow_shm_cases1:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   174
  "\<lbrakk>Info_flow_shm s pa pb; 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   175
    \<And>p \<tau>. \<lbrakk>\<tau> = s; pa = p; pb = p; p \<in> current_procs \<tau>\<rbrakk> \<Longrightarrow> P;
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   176
    \<And>\<tau> p p' h p''. \<lbrakk>\<tau> = s; pa = p; pb = p''; Info_flow_shm \<tau> p p'; one_flow_shm \<tau> h p' p''\<rbrakk> \<Longrightarrow> P\<rbrakk>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   177
   \<Longrightarrow> P"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   178
by (erule Info_flow_shm.cases, auto)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   179
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   180
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   181
lemma Info_flow_shm_prop1:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   182
  "\<not> Info_flow_shm s p p \<Longrightarrow> p \<notin> current_procs s" 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   183
by (rule notI, drule Info_flow_shm.intros(1), simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   184
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   185
lemma Info_flow_shm_intro4:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   186
  "\<lbrakk>(p, flagb) \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> Info_flow_shm s p p"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   187
by (drule procs_of_shm_prop2, simp, simp add:Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   188
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   189
(********* simpset for inductive Info_flow_shm **********)
25
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   190
27
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   191
lemma Info_flow_shm_attach1:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   192
  "Info_flow_shm s' pa pb \<Longrightarrow> valid s' \<and> (s' = Attach p h flag # s) \<longrightarrow> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   193
    ((Info_flow_shm s pa pb) \<or> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   194
     (\<not> Info_flow_shm s pa pb \<and> pa = p \<and> pb \<noteq> p \<and> flag = SHM_RDWR \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   195
       (\<exists> p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   196
     (\<not> Info_flow_shm s pa pb \<and> pb = p \<and> pa \<noteq> p \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   197
       (\<exists> p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p')))"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   198
proof (induct rule:Info_flow_shm.induct)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   199
  case (ifs_self proc \<tau>)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   200
  show ?case
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   201
  proof (rule impI)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   202
    assume pre: "valid \<tau> \<and> \<tau> = Attach p h flag # s"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   203
    hence p1: "p \<in> current_procs s" and p2: "valid s" by (auto intro:vd_cons dest:vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   204
    hence p3: "Info_flow_shm s p p" by (auto intro:Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   205
    from ifs_self pre have "proc \<in> current_procs s" by simp 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   206
    hence p4: "Info_flow_shm s proc proc" by (auto intro:Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   207
    show "Info_flow_shm s proc proc \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   208
          (\<not> Info_flow_shm s proc proc \<and> proc = p \<and> proc \<noteq> p \<and> flag = SHM_RDWR \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   209
           (\<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' proc)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   210
          (\<not> Info_flow_shm s proc proc \<and> proc = p \<and> proc \<noteq> p \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   211
           (\<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s proc p'))"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   212
      using p4 p3 by auto
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   213
  qed
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   214
next
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   215
  case (ifs_flow \<tau> pa pb h' pc)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   216
  thus ?case
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   217
  proof (rule_tac impI)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   218
    assume p1:"Info_flow_shm \<tau> pa pb" and p2: "valid \<tau> \<and> (\<tau> = Attach p h flag # s) \<longrightarrow> Info_flow_shm s pa pb \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   219
     \<not> Info_flow_shm s pa pb \<and> pa = p \<and>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   220
     pb \<noteq> p \<and> flag = SHM_RDWR \<and> (\<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   221
     \<not> Info_flow_shm s pa pb \<and> pb = p \<and> pa \<noteq> p \<and> (\<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p')"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   222
    and p3: "one_flow_shm \<tau> h' pb pc" and p4: "valid \<tau> \<and> \<tau> = Attach p h flag # s" 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   223
    from p2 and p4 have p2': "Info_flow_shm s pa pb \<or> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   224
      (\<not> Info_flow_shm s pa pb \<and> pa = p \<and> pb \<noteq> p \<and> flag = SHM_RDWR \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   225
       (\<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   226
      (\<not> Info_flow_shm s pa pb \<and> pb = p \<and> pa \<noteq> p \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   227
       (\<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p'))"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   228
      by (erule_tac impE, simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   229
    from p4 have p5: "valid s" and p6: "os_grant s (Attach p h flag)" by (auto intro:vd_cons dest:vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   230
    from p6 have "p \<in> current_procs s" by simp hence p7:"Info_flow_shm s p p" by (erule_tac Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   231
    from p3 p4 have p8: "if (h' = h) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   232
     then (pb = p \<and> pc \<noteq> p \<and> flag = SHM_RDWR \<and> (\<exists> flagb. (pc, flagb) \<in> procs_of_shm s h)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   233
          (pc = p \<and> pb \<noteq> p \<and> (pb, SHM_RDWR) \<in> procs_of_shm s h) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   234
          (one_flow_shm s h pb pc)               
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   235
     else one_flow_shm s h' pb pc        " by (auto simp add:one_flow_shm_attach) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   236
    
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   237
    have "\<lbrakk>pa = p; pc = p\<rbrakk> \<Longrightarrow> Info_flow_shm s pa pc " using p7 by simp
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   238
    moreover have "\<lbrakk>pa = p; pc \<noteq> p; flag = SHM_RDWR; \<not> Info_flow_shm s pa pc\<rbrakk> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   239
      \<Longrightarrow> \<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pc"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   240
      sorry
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   241
    moreover have "\<lbrakk>pa = p; pc \<noteq> p; flag \<noteq> SHM_RDWR; \<not> Info_flow_shm s pa pc\<rbrakk>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   242
      \<Longrightarrow> Info_flow_shm s pa pc"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   243
      sorry
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   244
    moreover have "\<lbrakk>pc = p; pa \<noteq> p; \<not> Info_flow_shm s pa pc\<rbrakk>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   245
      \<Longrightarrow> \<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p'"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   246
      sorry
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   247
    ultimately 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   248
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   249
      
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   250
    
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   251
    show "Info_flow_shm s pa pc \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   252
      (\<not> Info_flow_shm s pa pc \<and> pa = p \<and> pc \<noteq> p \<and> flag = SHM_RDWR \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   253
       (\<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pc)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   254
      (\<not> Info_flow_shm s pa pc \<and> pc = p \<and> pa \<noteq> p \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   255
       (\<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p'))"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   256
      apply auto
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   257
      sorry
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   258
  qed
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   259
qed
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   260
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   261
lemma Info_flow_shm_intro3:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   262
  "\<lbrakk>Info_flow_shm s p from; (from, SHM_RDWR) \<in> procs_of_shm s h; (to, flag) \<in> procs_of_shm s h\<rbrakk>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   263
   \<Longrightarrow> Info_flow_shm s p to"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   264
apply (case_tac "from = to", simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   265
apply (erule_tac h = h in Info_flow_shm.intros(2), simp add:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   266
by (rule_tac x = flag in exI, simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   267
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   268
lemma Info_flow_shm_attach1:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   269
  "Info_flow_shm s' pa pb \<Longrightarrow> valid s' \<and> (s' = Attach p h flag # s) \<longrightarrow> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   270
     (if Info_flow_shm s pa pb then True else
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   271
     (if (pa = p \<and> flag = SHM_RDWR) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   272
      then (\<exists> p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   273
      else if (pb = p) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   274
           then (\<exists> p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p')
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   275
           else (\<exists> p' flag'. Info_flow_shm s pa p \<and> flag = SHM_RDWR \<and> (p', flag') \<in> procs_of_shm s h \<and> 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   276
                             Info_flow_shm s p' pb) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   277
                (\<exists> p'. Info_flow_shm s pa p' \<and> (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s p pb)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   278
     )  )"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   279
proof (induct rule:Info_flow_shm.induct)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   280
  case (ifs_self proc \<tau>)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   281
  show ?case
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   282
  proof (rule impI)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   283
    assume pre: "valid \<tau> \<and> \<tau> = Attach p h flag # s"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   284
    hence p1: "p \<in> current_procs s" and p2: "valid s" by (auto intro:vd_cons dest:vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   285
    hence p3: "Info_flow_shm s p p" by (auto intro:Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   286
    from ifs_self pre have "proc \<in> current_procs s" by simp 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   287
    hence p4: "Info_flow_shm s proc proc" by (auto intro:Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   288
    show "if Info_flow_shm s proc proc then True
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   289
    else if proc = p \<and> flag = SHM_RDWR then \<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' proc
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   290
         else if proc = p then \<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s proc p'
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   291
              else (\<exists>p' flag'. Info_flow_shm s proc p \<and>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   292
                       flag = SHM_RDWR \<and> (p', flag') \<in> procs_of_shm s h \<and> Info_flow_shm s p' proc) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   293
                   (\<exists>p'. Info_flow_shm s proc p' \<and> (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s p proc)"      using p4 p3 by auto
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   294
  qed
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   295
next
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   296
  case (ifs_flow \<tau> pa pb h' pc)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   297
  thus ?case
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   298
  proof (rule_tac impI)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   299
    assume p1:"Info_flow_shm \<tau> pa pb" and p2: "valid \<tau> \<and> \<tau> = Attach p h flag # s \<longrightarrow>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   300
     (if Info_flow_shm s pa pb then True
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   301
      else if pa = p \<and> flag = SHM_RDWR then \<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   302
           else if pb = p then \<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p'
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   303
                else (\<exists>p' flag'. Info_flow_shm s pa p \<and>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   304
                         flag = SHM_RDWR \<and> (p', flag') \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   305
                     (\<exists>p'. Info_flow_shm s pa p' \<and> (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s p pb))"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   306
      and p3: "one_flow_shm \<tau> h' pb pc" and p4: "valid \<tau> \<and> \<tau> = Attach p h flag # s"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   307
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   308
    from p2 and p4 have p2': "(if Info_flow_shm s pa pb then True
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   309
      else if pa = p \<and> flag = SHM_RDWR then \<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   310
           else if pb = p then \<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p'
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   311
                else (\<exists>p' flag'. Info_flow_shm s pa p \<and>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   312
                         flag = SHM_RDWR \<and> (p', flag') \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   313
                     (\<exists>p'. Info_flow_shm s pa p' \<and> (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s p pb))"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   314
      by (erule_tac impE, simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   315
    from p4 have p5: "valid s" and p6: "os_grant s (Attach p h flag)" by (auto intro:vd_cons dest:vt_grant_os)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   316
    from p6 have "p \<in> current_procs s" by simp hence p7:"Info_flow_shm s p p" by (erule_tac Info_flow_shm.intros)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   317
    from p3 p4 have p8: "if (h' = h) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   318
     then (pb = p \<and> pc \<noteq> p \<and> flag = SHM_RDWR \<and> (\<exists> flagb. (pc, flagb) \<in> procs_of_shm s h)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   319
          (pc = p \<and> pb \<noteq> p \<and> (pb, SHM_RDWR) \<in> procs_of_shm s h) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   320
          (one_flow_shm s h pb pc)               
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   321
     else one_flow_shm s h' pb pc        " by (auto simp add:one_flow_shm_attach) 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   322
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   323
    have "\<And> flagb. (pc, flagb) \<in> procs_of_shm s h 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   324
      \<Longrightarrow> \<exists> p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pc"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   325
      apply (rule_tac x= pc in exI, rule_tac x = flagb in exI, frule procs_of_shm_prop2)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   326
      by (simp add:p5, simp add:Info_flow_shm.intros(1))
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   327
    hence p10: "\<not> Info_flow_shm s p pc \<Longrightarrow> (\<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pc) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   328
      Info_flow_shm s pa pc"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   329
      using p2' p7 p8 p5
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   330
      by (auto split:if_splits dest:Info_flow_shm.intros(2))      
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   331
  (*     apply (rule_tac x = pb in exI, simp add:one_flow_flows, rule_tac x = flagb in exI, simp)+  *)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   332
    moreover have "pc = p \<Longrightarrow> (\<exists> p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p') 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   333
                            \<or> Info_flow_shm s pa pc"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   334
      using p2' p7 p8 p5
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   335
      by (auto split:if_splits intro:Info_flow_shm_intro3 simp:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   336
    moreover have "\<lbrakk>pc \<noteq> p; pa \<noteq> p \<or> flag \<noteq> SHM_RDWR\<rbrakk> \<Longrightarrow> (\<exists>p' flag'. Info_flow_shm s pa p \<and>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   337
                          flag = SHM_RDWR \<and> (p', flag') \<in> procs_of_shm s h \<and> Info_flow_shm s p' pc) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   338
                      (\<exists>p'. Info_flow_shm s pa p' \<and> (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s p pc) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   339
                      Info_flow_shm s pa pc"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   340
      using p2' p7 p8 p5
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   341
      apply (auto split:if_splits intro:Info_flow_shm_intro3 simp:one_flow_shm_def)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   342
      apply (rule_tac x = pc in exI, simp add:Info_flow_shm_intro4)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   343
      apply (rule_tac x = flagb in exI, simp)      
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   344
      done
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   345
    ultimately  show "if Info_flow_shm s pa pc then True
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   346
       else if pa = p \<and> flag = SHM_RDWR then \<exists>p' flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pc
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   347
            else if pc = p then \<exists>p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s pa p'
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   348
                 else (\<exists>p' flag'. Info_flow_shm s pa p \<and>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   349
                          flag = SHM_RDWR \<and> (p', flag') \<in> procs_of_shm s h \<and> Info_flow_shm s p' pc) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   350
                      (\<exists>p'. Info_flow_shm s pa p' \<and> (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s p pc)"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   351
      using p7 by auto
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   352
  qed
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   353
qed
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   354
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   355
      
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   356
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   357
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   358
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   359
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   360
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   361
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   362
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   363
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   364
lemma Info_flow_shm_attach:
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   365
  "valid (Attach p h flag # s) \<Longrightarrow> Info_flow_shm (Attach p h flag # s) = (\<lambda> pa pb. 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   366
     (Info_flow_shm s pa pb) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   367
     (pa = p \<and> flag = SHM_RDWR \<and> (\<exists> flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb)) \<or>
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   368
     (pb = p \<and> (\<exists> p'. (p', SHM_RDWR) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pa)) )"
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   369
apply (rule ext, rule ext, rule iffI)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   370
apply (case_tac "Info_flow_shm s pa pb", simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   371
apply (case_tac "pa = p \<and> flag = SHM_RDWR \<and> (\<exists>flagb. (p', flagb) \<in> procs_of_shm s h \<and> Info_flow_shm s p' pb)", simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   372
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   373
apply (erule Info_flow_shm_cases1, simp, drule_tac p = pc in Info_flow_shm.intros(1), simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   374
apply (simp add:one_flow_shm_simps split:if_splits, erule disjE, simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   375
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   376
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   377
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   378
apply (simp split:if_splits, (rule impI|rule allI|rule conjI|erule conjE|erule exE)+, simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   379
apply (simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   380
apply (simp, erule Info_flow_shm_cases', simp, simp)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   381
apply (rule_tac x = 
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   382
apply (auto dest:Info_flow_shm.cases)
fc749f19b894 Info_flow_shm_attach_prop
chunhan
parents: 26
diff changeset
   383
apply (auto simp add:one_flow_shm_simps)
26
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   384
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   385
lemma info_flow_shm_detach:
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   386
  "valid (Detach p h # s) \<Longrightarrow> info_flow_shm (Detach p h # s) = (\<lambda> pa pb. 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   387
     self_shm s pa pb \<or> ((p = pa \<or> p = pb) \<and> (\<exists> h'. h' \<noteq> h \<and> one_flow_shm s h' pa pb)) \<or>
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   388
     (pa \<noteq> p \<and> pb \<noteq> p \<and> info_flow_shm s pa pb) )"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   389
apply (rule ext, rule ext, frule vt_grant_os)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   390
by (auto simp:info_flow_shm_def one_flow_shm_def)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   391
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   392
lemma info_flow_shm_deleteshm:
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   393
  "valid (DeleteShM p h # s) \<Longrightarrow> info_flow_shm (DeleteShM p h # s) = (\<lambda> pa pb. 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   394
     self_shm s pa pb \<or> (\<exists> h'. h' \<noteq> h \<and> one_flow_shm s h' pa pb)     )"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   395
apply (rule ext, rule ext, frule vt_grant_os)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   396
by (auto simp:info_flow_shm_def one_flow_shm_def)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   397
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   398
lemma info_flow_shm_clone:
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   399
  "valid (Clone p p' fds shms # s) \<Longrightarrow> info_flow_shm (Clone p p' fds shms # s) = (\<lambda> pa pb. 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   400
     (pa = p' \<and> pb = p') \<or> (pa = p' \<and> pb \<noteq> p' \<and> (\<exists> h \<in> shms. one_flow_shm s h p pb)) \<or> 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   401
     (pb = p' \<and> pa \<noteq> p' \<and> (\<exists> h \<in> shms. one_flow_shm s h pa p)) \<or> 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   402
     (pa \<noteq> p' \<and> pb \<noteq> p' \<and> info_flow_shm s pa pb))"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   403
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons, clarsimp)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   404
apply (frule_tac p = p' in procs_of_shm_prop2', simp)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   405
apply (auto simp:info_flow_shm_def one_flow_shm_def)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   406
done
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   407
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   408
lemma info_flow_shm_execve:
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   409
  "valid (Execve p f fds # s) \<Longrightarrow> info_flow_shm (Execve p f fds # s) = (\<lambda> pa pb. 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   410
     (pa = p \<and> pb = p) \<or> (pa \<noteq> p \<and> pb \<noteq> p \<and> info_flow_shm s pa pb)    )"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   411
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   412
by (auto simp:info_flow_shm_def one_flow_shm_def)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   413
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   414
lemma info_flow_shm_kill:
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   415
  "valid (Kill p p' # s) \<Longrightarrow> info_flow_shm (Kill p p' # s) = (\<lambda> pa pb. 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   416
     pa \<noteq> p' \<and> pb \<noteq> p' \<and> info_flow_shm s pa pb                 )"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   417
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   418
by (auto simp:info_flow_shm_def one_flow_shm_def)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   419
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   420
lemma info_flow_shm_exit:
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   421
  "valid (Exit p # s) \<Longrightarrow> info_flow_shm (Exit p # s) = (\<lambda> pa pb. 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   422
     pa \<noteq> p \<and> pb \<noteq> p \<and> info_flow_shm s pa pb                          )"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   423
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   424
by (auto simp:info_flow_shm_def one_flow_shm_def)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   425
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   426
lemma info_flow_shm_other:
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   427
  "\<lbrakk>valid (e # s); 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   428
    \<forall> p h flag. e \<noteq> Attach p h flag;
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   429
    \<forall> p h. e \<noteq> Detach p h;
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   430
    \<forall> p h. e \<noteq> DeleteShM p h;
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   431
    \<forall> p p' fds shms. e \<noteq> Clone p p' fds shms;
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   432
    \<forall> p f fds. e \<noteq> Execve p f fds;
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   433
    \<forall> p p'. e \<noteq> Kill p p';
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   434
    \<forall> p. e \<noteq> Exit p
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   435
   \<rbrakk> \<Longrightarrow> info_flow_shm (e # s) = info_flow_shm s"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   436
apply (rule ext, rule ext, frule vt_grant_os, frule vd_cons)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   437
apply (case_tac e, auto simp:info_flow_shm_def one_flow_shm_def dest:procs_of_shm_prop2)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   438
apply (erule_tac x = h in allE, simp)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   439
apply (drule procs_of_shm_prop1, auto)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   440
done
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   441
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   442
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   443
(*
25
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   444
lemma info_flow_shm_prop1: 
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   445
  "\<lbrakk>info_flow_shm s p p'; p \<noteq> p'; valid s\<rbrakk> 
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   446
   \<Longrightarrow> \<exists> h h' flag. (p, SHM_RDWR) \<in> procs_of_shm s h \<and> (p', flag) \<in> procs_of_shm s h'"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   447
by (induct rule: info_flow_shm.induct, auto)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   448
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   449
lemma info_flow_shm_cases:
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   450
  "\<lbrakk>info_flow_shm \<tau> pa pb; \<And>p s. \<lbrakk>s = \<tau> ; pa = p; pb = p; p \<in> current_procs s\<rbrakk> \<Longrightarrow> P;
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   451
  \<And>s p p' h p'' flag. \<lbrakk>s = \<tau>; pa = p; pb = p''; info_flow_shm s p p'; (p', SHM_RDWR) \<in> procs_of_shm s h;
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   452
                       (p'', flag) \<in> procs_of_shm s h\<rbrakk>\<Longrightarrow> P\<rbrakk>
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   453
  \<Longrightarrow> P"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   454
by (erule info_flow_shm.cases, auto)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   455
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   456
definition one_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   457
where
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   458
  "one_flow_shm s p p' \<equiv> p \<noteq> p' \<and> (\<exists> h flag. (p, SHM_RDWR) \<in> procs_of_shm s h \<and> (p', flag) \<in> procs_of_shm s h)"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   459
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   460
inductive flows_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   461
where
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   462
  "p \<in> current_procs s \<Longrightarrow> flows_shm s p p"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   463
| "\<lbrakk>flows_shm s p p'; one_flow_shm s p' p''\<rbrakk> \<Longrightarrow> flows_shm s p p''"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   464
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   465
definition attached_procs :: "t_state \<Rightarrow> t_shm \<Rightarrow> t_process set"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   466
where
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   467
  "attached_procs s h \<equiv> {p. \<exists> flag. (p, flag) \<in> procs_of_shm s h}"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   468
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   469
definition flowed_procs:: "t_state \<Rightarrow> t_shm \<Rightarrow> t_process set"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   470
where
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   471
  "flowed_procs s h \<equiv> {p'. \<exists> p \<in> attached_procs s h. flows_shm s p p'}"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   472
26
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   473
inductive flowed_shm:: "t_state \<Rightarrow> t_process \<Rightarrow> t_shm set"
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   474
25
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   475
fun Info_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process set"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   476
where
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   477
  "Info_flow_shm [] = (\<lambda> p. {p'. flows_shm [] p p'})"
26
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   478
| "Info_flow_shm (Attach p h flag # s) = (\<lambda> p'. 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   479
     if (p' = p) then flowed_procs s h 
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   480
     else if ()
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   481
    "
25
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   482
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   483
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   484
lemma info_flow_shm_attach:
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   485
  "valid (Attach p h flag # s) \<Longrightarrow> info_flow_shm (Attach p h flag # s) = (\<lambda> pa pb. (info_flow_shm s pa pb) \<or> 
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   486
     (if (pa = p) 
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   487
      then (if (flag = SHM_RDWR) 
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   488
            then (\<exists> flag. (pb, flag) \<in> procs_of_shm s h)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   489
            else (pb = p)) 
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   490
      else (if (pb = p) 
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   491
            then (pa, SHM_RDWR) \<in> procs_of_shm s h
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   492
            else info_flow_shm s pa pb)) )"
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   493
apply (frule vd_cons, frule vt_grant_os, rule ext, rule ext)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   494
apply (case_tac "info_flow_shm s pa pb", simp)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   495
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   496
thm info_flow_shm.cases
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   497
apply (auto split:if_splits intro:info_flow_shm.intros elim:info_flow_shm_cases)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   498
apply (erule info_flow_shm_cases, simp, simp split:if_splits)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   499
apply (rule_tac p = pa and p' = p' in info_flow_shm.intros(2), simp+)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   500
apply (rule notI, erule info_flow_shm.cases, simp+)
259a50be4381 wrong of info-flow-shm, it is a inductive(transitive) notion, not a simple relation just between 2 nodes, more information, see 5.7 of ideas_of_selinux.txt
chunhan
parents: 23
diff changeset
   501
pr 5
26
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   502
*)
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   503
lemmas info_flow_shm_simps = info_flow_shm_other info_flow_shm_attach info_flow_shm_detach info_flow_shm_deleteshm
b6333712cb02 finished info_flow_shm(simple def) simpset
chunhan
parents: 25
diff changeset
   504
  info_flow_shm_clone info_flow_shm_execve info_flow_shm_kill info_flow_shm_exit
23
25e55731ed01 locale of tainting for seeds when same shm/inode bugs
chunhan
parents: 19
diff changeset
   505
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   506
lemma has_same_inode_in_current:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   507
  "\<lbrakk>has_same_inode s f f'; valid s\<rbrakk> \<Longrightarrow> f \<in> current_files s \<and> f' \<in> current_files s"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   508
by (auto simp add:has_same_inode_def current_files_def)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   509
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   510
lemma has_same_inode_prop1:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   511
  "\<lbrakk>has_same_inode s f f'; is_file s f; valid s\<rbrakk> \<Longrightarrow> is_file s f'"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   512
by (auto simp:has_same_inode_def is_file_def)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   513
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   514
lemma has_same_inode_prop1':
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   515
  "\<lbrakk>has_same_inode s f f'; is_file s f'; valid s\<rbrakk> \<Longrightarrow> is_file s f"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   516
by (auto simp:has_same_inode_def is_file_def)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   517
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   518
lemma has_same_inode_prop2:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   519
  "\<lbrakk>has_same_inode s f f'; file_of_proc_fd s p fd = Some f; valid s\<rbrakk> \<Longrightarrow> is_file s f'"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   520
apply (drule has_same_inode_prop1)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   521
apply (simp add:file_of_pfd_is_file, simp+)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   522
done
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   523
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   524
lemma has_same_inode_prop2':
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   525
  "\<lbrakk>has_same_inode s f f'; file_of_proc_fd s p fd = Some f'; valid s\<rbrakk> \<Longrightarrow> is_file s f"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   526
apply (drule has_same_inode_prop1')
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   527
apply (simp add:file_of_pfd_is_file, simp+)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   528
done
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   529
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   530
lemma tobj_in_init_alive:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   531
  "tobj_in_init obj \<Longrightarrow> init_alive obj"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   532
by (case_tac obj, auto)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   533
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   534
lemma tobj_in_alive:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   535
  "tobj_in_init obj \<Longrightarrow> alive [] obj"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   536
by (case_tac obj, auto simp:is_file_nil)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
   537
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
   538
end
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
   539
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
   540
end