diff -r e79e3a8a4ceb -r cebdef333899 no_shm_selinux/Enrich.thy --- a/no_shm_selinux/Enrich.thy Thu Dec 26 10:56:50 2013 +0800 +++ b/no_shm_selinux/Enrich.thy Mon Dec 30 12:01:09 2013 +0800 @@ -103,14 +103,37 @@ apply (induct s, simp) by (case_tac a, auto) +lemma not_all_msgqs_cons: + "p \ all_msgqs (e # s) \ p \ all_msgqs s" +by (case_tac e, auto) + +lemma not_all_msgqs_prop: + "\p' \ all_msgqs s; p \ current_msgqs s; valid s\ \ p' \ p" +apply (induct s, rule notI, simp) +apply (frule vt_grant_os, frule vd_cons, frule not_all_msgqs_cons, simp, rule notI) +apply (case_tac a, auto) +done + +lemma not_all_msgqs_prop2: + "p' \ all_msgqs s \ p' \ init_msgqs" +apply (induct s, simp) +by (case_tac a, auto) + +lemma not_all_msgqs_prop3: + "p' \ all_msgqs s \ p' \ current_msgqs s" +apply (induct s, simp) +by (case_tac a, auto) + fun enrich_not_alive :: "t_state \ t_enrich_obj \ t_enrich_obj \ bool" where - "enrich_not_alive s obj (E_file f) = (f \ current_files s \ E_file f \ obj)" -| "enrich_not_alive s obj (E_proc p) = (p \ current_procs s \ E_proc p \ obj)" -| "enrich_not_alive s obj (E_fd p fd) = ((p \ current_procs s \ fd \ current_proc_fds s p) \ E_fd p fd \ obj)" -| "enrich_not_alive s obj (E_msgq q) = (q \ current_msgqs s \ E_msgq q \ obj)" -| "enrich_not_alive s obj (E_inum i) = (i \ current_inode_nums s \ E_inum i \ obj)" -| "enrich_not_alive s obj (E_msg q m) = ((q \ current_msgqs s \ m \ set (msgs_of_queue s q)) \ E_msg q m \ obj)" + "enrich_not_alive s obj (E_file f) = (f \ current_files s \ obj \ E_file f)" +| "enrich_not_alive s obj (E_proc p) = (p \ current_procs s \ obj \ E_proc p)" +| "enrich_not_alive s obj (E_fd p fd) = + ((p \ current_procs s \ fd \ current_proc_fds s p) \ obj \ E_fd p fd \ obj \ E_proc p)" +| "enrich_not_alive s obj (E_msgq q) = (q \ current_msgqs s \ obj \ E_msgq q)" +| "enrich_not_alive s obj (E_inum i) = (i \ current_inode_nums s \ obj \ E_inum i)" +| "enrich_not_alive s obj (E_msg q m) = + ((q \ current_msgqs s \ m \ set (msgs_of_queue s q)) \ obj \ E_msg q m \ obj \ E_msgq q)" lemma file_has_parent: "\is_file s f; valid s\ \ \ pf. is_dir s pf \ parent f = Some pf" apply (case_tac f) @@ -538,7 +561,8 @@ using os alive' p_in notin_all Open None apply (erule_tac x = "E_fd p fd" in allE) apply (case_tac obj') - by auto + apply (auto dest:not_all_procs_prop3) + done have "os_grant s' e" using p_in f_in fd_not_in os by (simp add:Open None) moreover have "grant s' e" @@ -589,7 +613,7 @@ have fd_not_in: "fd \ current_proc_fds s' p" using os alive' p_in Open Some notin_all apply (erule_tac x = "E_fd p fd" in allE) - apply (case_tac obj', auto) + apply (case_tac obj', auto dest:not_all_procs_prop3) done have inum_not_in: "inum \ current_inode_nums s'" using os alive' Open Some notin_all @@ -1116,8 +1140,8 @@ by (simp add:SendMsg) have m_not_in: "m \ set (msgs_of_queue s' q)" using os alive' notin_all SendMsg q_in apply (erule_tac x = "E_msg q m" in allE) - apply (case_tac obj') - by auto + apply (case_tac obj', auto dest:not_all_msgqs_prop3) + done have "os_grant s' e" using p_in q_in m_not_in by (simp add:SendMsg) moreover have "grant s' e"