no_shm_selinux/S2ss_prop2.thy
author chunhan
Thu, 16 Jan 2014 11:04:04 +0800
changeset 95 b7fd75d104bf
parent 92 d9dc04c3ea90
permissions -rw-r--r--
update
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
77
chunhan
parents:
diff changeset
     1
(*<*)
chunhan
parents:
diff changeset
     2
theory S2ss_prop2
chunhan
parents:
diff changeset
     3
imports Main Flask Flask_type Static Static_type Init_prop Tainted_prop Valid_prop Alive_prop Co2sobj_prop S2ss_prop
chunhan
parents:
diff changeset
     4
begin
chunhan
parents:
diff changeset
     5
(*>*)
chunhan
parents:
diff changeset
     6
chunhan
parents:
diff changeset
     7
context tainting_s begin
chunhan
parents:
diff changeset
     8
chunhan
parents:
diff changeset
     9
(* should be modified when socket is model in static *)
chunhan
parents:
diff changeset
    10
lemma s2ss_createsock:
chunhan
parents:
diff changeset
    11
  "valid (CreateSock p af st fd inum # s) \<Longrightarrow> s2ss (CreateSock p af st fd inum # s) = s2ss s"
chunhan
parents:
diff changeset
    12
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
    13
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
    14
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    15
thm co2sobj_other
chunhan
parents:
diff changeset
    16
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    17
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    18
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
    19
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    20
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    21
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    22
done
chunhan
parents:
diff changeset
    23
chunhan
parents:
diff changeset
    24
lemma s2ss_bind:
chunhan
parents:
diff changeset
    25
  "valid (Bind p fd addr # s) \<Longrightarrow> s2ss (Bind p fd addr # s) = s2ss s"
chunhan
parents:
diff changeset
    26
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
    27
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
    28
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    29
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    30
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    31
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
    32
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    33
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    34
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    35
done
chunhan
parents:
diff changeset
    36
chunhan
parents:
diff changeset
    37
lemma s2ss_connect:
chunhan
parents:
diff changeset
    38
  "valid (Connect p fd addr # s) \<Longrightarrow> s2ss (Connect p fd addr # s) = s2ss s"
chunhan
parents:
diff changeset
    39
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
    40
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
    41
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    42
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    43
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    44
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
    45
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    46
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    47
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    48
done
chunhan
parents:
diff changeset
    49
chunhan
parents:
diff changeset
    50
lemma s2ss_listen:
chunhan
parents:
diff changeset
    51
  "valid (Listen p fd # s) \<Longrightarrow> s2ss (Listen p fd # s) = s2ss s"
chunhan
parents:
diff changeset
    52
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
    53
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
    54
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    55
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    56
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    57
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
    58
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    59
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    60
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    61
done
chunhan
parents:
diff changeset
    62
chunhan
parents:
diff changeset
    63
lemma s2ss_accept:
chunhan
parents:
diff changeset
    64
  "valid (Accept p fd addr port fd' inum # s) \<Longrightarrow> s2ss (Accept p fd addr port fd' inum # s) = s2ss s"
chunhan
parents:
diff changeset
    65
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
    66
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
    67
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    68
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    69
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    70
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
    71
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    72
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    73
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    74
done
chunhan
parents:
diff changeset
    75
chunhan
parents:
diff changeset
    76
lemma s2ss_send:
chunhan
parents:
diff changeset
    77
  "valid (SendSock p fd # s) \<Longrightarrow> s2ss (SendSock p fd # s) = s2ss s"
chunhan
parents:
diff changeset
    78
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
    79
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
    80
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    81
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    82
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    83
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
    84
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    85
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    86
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    87
done
chunhan
parents:
diff changeset
    88
chunhan
parents:
diff changeset
    89
lemma s2ss_recv:
chunhan
parents:
diff changeset
    90
  "valid (RecvSock p fd # s) \<Longrightarrow> s2ss (RecvSock p fd # s) = s2ss s"
chunhan
parents:
diff changeset
    91
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
    92
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
    93
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    94
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    95
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
    96
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
    97
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
    98
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
    99
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
   100
done
chunhan
parents:
diff changeset
   101
chunhan
parents:
diff changeset
   102
lemma s2ss_shutdown:
chunhan
parents:
diff changeset
   103
  "valid (Shutdown p fd how # s) \<Longrightarrow> s2ss (Shutdown p fd how # s) = s2ss s"
chunhan
parents:
diff changeset
   104
apply (simp add:s2ss_def)
chunhan
parents:
diff changeset
   105
apply (tactic {*my_seteq_tac 1*})
chunhan
parents:
diff changeset
   106
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
   107
apply (simp add:co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
   108
apply (simp add:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
   109
apply (tactic {*my_setiff_tac 1*})
chunhan
parents:
diff changeset
   110
apply (rule_tac x = obj in exI)
chunhan
parents:
diff changeset
   111
apply (frule_tac obj = obj in co2sobj_other)
92
d9dc04c3ea90 modify co2sobj/s2ss from object to dobject
chunhan
parents: 77
diff changeset
   112
apply (auto simp:co2sobj.simps dalive_simps split:t_object.splits if_splits)
77
chunhan
parents:
diff changeset
   113
done
chunhan
parents:
diff changeset
   114
chunhan
parents:
diff changeset
   115
lemmas s2ss_simps = s2ss_execve s2ss_clone s2ss_ptrace s2ss_kill s2ss_exit s2ss_open
chunhan
parents:
diff changeset
   116
  s2ss_readfile s2ss_writefile s2ss_closefd s2ss_unlink s2ss_rmdir s2ss_linkhard
chunhan
parents:
diff changeset
   117
  s2ss_truncate s2ss_createmsgq s2ss_sendmsg s2ss_removemsgq s2ss_recvmsg
chunhan
parents:
diff changeset
   118
  s2ss_createsock s2ss_bind s2ss_connect s2ss_listen s2ss_accept s2ss_send 
chunhan
parents:
diff changeset
   119
  s2ss_recv s2ss_shutdown
chunhan
parents:
diff changeset
   120
chunhan
parents:
diff changeset
   121
end
chunhan
parents:
diff changeset
   122
chunhan
parents:
diff changeset
   123
end