432 | "procs_of_shm (CreateShM p h # \<tau>) = |
432 | "procs_of_shm (CreateShM p h # \<tau>) = |
433 (procs_of_shm \<tau>) (h := {})" (* creator may not be the sharer of the shm *) |
433 (procs_of_shm \<tau>) (h := {})" (* creator may not be the sharer of the shm *) |
434 | "procs_of_shm (Attach p h flag # \<tau>) = |
434 | "procs_of_shm (Attach p h flag # \<tau>) = |
435 (procs_of_shm \<tau>) (h := insert (p, flag) (procs_of_shm \<tau> h))" |
435 (procs_of_shm \<tau>) (h := insert (p, flag) (procs_of_shm \<tau> h))" |
436 | "procs_of_shm (Detach p h # \<tau>) = |
436 | "procs_of_shm (Detach p h # \<tau>) = |
437 (procs_of_shm \<tau>) (h := (procs_of_shm \<tau> h) - {(p,flag). \<exists> flag. (p, flag) \<in> procs_of_shm \<tau> h})" |
437 (procs_of_shm \<tau>) (h := (procs_of_shm \<tau> h) - {(p,flag) | flag. (p, flag) \<in> procs_of_shm \<tau> h})" |
438 | "procs_of_shm (DeleteShM p h # \<tau>) = (procs_of_shm \<tau>) (h := {})" |
438 | "procs_of_shm (DeleteShM p h # \<tau>) = (procs_of_shm \<tau>) (h := {})" |
439 | "procs_of_shm (Clone p p' fds shms # \<tau>) = |
439 | "procs_of_shm (Clone p p' fds shms # \<tau>) = |
440 (\<lambda> h. if (h \<in> shms) |
440 (\<lambda> h. if (h \<in> shms) |
441 then (procs_of_shm \<tau> h) \<union> {(p', flag). \<exists> flag. (p, flag) \<in> procs_of_shm \<tau> h} |
441 then (procs_of_shm \<tau> h) \<union> {(p', flag) | flag. (p, flag) \<in> procs_of_shm \<tau> h} |
442 else procs_of_shm \<tau> h)" |
442 else procs_of_shm \<tau> h)" |
443 | "procs_of_shm (Execve p f fds # \<tau>) = |
443 | "procs_of_shm (Execve p f fds # \<tau>) = |
444 (\<lambda> h. procs_of_shm \<tau> h - {(p, flag). \<exists> flag. (p, flag) \<in> procs_of_shm \<tau> h})" |
444 (\<lambda> h. procs_of_shm \<tau> h - {(p, flag) | flag. (p, flag) \<in> procs_of_shm \<tau> h})" |
445 | "procs_of_shm (e # \<tau>) = procs_of_shm \<tau>" |
445 | "procs_of_shm (Kill p p' # s) = |
|
446 (\<lambda> h. (procs_of_shm s h) - {(p', flag) | flag. (p', flag) \<in> procs_of_shm s h})" |
|
447 | "procs_of_shm (Exit p # s) = |
|
448 (\<lambda> h. (procs_of_shm s h) - {(p, flag) | flag. (p, flag) \<in> procs_of_shm s h})" |
|
449 | "procs_of_shm (e # \<tau>) = procs_of_shm \<tau>" |
446 |
450 |
447 definition info_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool" |
451 definition info_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool" |
448 where |
452 where |
449 "info_flow_shm \<tau> from to \<equiv> (from = to) \<or> (\<exists> h \<in> current_shms \<tau>. \<exists> toflag. |
453 "info_flow_shm \<tau> from to \<equiv> (from = to) \<or> (\<exists> h \<in> current_shms \<tau>. \<exists> toflag. |
450 (((from, SHM_RDWR) \<in> procs_of_shm \<tau> h) \<and> ((to, toflag) \<in> procs_of_shm \<tau> h)))" |
454 (((from, SHM_RDWR) \<in> procs_of_shm \<tau> h) \<and> ((to, toflag) \<in> procs_of_shm \<tau> h)))" |