Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 1 | # zygote |
| 2 | type zygote, domain; |
| 3 | type zygote_exec, exec_type, file_type; |
| 4 | |
| 5 | init_daemon_domain(zygote) |
| 6 | typeattribute zygote mlstrustedsubject; |
| 7 | # Override DAC on files and switch uid/gid. |
| 8 | allow zygote self:capability { dac_override setgid setuid }; |
Stephen Smalley | e468016 | 2013-02-19 13:17:38 -0500 | [diff] [blame] | 9 | # Drop capabilities from bounding set. |
| 10 | allow zygote self:capability setpcap; |
Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 11 | # Switch SELinux context to app domains. |
| 12 | allow zygote system:process dyntransition; |
| 13 | allow zygote appdomain:process dyntransition; |
| 14 | # Move children into the peer process group. |
| 15 | allow zygote system:process { getpgid setpgid }; |
| 16 | allow zygote appdomain:process { getpgid setpgid }; |
| 17 | # Write to system data. |
| 18 | allow zygote system_data_file:dir rw_dir_perms; |
| 19 | allow zygote system_data_file:file create_file_perms; |
| 20 | allow zygote dalvikcache_data_file:dir rw_dir_perms; |
| 21 | allow zygote dalvikcache_data_file:file create_file_perms; |
| 22 | # Execute dexopt. |
| 23 | allow zygote system_file:file x_file_perms; |
| 24 | # Control cgroups. |
| 25 | allow zygote cgroup:dir create_dir_perms; |
| 26 | allow zygote self:capability sys_admin; |
| 27 | # Check validity of SELinux context before use. |
| 28 | selinux_check_context(zygote) |
| 29 | # Check SELinux permissions. |
| 30 | selinux_check_access(zygote) |
| 31 | # Read /seapp_contexts, presently on the rootfs. |
| 32 | allow zygote rootfs:file r_file_perms; |
| 33 | |
Stephen Smalley | 61c80d5 | 2012-11-16 09:06:47 -0500 | [diff] [blame] | 34 | # Setting up /storage/emulated. |
| 35 | allow zygote rootfs:dir mounton; |
William Roberts | c195ec3 | 2013-03-06 16:26:36 -0800 | [diff] [blame] | 36 | allow zygote sdcard_type:dir { write search setattr create add_name mounton }; |
Stephen Smalley | 61c80d5 | 2012-11-16 09:06:47 -0500 | [diff] [blame] | 37 | dontaudit zygote self:capability fsetid; |
| 38 | allow zygote tmpfs:dir { write create add_name setattr mounton }; |
| 39 | allow zygote tmpfs:filesystem mount; |