Tainted_prop.thy
author chunhan
Thu, 06 Jun 2013 12:38:44 +0800
changeset 20 e2c6af3ccb0d
parent 19 ced0fcfbcf8e
child 22 f20a798cdf7d
permissions -rw-r--r--
fixed bug in tainted_s and update
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     1
theory Tainted_prop 
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
     2
imports Main Flask Flask_type Init_prop Current_files_prop Current_sockets_prop Delete_prop Proc_fd_of_file_prop Current_prop
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     3
begin
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     4
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     5
context tainting begin
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
lemma tainted_in_current:
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
     8
  "obj \<in> tainted s \<Longrightarrow> alive s obj"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
     9
apply (erule tainted.induct, auto dest:vt_grant_os vd_cons simp:is_file_simps)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    10
apply (drule seeds_in_init, simp add:tobj_in_alive)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    11
apply (erule has_same_inode_prop2, simp, simp add:vd_cons)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    12
apply (frule vt_grant_os, simp)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    13
apply (erule has_same_inode_prop1, simp, simp add:vd_cons)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    14
done
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    15
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    16
lemma tainted_is_valid:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    17
  "obj \<in> tainted s \<Longrightarrow> valid s"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    18
by (erule tainted.induct, auto intro:valid.intros)
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    19
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    20
lemma t_remain_app:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    21
  "\<lbrakk>obj \<in> tainted s; \<not> deleted obj (s' @ s); valid (s' @ s)\<rbrakk> 
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    22
  \<Longrightarrow> obj \<in> tainted (s' @ s)"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    23
apply (induct s', simp)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    24
apply (simp (no_asm) only:cons_app_simp_aux, rule t_remain)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    25
apply (simp_all add:not_deleted_cons_D vd_cons)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    26
apply (drule tainted_in_current, simp add:not_deleted_imp_alive_cons)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    27
done
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    28
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    29
lemma valid_tainted_obj:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    30
  "obj \<in> tainted s \<Longrightarrow> (\<forall> f. obj \<noteq> O_dir f) \<and> (\<forall> q. obj \<noteq> O_msgq q) \<and> (\<forall> h. obj \<noteq> O_shm h)"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    31
apply (erule tainted.induct)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    32
apply (drule seeds_in_init)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    33
by auto
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    34
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    35
lemma dir_not_tainted: "O_dir f \<in> tainted s \<Longrightarrow> False"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    36
by (auto dest:valid_tainted_obj)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    37
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    38
lemma msgq_not_tainted: "O_msgq q \<in> tainted s \<Longrightarrow> False"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    39
by (auto dest:valid_tainted_obj)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    40
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    41
lemma shm_not_tainted: "O_shm h \<in> tainted s \<Longrightarrow> False"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    42
by (auto dest:valid_tainted_obj)
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    43
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    44
end
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    45
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    46
end