no_shm_selinux/Co2sobj_prop.thy
changeset 92 d9dc04c3ea90
parent 88 e832378a2ff2
equal deleted inserted replaced
91:1a1df29d3507 92:d9dc04c3ea90
  1840   
  1840   
  1841 
  1841 
  1842 (* simpset for co2sobj *)
  1842 (* simpset for co2sobj *)
  1843 
  1843 
  1844 lemma co2sobj_execve:
  1844 lemma co2sobj_execve:
  1845   "\<lbrakk>valid (Execve p f fds # s); alive (Execve p f fds # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Execve p f fds # s) obj = (
  1845   "\<lbrakk>valid (Execve p f fds # s); dalive (Execve p f fds # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Execve p f fds # s) obj = (
  1846       if (obj = O_proc p)
  1846       if (obj = D_proc p)
  1847       then (case (cp2sproc (Execve p f fds # s) p) of
  1847       then (case (cp2sproc (Execve p f fds # s) p) of
  1848               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s \<or> O_file f \<in> tainted s))
  1848               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s \<or> O_file f \<in> tainted s))
  1849             | _       \<Rightarrow> None) 
  1849             | _       \<Rightarrow> None) 
  1850       else co2sobj s obj )"
  1850       else co2sobj s obj )"
  1851 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1851 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1857 apply (frule_tac ff = list in cf2sfile_other', simp_all)
  1857 apply (frule_tac ff = list in cf2sfile_other', simp_all)
  1858 apply (simp add:is_dir_in_current)
  1858 apply (simp add:is_dir_in_current)
  1859 done
  1859 done
  1860 
  1860 
  1861 lemma co2sobj_execve':
  1861 lemma co2sobj_execve':
  1862   "\<lbrakk>valid (Execve p f fds # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Execve p f fds # s) obj = (
  1862   "\<lbrakk>valid (Execve p f fds # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (Execve p f fds # s) obj = (
  1863       if (obj = O_proc p)
  1863       if (obj = D_proc p)
  1864       then (case (cp2sproc (Execve p f fds # s) p) of
  1864       then (case (cp2sproc (Execve p f fds # s) p) of
  1865               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s \<or> O_file f \<in> tainted s))
  1865               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s \<or> O_file f \<in> tainted s))
  1866             | _       \<Rightarrow> None) 
  1866             | _       \<Rightarrow> None) 
  1867       else co2sobj s obj )"
  1867       else co2sobj s obj )"
  1868 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1868 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1874 apply (frule_tac ff = list in cf2sfile_other', simp_all)
  1874 apply (frule_tac ff = list in cf2sfile_other', simp_all)
  1875 apply (simp add:is_dir_in_current)
  1875 apply (simp add:is_dir_in_current)
  1876 done
  1876 done
  1877 
  1877 
  1878 lemma co2sobj_clone':
  1878 lemma co2sobj_clone':
  1879   "\<lbrakk>valid (Clone p p' fds # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Clone p p' fds # s) obj = (
  1879   "\<lbrakk>valid (Clone p p' fds # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (Clone p p' fds # s) obj = (
  1880       if (obj = O_proc p')
  1880       if (obj = D_proc p')
  1881       then (case (cp2sproc (Clone p p' fds # s) p') of
  1881       then (case (cp2sproc (Clone p p' fds # s) p') of
  1882               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  1882               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  1883             | _       \<Rightarrow> None)
  1883             | _       \<Rightarrow> None)
  1884       else co2sobj s obj )"
  1884       else co2sobj s obj )"
  1885 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1885 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1893 apply (frule_tac ff = list in cf2sfile_other', simp_all)
  1893 apply (frule_tac ff = list in cf2sfile_other', simp_all)
  1894 apply (simp add:is_dir_in_current)
  1894 apply (simp add:is_dir_in_current)
  1895 done
  1895 done
  1896 
  1896 
  1897 lemma co2sobj_clone:
  1897 lemma co2sobj_clone:
  1898   "\<lbrakk>valid (Clone p p' fds # s); alive (Clone p p' fds # s) obj\<rbrakk> 
  1898   "\<lbrakk>valid (Clone p p' fds # s); dalive (Clone p p' fds # s) obj\<rbrakk> 
  1899    \<Longrightarrow> co2sobj (Clone p p' fds # s) obj = (
  1899    \<Longrightarrow> co2sobj (Clone p p' fds # s) obj = (
  1900       if (obj = O_proc p')
  1900       if (obj = D_proc p')
  1901       then (case (cp2sproc (Clone p p' fds # s) p') of
  1901       then (case (cp2sproc (Clone p p' fds # s) p') of
  1902               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  1902               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  1903             | _       \<Rightarrow> None)
  1903             | _       \<Rightarrow> None)
  1904       else co2sobj s obj )"
  1904       else co2sobj s obj )"
  1905 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1905 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1918 apply (simp add:is_dir_in_current)
  1918 apply (simp add:is_dir_in_current)
  1919 done
  1919 done
  1920 
  1920 
  1921 (*
  1921 (*
  1922 lemma co2sobj_ptrace:
  1922 lemma co2sobj_ptrace:
  1923   "\<lbrakk>valid (Ptrace p p' # s); alive s obj\<rbrakk>\<Longrightarrow> co2sobj (Ptrace p p' # s) obj = (
  1923   "\<lbrakk>valid (Ptrace p p' # s); dalive s obj\<rbrakk>\<Longrightarrow> co2sobj (Ptrace p p' # s) obj = (
  1924      case obj of
  1924      case obj of
  1925        O_proc p'' \<Rightarrow> if (info_flow_shm s p' p'') 
  1925        O_proc p'' \<Rightarrow> if (info_flow_shm s p' p'') 
  1926                      then (case (cp2sproc s p'') of 
  1926                      then (case (cp2sproc s p'') of 
  1927                              Some sp \<Rightarrow> Some (S_proc sp (O_proc p'' \<in> tainted s \<or> O_proc p \<in> tainted s))
  1927                              Some sp \<Rightarrow> Some (S_proc sp (O_proc p'' \<in> tainted s \<or> O_proc p \<in> tainted s))
  1928                            | _       \<Rightarrow> None)
  1928                            | _       \<Rightarrow> None)
  1943 apply (simp add:is_dir_in_current)
  1943 apply (simp add:is_dir_in_current)
  1944 done
  1944 done
  1945 *)
  1945 *)
  1946 
  1946 
  1947 lemma co2sobj_ptrace:
  1947 lemma co2sobj_ptrace:
  1948   "\<lbrakk>valid (Ptrace p p' # s); alive s obj\<rbrakk>\<Longrightarrow> co2sobj (Ptrace p p' # s) obj = (
  1948   "\<lbrakk>valid (Ptrace p p' # s); dalive s obj\<rbrakk>\<Longrightarrow> co2sobj (Ptrace p p' # s) obj = (
  1949      case obj of
  1949      case obj of
  1950        O_proc p'' \<Rightarrow> if (p'' = p') 
  1950        D_proc p'' \<Rightarrow> if (p'' = p') 
  1951                      then (case (cp2sproc s p'') of 
  1951                      then (case (cp2sproc s p'') of 
  1952                              Some sp \<Rightarrow> Some (S_proc sp (O_proc p'' \<in> tainted s \<or> O_proc p \<in> tainted s))
  1952                              Some sp \<Rightarrow> Some (S_proc sp (O_proc p'' \<in> tainted s \<or> O_proc p \<in> tainted s))
  1953                            | _       \<Rightarrow> None)
  1953                            | _       \<Rightarrow> None)
  1954                      else if (p'' = p)
  1954                      else if (p'' = p)
  1955                           then (case (cp2sproc s p'') of 
  1955                           then (case (cp2sproc s p'') of 
  1956                                   Some sp \<Rightarrow> Some (S_proc sp (O_proc p'' \<in> tainted s \<or> O_proc p' \<in> tainted s))
  1956                                   Some sp \<Rightarrow> Some (S_proc sp (O_proc p'' \<in> tainted s \<or> O_proc p' \<in> tainted s))
  1957                                 | _       \<Rightarrow> None)
  1957                                 | _       \<Rightarrow> None)
  1958                           else co2sobj s (O_proc p'')
  1958                           else co2sobj s (D_proc p'')
  1959     | _          \<Rightarrow> co2sobj s obj)"
  1959     | _          \<Rightarrow> co2sobj s obj)"
  1960 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1960 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1961 apply (simp_all add:current_files_simps cq2smsgq_other cf2sfiles_other)
  1961 apply (simp_all add:current_files_simps cq2smsgq_other cf2sfiles_other)
  1962 
  1962 
  1963 apply (auto simp:cp2sproc_other split:option.splits
  1963 apply (auto simp:cp2sproc_other split:option.splits
  1968 apply (simp add:is_dir_in_current)
  1968 apply (simp add:is_dir_in_current)
  1969 done
  1969 done
  1970 
  1970 
  1971 
  1971 
  1972 lemma co2sobj_open:
  1972 lemma co2sobj_open:
  1973   "\<lbrakk>valid (Open p f flag fd opt # s); alive (Open p f flag fd opt # s) obj\<rbrakk> 
  1973   "\<lbrakk>valid (Open p f flag fd opt # s); dalive (Open p f flag fd opt # s) obj\<rbrakk> 
  1974    \<Longrightarrow> co2sobj (Open p f flag fd opt # s) obj = (case obj of 
  1974    \<Longrightarrow> co2sobj (Open p f flag fd opt # s) obj = (case obj of 
  1975      O_file f' \<Rightarrow> if (f' = f \<and> opt \<noteq> None)
  1975      D_file f' \<Rightarrow> if (f' = f \<and> opt \<noteq> None)
  1976                   then (case (cf2sfile (Open p f flag fd opt # s) f) of
  1976                   then (case (cf2sfile (Open p f flag fd opt # s) f) of
  1977                           Some sf \<Rightarrow> Some (S_file {sf} (O_proc p \<in> tainted s))
  1977                           Some sf \<Rightarrow> Some (S_file {sf} (O_proc p \<in> tainted s))
  1978                         | _       \<Rightarrow> None)
  1978                         | _       \<Rightarrow> None)
  1979                   else co2sobj s (O_file f')
  1979                   else co2sobj s (D_file f')
  1980    | O_proc p' \<Rightarrow> if (p' = p) 
  1980    | D_proc p' \<Rightarrow> if (p' = p) 
  1981                   then (case (cp2sproc (Open p f flag fd opt # s) p) of
  1981                   then (case (cp2sproc (Open p f flag fd opt # s) p) of
  1982                           Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  1982                           Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  1983                         | _       \<Rightarrow> None)
  1983                         | _       \<Rightarrow> None)
  1984                   else co2sobj s (O_proc p')
  1984                   else co2sobj s (D_proc p')
  1985    | _         \<Rightarrow> co2sobj s obj )"
  1985    | _         \<Rightarrow> co2sobj s obj )"
  1986 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1986 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  1987 apply (auto simp:cp2sproc_simps split:option.splits
  1987 apply (auto simp:cp2sproc_simps split:option.splits
  1988            dest!:current_proc_has_sp' (* intro:info_flow_shm_tainted *))[1]
  1988            dest!:current_proc_has_sp' (* intro:info_flow_shm_tainted *))[1]
  1989 
  1989 
  2013 apply (simp split:if_splits option.splits)
  2013 apply (simp split:if_splits option.splits)
  2014 done
  2014 done
  2015 
  2015 
  2016 (*
  2016 (*
  2017 lemma co2sobj_readfile:
  2017 lemma co2sobj_readfile:
  2018   "\<lbrakk>valid (ReadFile p fd # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (ReadFile p fd # s) obj = (
  2018   "\<lbrakk>valid (ReadFile p fd # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (ReadFile p fd # s) obj = (
  2019      case obj of
  2019      case obj of
  2020        O_proc p' \<Rightarrow> (case (file_of_proc_fd s p fd) of
  2020        O_proc p' \<Rightarrow> (case (file_of_proc_fd s p fd) of
  2021                        Some f \<Rightarrow> (if (info_flow_shm s p p' \<and> O_file f \<in> tainted s)
  2021                        Some f \<Rightarrow> (if (info_flow_shm s p p' \<and> O_file f \<in> tainted s)
  2022                                   then (case (cp2sproc s p') of
  2022                                   then (case (cp2sproc s p') of
  2023                                           Some sp \<Rightarrow> Some (S_proc sp True)
  2023                                           Some sp \<Rightarrow> Some (S_proc sp True)
  2034              simp:current_files_simps cf2sfiles_simps cf2sfile_simps 
  2034              simp:current_files_simps cf2sfiles_simps cf2sfile_simps 
  2035              dest:is_file_in_current is_dir_in_current)
  2035              dest:is_file_in_current is_dir_in_current)
  2036 done
  2036 done
  2037 *)
  2037 *)
  2038 lemma co2sobj_readfile:
  2038 lemma co2sobj_readfile:
  2039   "\<lbrakk>valid (ReadFile p fd # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (ReadFile p fd # s) obj = (
  2039   "\<lbrakk>valid (ReadFile p fd # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (ReadFile p fd # s) obj = (
  2040      case obj of
  2040      case obj of
  2041        O_proc p' \<Rightarrow> (case (file_of_proc_fd s p fd) of
  2041        D_proc p' \<Rightarrow> (case (file_of_proc_fd s p fd) of
  2042                        Some f \<Rightarrow> (if (p' = p \<and> O_file f \<in> tainted s)
  2042                        Some f \<Rightarrow> (if (p' = p \<and> O_file f \<in> tainted s)
  2043                                   then (case (cp2sproc s p') of
  2043                                   then (case (cp2sproc s p') of
  2044                                           Some sp \<Rightarrow> Some (S_proc sp True)
  2044                                           Some sp \<Rightarrow> Some (S_proc sp True)
  2045                                         | _       \<Rightarrow> None)
  2045                                         | _       \<Rightarrow> None)
  2046                                   else co2sobj s obj)
  2046                                   else co2sobj s obj)
  2054              simp:current_files_simps cf2sfile_simps cf2sfiles_simps
  2054              simp:current_files_simps cf2sfile_simps cf2sfiles_simps
  2055              dest:is_file_in_current is_dir_in_current)
  2055              dest:is_file_in_current is_dir_in_current)
  2056 done
  2056 done
  2057 
  2057 
  2058 lemma co2sobj_writefile:
  2058 lemma co2sobj_writefile:
  2059   "\<lbrakk>valid (WriteFile p fd # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (WriteFile p fd # s) obj = (
  2059   "\<lbrakk>valid (WriteFile p fd # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (WriteFile p fd # s) obj = (
  2060      case obj of
  2060      case obj of
  2061        O_file f' \<Rightarrow> (case (file_of_proc_fd s p fd) of
  2061        D_file f' \<Rightarrow> (case (file_of_proc_fd s p fd) of
  2062                        Some f \<Rightarrow> (if (f \<in> same_inode_files s f') 
  2062                        Some f \<Rightarrow> (if (f \<in> same_inode_files s f') 
  2063                                   then Some (S_file (cf2sfiles s f') 
  2063                                   then Some (S_file (cf2sfiles s f') 
  2064                                                     (O_file f' \<in> tainted s \<or> O_proc p \<in> tainted s))
  2064                                                     (O_file f' \<in> tainted s \<or> O_proc p \<in> tainted s))
  2065                                   else co2sobj s obj)
  2065                                   else co2sobj s obj)
  2066                     | _       \<Rightarrow> None)
  2066                     | _       \<Rightarrow> None)
  2075 
  2075 
  2076 (* should delete has_same_inode !?!?*)
  2076 (* should delete has_same_inode !?!?*)
  2077 by (auto simp:same_inode_files_def is_file_def has_same_inode_def split:if_splits option.splits)
  2077 by (auto simp:same_inode_files_def is_file_def has_same_inode_def split:if_splits option.splits)
  2078 
  2078 
  2079 lemma co2sobj_closefd:
  2079 lemma co2sobj_closefd:
  2080   "\<lbrakk>valid (CloseFd p fd # s); alive (CloseFd p fd # s) obj\<rbrakk> \<Longrightarrow> co2sobj (CloseFd p fd # s) obj = (
  2080   "\<lbrakk>valid (CloseFd p fd # s); dalive (CloseFd p fd # s) obj\<rbrakk> \<Longrightarrow> co2sobj (CloseFd p fd # s) obj = (
  2081       case obj of 
  2081       case obj of 
  2082         O_file f' \<Rightarrow> (case (file_of_proc_fd s p fd) of 
  2082         D_file f' \<Rightarrow> (case (file_of_proc_fd s p fd) of 
  2083                         Some f \<Rightarrow> (if (f' \<in> same_inode_files s f \<and> proc_fd_of_file s f = {(p, fd)} \<and>
  2083                         Some f \<Rightarrow> (if (f' \<in> same_inode_files s f \<and> proc_fd_of_file s f = {(p, fd)} \<and>
  2084                                        f \<in> files_hung_by_del s \<and> (\<forall> f'' \<in> same_inode_files s f. 
  2084                                        f \<in> files_hung_by_del s \<and> (\<forall> f'' \<in> same_inode_files s f. 
  2085                                        f'' \<noteq> f \<longrightarrow> cf2sfile s f'' \<noteq> cf2sfile s f))
  2085                                        f'' \<noteq> f \<longrightarrow> cf2sfile s f'' \<noteq> cf2sfile s f))
  2086                                    then (case (cf2sfile s f, co2sobj s (O_file f')) of
  2086                                    then (case (cf2sfile s f, co2sobj s (D_file f')) of
  2087                                            (Some sf, Some (S_file sfs b)) \<Rightarrow> Some (S_file (sfs - {sf}) b)
  2087                                            (Some sf, Some (S_file sfs b)) \<Rightarrow> Some (S_file (sfs - {sf}) b)
  2088                                          | _                              \<Rightarrow> None)
  2088                                          | _                              \<Rightarrow> None)
  2089                                    else co2sobj s obj)
  2089                                    else co2sobj s obj)
  2090                      | _       \<Rightarrow> co2sobj s obj)
  2090                      | _       \<Rightarrow> co2sobj s obj)
  2091       | O_proc p' \<Rightarrow> (if (p = p') 
  2091       | D_proc p' \<Rightarrow> (if (p = p') 
  2092                       then (case (cp2sproc (CloseFd p fd # s) p) of
  2092                       then (case (cp2sproc (CloseFd p fd # s) p) of
  2093                               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  2093                               Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  2094                             | _       \<Rightarrow> None)
  2094                             | _       \<Rightarrow> None)
  2095                       else co2sobj s obj)
  2095                       else co2sobj s obj)
  2096       | _         \<Rightarrow> co2sobj s obj) "
  2096       | _         \<Rightarrow> co2sobj s obj) "
  2113 apply (clarsimp simp:current_files_closefd split:option.splits)
  2113 apply (clarsimp simp:current_files_closefd split:option.splits)
  2114 apply (drule file_of_pfd_is_file', simp+)
  2114 apply (drule file_of_pfd_is_file', simp+)
  2115 done
  2115 done
  2116 
  2116 
  2117 lemma co2sobj_unlink:
  2117 lemma co2sobj_unlink:
  2118   "\<lbrakk>valid (UnLink p f # s); alive (UnLink p f # s) obj\<rbrakk> \<Longrightarrow> co2sobj (UnLink p f # s) obj = (
  2118   "\<lbrakk>valid (UnLink p f # s); dalive (UnLink p f # s) obj\<rbrakk> \<Longrightarrow> co2sobj (UnLink p f # s) obj = (
  2119       case obj of
  2119       case obj of
  2120         O_file f' \<Rightarrow> if (f' \<in> same_inode_files s f \<and> proc_fd_of_file s f = {} \<and> 
  2120         D_file f' \<Rightarrow> if (f' \<in> same_inode_files s f \<and> proc_fd_of_file s f = {} \<and> 
  2121                         (\<forall> f'' \<in> same_inode_files s f. f'' \<noteq> f \<longrightarrow> cf2sfile s f'' \<noteq> cf2sfile s f))
  2121                         (\<forall> f'' \<in> same_inode_files s f. f'' \<noteq> f \<longrightarrow> cf2sfile s f'' \<noteq> cf2sfile s f))
  2122                      then (case (cf2sfile s f, co2sobj s (O_file f')) of
  2122                      then (case (cf2sfile s f, co2sobj s (D_file f')) of
  2123                              (Some sf, Some (S_file sfs b)) \<Rightarrow> Some (S_file (sfs - {sf}) b)
  2123                              (Some sf, Some (S_file sfs b)) \<Rightarrow> Some (S_file (sfs - {sf}) b)
  2124                            | _                              \<Rightarrow> None)
  2124                            | _                              \<Rightarrow> None)
  2125                      else co2sobj s obj
  2125                      else co2sobj s obj
  2126       | _         \<Rightarrow> co2sobj s obj)"
  2126       | _         \<Rightarrow> co2sobj s obj)"
  2127 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2127 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2140 apply (clarsimp simp:current_files_unlink split:option.splits)
  2140 apply (clarsimp simp:current_files_unlink split:option.splits)
  2141 apply (drule file_dir_conflict, simp+)
  2141 apply (drule file_dir_conflict, simp+)
  2142 done
  2142 done
  2143 
  2143 
  2144 lemma co2sobj_rmdir:
  2144 lemma co2sobj_rmdir:
  2145   "\<lbrakk>valid (Rmdir p f # s); alive (Rmdir p f # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Rmdir p f # s) obj = co2sobj s obj"
  2145   "\<lbrakk>valid (Rmdir p f # s); dalive (Rmdir p f # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Rmdir p f # s) obj = co2sobj s obj"
  2146 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2146 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2147 apply (simp_all add:current_files_simps cq2smsgq_other) (* ch2sshm_other*)
  2147 apply (simp_all add:current_files_simps cq2smsgq_other) (* ch2sshm_other*)
  2148 apply (auto simp:cp2sproc_simps split:option.splits if_splits
  2148 apply (auto simp:cp2sproc_simps split:option.splits if_splits
  2149            dest!:current_proc_has_sp')[1] (* intro:info_flow_shm_tainted*)
  2149            dest!:current_proc_has_sp')[1] (* intro:info_flow_shm_tainted*)
  2150 apply (simp add:is_file_simps dir_is_empty_def)
  2150 apply (simp add:is_file_simps dir_is_empty_def)
  2152 apply (simp add:cf2sfiles_other)
  2152 apply (simp add:cf2sfiles_other)
  2153 apply (auto simp:cf2sfile_simps dest:is_dir_in_current)
  2153 apply (auto simp:cf2sfile_simps dest:is_dir_in_current)
  2154 done
  2154 done
  2155 
  2155 
  2156 lemma co2sobj_mkdir:
  2156 lemma co2sobj_mkdir:
  2157   "\<lbrakk>valid (Mkdir p f i # s); alive (Mkdir p f i # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Mkdir p f i # s) obj = (
  2157   "\<lbrakk>valid (Mkdir p f i # s); dalive (Mkdir p f i # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Mkdir p f i # s) obj = (
  2158       if (obj = O_dir f) 
  2158       if (obj = D_dir f) 
  2159       then (case (cf2sfile (Mkdir p f i # s) f) of 
  2159       then (case (cf2sfile (Mkdir p f i # s) f) of 
  2160               Some sf \<Rightarrow> Some (S_dir sf)
  2160               Some sf \<Rightarrow> Some (S_dir sf)
  2161             | _       \<Rightarrow> None)
  2161             | _       \<Rightarrow> None)
  2162       else co2sobj s obj)"
  2162       else co2sobj s obj)"
  2163 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2163 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2169 apply (frule current_file_has_sfile, simp, erule exE, simp)
  2169 apply (frule current_file_has_sfile, simp, erule exE, simp)
  2170 apply (drule cf2sfile_mkdir1, simp+)
  2170 apply (drule cf2sfile_mkdir1, simp+)
  2171 done
  2171 done
  2172 
  2172 
  2173 lemma co2sobj_linkhard:
  2173 lemma co2sobj_linkhard:
  2174   "\<lbrakk>valid (LinkHard p oldf f # s); alive (LinkHard p oldf f # s) obj\<rbrakk> 
  2174   "\<lbrakk>valid (LinkHard p oldf f # s); dalive (LinkHard p oldf f # s) obj\<rbrakk> 
  2175    \<Longrightarrow> co2sobj (LinkHard p oldf f # s) obj = (
  2175    \<Longrightarrow> co2sobj (LinkHard p oldf f # s) obj = (
  2176     case obj of
  2176     case obj of
  2177       O_file f' \<Rightarrow> if (f' = f \<or> f' \<in> same_inode_files s oldf)
  2177       D_file f' \<Rightarrow> if (f' = f \<or> f' \<in> same_inode_files s oldf)
  2178                    then (case (cf2sfile (LinkHard p oldf f # s) f) of
  2178                    then (case (cf2sfile (LinkHard p oldf f # s) f) of
  2179                            Some sf \<Rightarrow> Some (S_file (cf2sfiles s oldf \<union> {sf}) (O_file oldf \<in> tainted s))
  2179                            Some sf \<Rightarrow> Some (S_file (cf2sfiles s oldf \<union> {sf}) (O_file oldf \<in> tainted s))
  2180                          | _       \<Rightarrow> None)
  2180                          | _       \<Rightarrow> None)
  2181                    else co2sobj s obj
  2181                    else co2sobj s obj
  2182     | _         \<Rightarrow> co2sobj s obj)"
  2182     | _         \<Rightarrow> co2sobj s obj)"
  2195 apply (frule current_file_has_sfile, simp)
  2195 apply (frule current_file_has_sfile, simp)
  2196 apply (drule cf2sfile_linkhard1, simp+)
  2196 apply (drule cf2sfile_linkhard1, simp+)
  2197 done
  2197 done
  2198 
  2198 
  2199 lemma co2sobj_truncate:
  2199 lemma co2sobj_truncate:
  2200   "\<lbrakk>valid (Truncate p f len # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Truncate p f len # s) obj = (
  2200   "\<lbrakk>valid (Truncate p f len # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (Truncate p f len # s) obj = (
  2201       case obj of
  2201       case obj of
  2202         O_file f' \<Rightarrow> if (f' \<in> same_inode_files s f \<and> len > 0)
  2202         D_file f' \<Rightarrow> if (f' \<in> same_inode_files s f \<and> len > 0)
  2203                      then Some (S_file (cf2sfiles s f') (O_file f' \<in> tainted s \<or> O_proc p \<in> tainted s))
  2203                      then Some (S_file (cf2sfiles s f') (O_file f' \<in> tainted s \<or> O_proc p \<in> tainted s))
  2204                      else co2sobj s obj
  2204                      else co2sobj s obj
  2205       | _         \<Rightarrow> co2sobj s obj)"
  2205       | _         \<Rightarrow> co2sobj s obj)"
  2206 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2206 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2207 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other) (* ch2sshm_other *)
  2207 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other) (* ch2sshm_other *)
  2211                   same_inode_files_prop6
  2211                   same_inode_files_prop6
  2212              dest:is_file_in_current is_dir_in_current)
  2212              dest:is_file_in_current is_dir_in_current)
  2213 done
  2213 done
  2214 
  2214 
  2215 lemma co2sobj_kill:
  2215 lemma co2sobj_kill:
  2216   "\<lbrakk>valid (Kill p p' # s); alive (Kill p p' # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Kill p p' # s) obj = co2sobj s obj"
  2216   "\<lbrakk>valid (Kill p p' # s); dalive (Kill p p' # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Kill p p' # s) obj = co2sobj s obj"
  2217 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2217 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2218 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other) (* ch2sshm_other *)
  2218 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other) (* ch2sshm_other *)
  2219 apply (auto split:if_splits option.splits dest!:current_file_has_sfile' current_proc_has_sp'
  2219 apply (auto split:if_splits option.splits dest!:current_file_has_sfile' current_proc_has_sp'
  2220              simp:current_files_simps cf2sfiles_simps cf2sfile_simps cp2sproc_simps 
  2220              simp:current_files_simps cf2sfiles_simps cf2sfile_simps cp2sproc_simps 
  2221                   same_inode_files_prop6
  2221                   same_inode_files_prop6
  2222              dest:is_file_in_current is_dir_in_current)
  2222              dest:is_file_in_current is_dir_in_current)
  2223 done
  2223 done
  2224 
  2224 
  2225 lemma co2sobj_exit:
  2225 lemma co2sobj_exit:
  2226   "\<lbrakk>valid (Exit p # s); alive (Exit p # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Exit p # s) obj = co2sobj s obj"
  2226   "\<lbrakk>valid (Exit p # s); dalive (Exit p # s) obj\<rbrakk> \<Longrightarrow> co2sobj (Exit p # s) obj = co2sobj s obj"
  2227 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2227 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2228 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other)
  2228 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other)
  2229 apply (auto split:if_splits option.splits dest!:current_file_has_sfile' current_proc_has_sp'
  2229 apply (auto split:if_splits option.splits dest!:current_file_has_sfile' current_proc_has_sp'
  2230              simp:current_files_simps cf2sfiles_simps cf2sfile_simps cp2sproc_simps
  2230              simp:current_files_simps cf2sfiles_simps cf2sfile_simps cp2sproc_simps
  2231                   same_inode_files_prop6
  2231                   same_inode_files_prop6
  2232              dest:is_file_in_current is_dir_in_current)
  2232              dest:is_file_in_current is_dir_in_current)
  2233 done
  2233 done
  2234 
  2234 
  2235 lemma co2sobj_createmsgq:
  2235 lemma co2sobj_createmsgq:
  2236   "\<lbrakk>valid (CreateMsgq p q # s); alive (CreateMsgq p q # s) obj\<rbrakk> \<Longrightarrow> co2sobj (CreateMsgq p q # s) obj = (
  2236   "\<lbrakk>valid (CreateMsgq p q # s); dalive (CreateMsgq p q # s) obj\<rbrakk> \<Longrightarrow> co2sobj (CreateMsgq p q # s) obj = (
  2237       case obj of
  2237       case obj of
  2238         O_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (CreateMsgq p q # s) q) of
  2238         D_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (CreateMsgq p q # s) q) of
  2239                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2239                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2240                                        | _       \<Rightarrow> None)
  2240                                        | _       \<Rightarrow> None)
  2241                      else co2sobj s obj
  2241                      else co2sobj s obj
  2242       | _        \<Rightarrow> co2sobj s obj)"
  2242       | _        \<Rightarrow> co2sobj s obj)"
  2243 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2243 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2248              dest!:current_has_smsgq'
  2248              dest!:current_has_smsgq'
  2249              dest:is_file_in_current is_dir_in_current cq2smsg_createmsgq)
  2249              dest:is_file_in_current is_dir_in_current cq2smsg_createmsgq)
  2250 done
  2250 done
  2251 
  2251 
  2252 lemma co2sobj_sendmsg:
  2252 lemma co2sobj_sendmsg:
  2253   "\<lbrakk>valid (SendMsg p q m # s); alive (SendMsg p q m # s) obj\<rbrakk> \<Longrightarrow> co2sobj (SendMsg p q m # s) obj = (
  2253   "\<lbrakk>valid (SendMsg p q m # s); dalive (SendMsg p q m # s) obj\<rbrakk> \<Longrightarrow> co2sobj (SendMsg p q m # s) obj = (
  2254       case obj of
  2254       case obj of
  2255         O_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (SendMsg p q m # s) q) of
  2255         D_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (SendMsg p q m # s) q) of
  2256                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2256                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2257                                        | _       \<Rightarrow> None)
  2257                                        | _       \<Rightarrow> None)
  2258                      else co2sobj s obj
  2258                      else co2sobj s obj
  2259       | _        \<Rightarrow> co2sobj s obj)"
  2259       | _        \<Rightarrow> co2sobj s obj)"
  2260 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2260 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2265              dest!:current_has_smsgq'
  2265              dest!:current_has_smsgq'
  2266              dest:is_file_in_current is_dir_in_current cq2smsg_sendmsg)
  2266              dest:is_file_in_current is_dir_in_current cq2smsg_sendmsg)
  2267 done
  2267 done
  2268 
  2268 
  2269 lemma co2sobj_recvmsg:
  2269 lemma co2sobj_recvmsg:
  2270   "\<lbrakk>valid (RecvMsg p q m # s); alive (RecvMsg p q m # s) obj\<rbrakk> \<Longrightarrow> co2sobj (RecvMsg p q m # s) obj = (
  2270   "\<lbrakk>valid (RecvMsg p q m # s); dalive (RecvMsg p q m # s) obj\<rbrakk> \<Longrightarrow> co2sobj (RecvMsg p q m # s) obj = (
  2271       case obj of
  2271       case obj of
  2272         O_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (RecvMsg p q m # s) q) of
  2272         D_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (RecvMsg p q m # s) q) of
  2273                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2273                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2274                                        | _       \<Rightarrow> None)
  2274                                        | _       \<Rightarrow> None)
  2275                      else co2sobj s obj
  2275                      else co2sobj s obj
  2276       | O_proc p' \<Rightarrow> if (p' = p \<and> O_msg q m \<in> tainted s)
  2276       | D_proc p' \<Rightarrow> if (p' = p \<and> O_msg q m \<in> tainted s)
  2277                      then (case (cp2sproc s p') of
  2277                      then (case (cp2sproc s p') of
  2278                              Some sp \<Rightarrow> Some (S_proc sp True)
  2278                              Some sp \<Rightarrow> Some (S_proc sp True)
  2279                            | _       \<Rightarrow> None)
  2279                            | _       \<Rightarrow> None)
  2280                      else co2sobj s obj
  2280                      else co2sobj s obj
  2281       | _         \<Rightarrow> co2sobj s obj)"
  2281       | _         \<Rightarrow> co2sobj s obj)"
  2287              dest!:current_has_smsgq'
  2287              dest!:current_has_smsgq'
  2288              dest:is_file_in_current is_dir_in_current cq2smsg_recvmsg)
  2288              dest:is_file_in_current is_dir_in_current cq2smsg_recvmsg)
  2289 done
  2289 done
  2290 (*
  2290 (*
  2291 lemma co2sobj_recvmsg:
  2291 lemma co2sobj_recvmsg:
  2292   "\<lbrakk>valid (RecvMsg p q m # s); alive (RecvMsg p q m # s) obj\<rbrakk> \<Longrightarrow> co2sobj (RecvMsg p q m # s) obj = (
  2292   "\<lbrakk>valid (RecvMsg p q m # s); dalive (RecvMsg p q m # s) obj\<rbrakk> \<Longrightarrow> co2sobj (RecvMsg p q m # s) obj = (
  2293       case obj of
  2293       case obj of
  2294         O_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (RecvMsg p q m # s) q) of
  2294         O_msgq q' \<Rightarrow> if (q' = q) then (case (cq2smsgq (RecvMsg p q m # s) q) of
  2295                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2295                                          Some sq \<Rightarrow> Some (S_msgq sq)
  2296                                        | _       \<Rightarrow> None)
  2296                                        | _       \<Rightarrow> None)
  2297                      else co2sobj s obj
  2297                      else co2sobj s obj
  2310              dest:is_file_in_current is_dir_in_current cq2smsg_recvmsg)
  2310              dest:is_file_in_current is_dir_in_current cq2smsg_recvmsg)
  2311 done
  2311 done
  2312 *)
  2312 *)
  2313 
  2313 
  2314 lemma co2sobj_removemsgq:
  2314 lemma co2sobj_removemsgq:
  2315   "\<lbrakk>valid (RemoveMsgq p q # s); alive (RemoveMsgq p q # s) obj\<rbrakk> 
  2315   "\<lbrakk>valid (RemoveMsgq p q # s); dalive (RemoveMsgq p q # s) obj\<rbrakk> 
  2316    \<Longrightarrow> co2sobj (RemoveMsgq p q # s) obj = co2sobj s obj"
  2316    \<Longrightarrow> co2sobj (RemoveMsgq p q # s) obj = co2sobj s obj"
  2317 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2317 apply (frule vt_grant_os, frule vd_cons, case_tac obj)
  2318 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other)
  2318 apply (simp_all add:current_files_simps is_dir_simps cq2smsgq_other)
  2319 apply (auto split:if_splits option.splits dest!:current_file_has_sfile' current_proc_has_sp'
  2319 apply (auto split:if_splits option.splits dest!:current_file_has_sfile' current_proc_has_sp'
  2320              simp:current_files_simps cf2sfiles_simps cf2sfile_simps cp2sproc_simps
  2320              simp:current_files_simps cf2sfiles_simps cf2sfile_simps cp2sproc_simps
  2323              dest:is_file_in_current is_dir_in_current cq2smsg_removemsgq)
  2323              dest:is_file_in_current is_dir_in_current cq2smsg_removemsgq)
  2324 done
  2324 done
  2325 
  2325 
  2326 (*
  2326 (*
  2327 lemma co2sobj_createshm:
  2327 lemma co2sobj_createshm:
  2328   "\<lbrakk>valid (CreateShM p h # s); alive (CreateShM p h # s) obj\<rbrakk> \<Longrightarrow> co2sobj (CreateShM p h # s) obj = (
  2328   "\<lbrakk>valid (CreateShM p h # s); dalive (CreateShM p h # s) obj\<rbrakk> \<Longrightarrow> co2sobj (CreateShM p h # s) obj = (
  2329       case obj of 
  2329       case obj of 
  2330         O_shm h' \<Rightarrow> if (h' = h) then (case (ch2sshm (CreateShM p h # s) h) of
  2330         O_shm h' \<Rightarrow> if (h' = h) then (case (ch2sshm (CreateShM p h # s) h) of
  2331                                         Some sh \<Rightarrow> Some (S_shm sh)
  2331                                         Some sh \<Rightarrow> Some (S_shm sh)
  2332                                       | _       \<Rightarrow> None)
  2332                                       | _       \<Rightarrow> None)
  2333                     else co2sobj s obj
  2333                     else co2sobj s obj
  2340              dest!:current_shm_has_sh'
  2340              dest!:current_shm_has_sh'
  2341              dest:is_file_in_current is_dir_in_current)
  2341              dest:is_file_in_current is_dir_in_current)
  2342 done
  2342 done
  2343 
  2343 
  2344 lemma co2sobj_detach:
  2344 lemma co2sobj_detach:
  2345   "\<lbrakk>valid (Detach p h # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Detach p h # s) obj = (
  2345   "\<lbrakk>valid (Detach p h # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (Detach p h # s) obj = (
  2346       case obj of
  2346       case obj of
  2347         O_proc p' \<Rightarrow> if (p' = p) then (case (cp2sproc (Detach p h # s) p) of
  2347         O_proc p' \<Rightarrow> if (p' = p) then (case (cp2sproc (Detach p h # s) p) of
  2348                                          Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  2348                                          Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
  2349                                        | _       \<Rightarrow> None)
  2349                                        | _       \<Rightarrow> None)
  2350                      else co2sobj s obj
  2350                      else co2sobj s obj
  2358              dest!:current_shm_has_sh'
  2358              dest!:current_shm_has_sh'
  2359              dest:is_file_in_current is_dir_in_current)
  2359              dest:is_file_in_current is_dir_in_current)
  2360 done
  2360 done
  2361 
  2361 
  2362 lemma co2sobj_deleteshm:
  2362 lemma co2sobj_deleteshm:
  2363   "\<lbrakk>valid (DeleteShM p h # s); alive (DeleteShM p h # s) obj\<rbrakk> \<Longrightarrow> co2sobj (DeleteShM p h # s) obj = (
  2363   "\<lbrakk>valid (DeleteShM p h # s); dalive (DeleteShM p h # s) obj\<rbrakk> \<Longrightarrow> co2sobj (DeleteShM p h # s) obj = (
  2364       case obj of
  2364       case obj of
  2365         O_proc p' \<Rightarrow> (case (cp2sproc (DeleteShM p h # s) p') of
  2365         O_proc p' \<Rightarrow> (case (cp2sproc (DeleteShM p h # s) p') of
  2366                         Some sp \<Rightarrow> Some (S_proc sp (O_proc p' \<in> tainted s))
  2366                         Some sp \<Rightarrow> Some (S_proc sp (O_proc p' \<in> tainted s))
  2367                       | _       \<Rightarrow> None)
  2367                       | _       \<Rightarrow> None)
  2368       | _         \<Rightarrow> co2sobj s obj)"
  2368       | _         \<Rightarrow> co2sobj s obj)"
  2383 lemma info_flow_shm_prop1:
  2383 lemma info_flow_shm_prop1:
  2384   "p \<in> current_procs s \<Longrightarrow> info_flow_shm s p p"
  2384   "p \<in> current_procs s \<Longrightarrow> info_flow_shm s p p"
  2385 by (simp add:info_flow_shm_def)
  2385 by (simp add:info_flow_shm_def)
  2386 
  2386 
  2387 lemma co2sobj_attach:
  2387 lemma co2sobj_attach:
  2388   "\<lbrakk>valid (Attach p h flag # s); alive s obj\<rbrakk> \<Longrightarrow> co2sobj (Attach p h flag # s) obj = (
  2388   "\<lbrakk>valid (Attach p h flag # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (Attach p h flag # s) obj = (
  2389       case obj of
  2389       case obj of
  2390         O_proc p' \<Rightarrow> if (info_flow_shm s p p')
  2390         O_proc p' \<Rightarrow> if (info_flow_shm s p p')
  2391                      then (case (cp2sproc (Attach p h flag # s) p') of
  2391                      then (case (cp2sproc (Attach p h flag # s) p') of
  2392                              Some sp \<Rightarrow> Some (S_proc sp (O_proc p' \<in> tainted s \<or> 
  2392                              Some sp \<Rightarrow> Some (S_proc sp (O_proc p' \<in> tainted s \<or> 
  2393               (\<exists> p''. O_proc p'' \<in> tainted s \<and> (p'', SHM_RDWR) \<in> procs_of_shm s h)))
  2393               (\<exists> p''. O_proc p'' \<in> tainted s \<and> (p'', SHM_RDWR) \<in> procs_of_shm s h)))
  2424                   same_inode_files_prop6 
  2424                   same_inode_files_prop6 
  2425              dest:is_file_in_current is_dir_in_current)
  2425              dest:is_file_in_current is_dir_in_current)
  2426 done
  2426 done
  2427 *)
  2427 *)
  2428 
  2428 
       
  2429 lemma co2sobj_bind:
       
  2430   "valid (Bind p fd addr # s) \<Longrightarrow> co2sobj (Bind p fd addr # s) = co2sobj s"
       
  2431 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2432 by auto
       
  2433 
       
  2434 lemma co2sobj_connect:
       
  2435   "valid (Connect p fd addr # s) \<Longrightarrow> co2sobj (Connect p fd addr # s) = co2sobj s"
       
  2436 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2437 by auto
       
  2438 
       
  2439 lemma co2sobj_createsock:
       
  2440   "valid (CreateSock p af st fd inum # s) \<Longrightarrow> co2sobj (CreateSock p af st fd inum # s) = co2sobj s"
       
  2441 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2442 by auto
       
  2443 
       
  2444 lemma co2sobj_accept:
       
  2445   "valid (Accept p fd addr port fd' inum # s) \<Longrightarrow> co2sobj (Accept p fd addr port fd' inum # s) = co2sobj s"
       
  2446 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2447 by auto
       
  2448 
       
  2449 lemma co2sobj_listen:
       
  2450   "valid (Listen p fd # s) \<Longrightarrow> co2sobj (Listen p fd # s) = co2sobj s"
       
  2451 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2452 by auto
       
  2453 lemma co2sobj_sendsock:
       
  2454   "valid (SendSock p fd # s) \<Longrightarrow> co2sobj (SendSock p fd # s) = co2sobj s"
       
  2455 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2456 by auto
       
  2457 lemma co2sobj_recvsock:
       
  2458   "valid (RecvSock p fd # s) \<Longrightarrow> co2sobj (RecvSock p fd # s) = co2sobj s"
       
  2459 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2460 by auto
       
  2461 lemma co2sobj_shutdown:
       
  2462   "valid (Shutdown p fd addr # s) \<Longrightarrow> co2sobj (Shutdown p fd addr # s) = co2sobj s"
       
  2463 apply (frule vd_cons, frule vt_grant, rule ext, case_tac x)
       
  2464 by auto
       
  2465 
  2429 lemma co2sobj_other:
  2466 lemma co2sobj_other:
  2430   "\<lbrakk>valid (e # s); alive (e # s) obj; 
  2467   "\<lbrakk>valid (e # s); dalive (e # s) obj; 
  2431     \<forall> p f fds. e \<noteq> Execve p f fds;
  2468     \<forall> p f fds. e \<noteq> Execve p f fds;
  2432     \<forall> p p' fds. e \<noteq> Clone p p' fds;
  2469     \<forall> p p' fds. e \<noteq> Clone p p' fds;
  2433     \<forall> p p'. e \<noteq> Ptrace p p';
  2470     \<forall> p p'. e \<noteq> Ptrace p p';
  2434     \<forall> p f flags fd opt. e \<noteq> Open p f flags fd opt;
  2471     \<forall> p f flags fd opt. e \<noteq> Open p f flags fd opt;
  2435     \<forall> p fd. e \<noteq> ReadFile p fd;
  2472     \<forall> p fd. e \<noteq> ReadFile p fd;
  2454 
  2491 
  2455 lemmas co2sobj_simps = co2sobj_execve co2sobj_clone co2sobj_ptrace co2sobj_open co2sobj_readfile
  2492 lemmas co2sobj_simps = co2sobj_execve co2sobj_clone co2sobj_ptrace co2sobj_open co2sobj_readfile
  2456   co2sobj_writefile co2sobj_closefd co2sobj_unlink co2sobj_rmdir co2sobj_mkdir co2sobj_linkhard
  2493   co2sobj_writefile co2sobj_closefd co2sobj_unlink co2sobj_rmdir co2sobj_mkdir co2sobj_linkhard
  2457   co2sobj_truncate co2sobj_kill co2sobj_exit co2sobj_createmsgq co2sobj_sendmsg co2sobj_recvmsg
  2494   co2sobj_truncate co2sobj_kill co2sobj_exit co2sobj_createmsgq co2sobj_sendmsg co2sobj_recvmsg
  2458   co2sobj_removemsgq (* co2sobj_attach co2sobj_detach co2sobj_createshm co2sobj_deleteshm *)
  2495   co2sobj_removemsgq (* co2sobj_attach co2sobj_detach co2sobj_createshm co2sobj_deleteshm *)
  2459 
  2496   co2sobj_createsock co2sobj_accept co2sobj_listen co2sobj_sendsock co2sobj_recvsock 
  2460 
  2497   co2sobj_shutdown co2sobj_bind co2sobj_connect
  2461 
  2498 
  2462 end
  2499 end
  2463 
  2500 
  2464 (*<*)
  2501 (*<*)
  2465 end
  2502 end