blob: 4d169f3587ccb85fe57a2b03c3f5d63dc63a09b7 [file] [log] [blame]
Stephen Smalley2dd4e512012-01-04 12:33:27 -05001# zygote
2type zygote, domain;
3type zygote_exec, exec_type, file_type;
4
5init_daemon_domain(zygote)
Nick Kralevich6aca5152013-07-01 12:07:03 -07006typeattribute zygote mlstrustedsubject;
7# Override DAC on files and switch uid/gid.
Narayan Kamath3a06a722014-04-28 15:17:29 +01008allow zygote self:capability { dac_override setgid setuid fowner chown };
Nick Kralevich6aca5152013-07-01 12:07:03 -07009# Drop capabilities from bounding set.
10allow zygote self:capability setpcap;
11# Switch SELinux context to app domains.
Alex Klyubin1fdee112013-09-13 15:59:04 -070012allow zygote system_server:process dyntransition;
Nick Kralevich6aca5152013-07-01 12:07:03 -070013allow zygote appdomain:process dyntransition;
Nick Kraleviche9c41812013-09-20 13:09:37 -070014# Allow zygote to read app /proc/pid dirs (b/10455872)
Geremy Condra81560732013-08-30 13:02:30 -070015allow zygote appdomain:dir { getattr search };
Nick Kralevich199fc732013-09-20 13:03:04 -070016allow zygote appdomain:file { r_file_perms };
Nick Kralevich6aca5152013-07-01 12:07:03 -070017# Move children into the peer process group.
Alex Klyubin1fdee112013-09-13 15:59:04 -070018allow zygote system_server:process { getpgid setpgid };
Nick Kralevich6aca5152013-07-01 12:07:03 -070019allow zygote appdomain:process { getpgid setpgid };
Stephen Smalleydf48bd22014-05-14 08:58:06 -040020# Read system data.
21allow zygote system_data_file:dir r_dir_perms;
22allow zygote system_data_file:file r_file_perms;
23# Write to /data/dalvik-cache.
Narayan Kamath3a06a722014-04-28 15:17:29 +010024allow zygote dalvikcache_data_file:dir create_dir_perms;
Stephen Smalley49c995d2014-01-09 09:27:15 -050025allow zygote dalvikcache_data_file:file create_file_perms;
26# For art.
27allow zygote dalvikcache_data_file:file execute;
Nick Kralevich6aca5152013-07-01 12:07:03 -070028# Execute dexopt.
29allow zygote system_file:file x_file_perms;
30# Control cgroups.
31allow zygote cgroup:dir create_dir_perms;
32allow zygote self:capability sys_admin;
33# Check validity of SELinux context before use.
34selinux_check_context(zygote)
35# Check SELinux permissions.
36selinux_check_access(zygote)
37# Read /seapp_contexts and /data/security/seapp_contexts
38security_access_policy(zygote)
39
40# Setting up /storage/emulated.
41allow zygote rootfs:dir mounton;
42allow zygote sdcard_type:dir { write search setattr create add_name mounton };
43dontaudit zygote self:capability fsetid;
44allow zygote tmpfs:dir { write create add_name setattr mounton search };
45allow zygote tmpfs:filesystem mount;
46allow zygote labeledfs:filesystem remount;
47
48# Handle --invoke-with command when launching Zygote with a wrapper command.
Stephen Smalley3bfdc6b2014-03-10 10:31:09 -040049allow zygote zygote_exec:file rx_file_perms;