blob: 225f431777f372a770a7ee4068c49199934b39dd [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.
Geremy Condrad615ef32013-09-04 16:07:37 -07008allow zygote self:capability { dac_override setgid setuid fowner };
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 };
20# Write to system data.
21allow zygote system_data_file:dir rw_dir_perms;
22allow zygote system_data_file:file create_file_perms;
23allow zygote dalvikcache_data_file:dir rw_dir_perms;
Stephen Smalley49c995d2014-01-09 09:27:15 -050024allow zygote dalvikcache_data_file:file create_file_perms;
25# For art.
26allow zygote dalvikcache_data_file:file execute;
Nick Kralevich6aca5152013-07-01 12:07:03 -070027# Execute dexopt.
28allow zygote system_file:file x_file_perms;
29# Control cgroups.
30allow zygote cgroup:dir create_dir_perms;
31allow zygote self:capability sys_admin;
32# Check validity of SELinux context before use.
33selinux_check_context(zygote)
34# Check SELinux permissions.
35selinux_check_access(zygote)
36# Read /seapp_contexts and /data/security/seapp_contexts
37security_access_policy(zygote)
38
39# Setting up /storage/emulated.
40allow zygote rootfs:dir mounton;
41allow zygote sdcard_type:dir { write search setattr create add_name mounton };
42dontaudit zygote self:capability fsetid;
43allow zygote tmpfs:dir { write create add_name setattr mounton search };
44allow zygote tmpfs:filesystem mount;
45allow zygote labeledfs:filesystem remount;
46
47# Handle --invoke-with command when launching Zygote with a wrapper command.
Stephen Smalley3bfdc6b2014-03-10 10:31:09 -040048allow zygote zygote_exec:file rx_file_perms;
Nick Kralevichd629b872013-09-09 15:40:15 -070049
50# handle bugreports b/10498304
51allow zygote ashmem_device:chr_file execute;
Nick Kralevichd629b872013-09-09 15:40:15 -070052allow zygote shell_data_file:file { write getattr };
Alex Klyubin82140be2013-09-17 10:07:01 -070053allow zygote system_server:binder { transfer call };
Alex Klyubinb9bbfeb2013-09-09 17:17:08 -070054allow zygote servicemanager:binder { call };
dcashman66f25cb2014-03-05 10:18:12 -080055
56auditallow zygote ashmem_device:chr_file execute;
57auditallow zygote shell_data_file:file { write getattr };
58auditallow zygote system_server:binder { transfer call };
59auditallow zygote servicemanager:binder { call };