2012-01-04 18:33:27 +01:00
|
|
|
# zygote
|
2015-11-03 18:54:39 +01:00
|
|
|
type zygote, domain, domain_deprecated;
|
2012-01-04 18:33:27 +01:00
|
|
|
type zygote_exec, exec_type, file_type;
|
|
|
|
|
2013-07-01 21:07:03 +02:00
|
|
|
typeattribute zygote mlstrustedsubject;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2013-07-01 21:07:03 +02:00
|
|
|
# Override DAC on files and switch uid/gid.
|
2014-04-28 16:17:29 +02:00
|
|
|
allow zygote self:capability { dac_override setgid setuid fowner chown };
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2013-07-01 21:07:03 +02:00
|
|
|
# Drop capabilities from bounding set.
|
|
|
|
allow zygote self:capability setpcap;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2013-07-01 21:07:03 +02:00
|
|
|
# Switch SELinux context to app domains.
|
2014-05-23 17:26:19 +02:00
|
|
|
allow zygote self:process setcurrent;
|
2013-09-14 00:59:04 +02:00
|
|
|
allow zygote system_server:process dyntransition;
|
2017-01-19 19:56:18 +01:00
|
|
|
allow zygote appdomain:process dyntransition;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
|
|
|
# Allow zygote to read app /proc/pid dirs (b/10455872).
|
2017-01-19 19:56:18 +01:00
|
|
|
allow zygote appdomain:dir { getattr search };
|
|
|
|
allow zygote appdomain:file { r_file_perms };
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2013-07-01 21:07:03 +02:00
|
|
|
# Move children into the peer process group.
|
2013-09-14 00:59:04 +02:00
|
|
|
allow zygote system_server:process { getpgid setpgid };
|
2017-01-19 19:56:18 +01:00
|
|
|
allow zygote appdomain:process { getpgid setpgid };
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2014-05-14 14:58:06 +02:00
|
|
|
# Read system data.
|
|
|
|
allow zygote system_data_file:dir r_dir_perms;
|
|
|
|
allow zygote system_data_file:file r_file_perms;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2014-05-14 14:58:06 +02:00
|
|
|
# Write to /data/dalvik-cache.
|
2014-04-28 16:17:29 +02:00
|
|
|
allow zygote dalvikcache_data_file:dir create_dir_perms;
|
2014-01-09 15:27:15 +01:00
|
|
|
allow zygote dalvikcache_data_file:file create_file_perms;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
|
|
|
# Create symlinks in /data/dalvik-cache.
|
2014-10-24 23:22:12 +02:00
|
|
|
allow zygote dalvikcache_data_file:lnk_file create_file_perms;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
|
|
|
# Write to /data/resource-cache.
|
2014-06-16 23:19:31 +02:00
|
|
|
allow zygote resourcecache_data_file:dir rw_dir_perms;
|
|
|
|
allow zygote resourcecache_data_file:file create_file_perms;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2014-01-09 15:27:15 +01:00
|
|
|
# For art.
|
2016-09-19 22:40:25 +02:00
|
|
|
allow zygote libart_file:file { execute read open getattr };
|
2016-11-18 14:42:35 +01:00
|
|
|
# When WITH_DEXPREOPT is true, the zygote does not load executable content from
|
|
|
|
# /data/dalvik-cache.
|
|
|
|
allow { zygote with_dexpreopt(`-zygote') } dalvikcache_data_file:file execute;
|
|
|
|
|
2015-06-19 19:47:26 +02:00
|
|
|
# Execute idmap and dex2oat within zygote's own domain.
|
|
|
|
# TODO: Should either of these be transitioned to the same domain
|
|
|
|
# used by installd or stay in-domain for zygote?
|
|
|
|
allow zygote idmap_exec:file rx_file_perms;
|
2014-07-15 08:32:08 +02:00
|
|
|
allow zygote dex2oat_exec:file rx_file_perms;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2013-07-01 21:07:03 +02:00
|
|
|
# Control cgroups.
|
|
|
|
allow zygote cgroup:dir create_dir_perms;
|
2016-09-10 01:27:17 +02:00
|
|
|
allow zygote cgroup:{ file lnk_file } r_file_perms;
|
2013-07-01 21:07:03 +02:00
|
|
|
allow zygote self:capability sys_admin;
|
2016-11-18 14:42:35 +01:00
|
|
|
|
2016-08-23 18:02:57 +02:00
|
|
|
# Allow zygote to stat the files that it opens. The zygote must
|
|
|
|
# be able to inspect them so that it can reopen them on fork
|
2016-11-18 14:42:35 +01:00
|
|
|
# if necessary: b/30963384.
|
2016-11-28 17:07:25 +01:00
|
|
|
allow zygote pmsg_device:chr_file getattr;
|
|
|
|
allow zygote debugfs_trace_marker:file getattr;
|
2016-08-23 18:02:57 +02:00
|
|
|
|
2013-07-01 21:07:03 +02:00
|
|
|
# Check validity of SELinux context before use.
|
|
|
|
selinux_check_context(zygote)
|
|
|
|
# Check SELinux permissions.
|
|
|
|
selinux_check_access(zygote)
|
|
|
|
|
2014-09-26 19:51:12 +02:00
|
|
|
# Native bridge functionality requires that zygote replaces
|
|
|
|
# /proc/cpuinfo with /system/lib/<ISA>/cpuinfo using a bind mount
|
|
|
|
allow zygote proc_cpuinfo:file mounton;
|
|
|
|
|
2016-11-18 14:42:35 +01:00
|
|
|
# Allow remounting rootfs as MS_SLAVE.
|
2013-07-01 21:07:03 +02:00
|
|
|
allow zygote rootfs:dir mounton;
|
2015-06-26 01:13:59 +02:00
|
|
|
allow zygote tmpfs:filesystem { mount unmount };
|
2015-07-01 00:56:46 +02:00
|
|
|
allow zygote fuse:filesystem { unmount };
|
2016-03-02 01:13:50 +01:00
|
|
|
allow zygote sdcardfs:filesystem { unmount };
|
Updated policy for external storage.
An upcoming platform release is redesigning how external storage
works. At a high level, vold is taking on a more active role in
managing devices that dynamically appear.
This change also creates further restricted domains for tools doing
low-level access of external storage devices, including sgdisk
and blkid. It also extends sdcardd to be launchable by vold, since
launching by init will eventually go away.
For compatibility, rules required to keep AOSP builds working are
marked with "TODO" to eventually remove.
Slightly relax system_server external storage rules to allow calls
like statfs(). Still neverallow open file descriptors, since they
can cause kernel to kill us.
Here are the relevant violations that this CL is designed to allow:
avc: denied { search } for name="user" dev="tmpfs" ino=7441 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { getattr } for path="/mnt/user/0" dev="tmpfs" ino=6659 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { write } for name="user" dev="tmpfs" ino=6658 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { add_name } for name="10" scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { create } for name="10" scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { setattr } for name="10" dev="tmpfs" ino=11348 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { search } for name="/" dev="tmpfs" ino=3131 scontext=u:r:zygote:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage/self" dev="tmpfs" ino=6659 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:untrusted_app:s0:c522,c768 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage/self" dev="tmpfs" ino=11348 scontext=u:r:untrusted_app:s0:c522,c768 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { read } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { open } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { search } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { write } for name="data" dev="tmpfs" ino=11979 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { add_name } for name="com.google.android.music" scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { create } for name="com.google.android.music" scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { use } for path="socket:[8297]" dev="sockfs" ino=8297 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { read write } for path="socket:[8297]" dev="sockfs" ino=8297 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=netlink_kobject_uevent_socket
avc: denied { read } for path="pipe:[8298]" dev="pipefs" ino=8298 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fifo_file
avc: denied { write } for path="pipe:[8298]" dev="pipefs" ino=8298 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fifo_file
avc: denied { mounton } for path="/storage/emulated" dev="tmpfs" ino=8913 scontext=u:r:sdcardd:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=7444 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage/self/primary" dev="tmpfs" ino=7447 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file
avc: denied { read } for name="primary" dev="tmpfs" ino=7447 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file
avc: denied { getattr } for path="/mnt/user" dev="tmpfs" ino=7441 scontext=u:r:system_server:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { read } for name="disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { open } for path="/dev/block/vold/disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { getattr } for path="/dev/block/vold/disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { read } for name="/" dev="fuse" ino=0 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { open } for path="/storage/public:81F3-13EC" dev="fuse" ino=0 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { write } for name="data" dev="fuse" ino=2 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { add_name } for name="com.google.android.googlequicksearchbox" scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { create } for name="com.google.android.googlequicksearchbox" scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { getattr } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { read } for name="public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { open } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { ioctl } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { use } for path="pipe:[3264]" dev="pipefs" ino=3264 scontext=u:r:sgdisk:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="pipe:[3264]" dev="pipefs" ino=3264 scontext=u:r:sgdisk:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { search } for name="block" dev="tmpfs" ino=2494 scontext=u:r:sgdisk:s0 tcontext=u:object_r:block_device:s0 tclass=dir
avc: denied { use } for path="pipe:[4200]" dev="pipefs" ino=4200 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="pipe:[4200]" dev="pipefs" ino=4200 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { search } for name="/" dev="tmpfs" ino=3131 scontext=u:r:sdcardd:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { search } for name="media_rw" dev="tmpfs" ino=3127 scontext=u:r:sdcardd:s0 tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir
avc: denied { getattr } for path="pipe:[3648]" dev="pipefs" ino=3648 scontext=u:r:blkid:s0 tcontext=u:r:vold:s0 tclass=fifo_file
avc: denied { use } for path="/dev/pts/12" dev="devpts" ino=15 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="/dev/pts/12" dev="devpts" ino=15 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="pipe:[4182]" dev="pipefs" ino=4182 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
Change-Id: Idf3b8561baecf7faa603fac5ababdcc5708288e1
2015-03-27 19:25:39 +01:00
|
|
|
|
2016-11-18 14:42:35 +01:00
|
|
|
# Allow creating user-specific storage source if started before vold.
|
Updated policy for external storage.
An upcoming platform release is redesigning how external storage
works. At a high level, vold is taking on a more active role in
managing devices that dynamically appear.
This change also creates further restricted domains for tools doing
low-level access of external storage devices, including sgdisk
and blkid. It also extends sdcardd to be launchable by vold, since
launching by init will eventually go away.
For compatibility, rules required to keep AOSP builds working are
marked with "TODO" to eventually remove.
Slightly relax system_server external storage rules to allow calls
like statfs(). Still neverallow open file descriptors, since they
can cause kernel to kill us.
Here are the relevant violations that this CL is designed to allow:
avc: denied { search } for name="user" dev="tmpfs" ino=7441 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { getattr } for path="/mnt/user/0" dev="tmpfs" ino=6659 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { write } for name="user" dev="tmpfs" ino=6658 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { add_name } for name="10" scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { create } for name="10" scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { setattr } for name="10" dev="tmpfs" ino=11348 scontext=u:r:zygote:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { search } for name="/" dev="tmpfs" ino=3131 scontext=u:r:zygote:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage/self" dev="tmpfs" ino=6659 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:untrusted_app:s0:c522,c768 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage/self" dev="tmpfs" ino=11348 scontext=u:r:untrusted_app:s0:c522,c768 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { read } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { open } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { search } for name="/" dev="tmpfs" ino=6661 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { write } for name="data" dev="tmpfs" ino=11979 scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { add_name } for name="com.google.android.music" scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { create } for name="com.google.android.music" scontext=u:r:vold:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { use } for path="socket:[8297]" dev="sockfs" ino=8297 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { read write } for path="socket:[8297]" dev="sockfs" ino=8297 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=netlink_kobject_uevent_socket
avc: denied { read } for path="pipe:[8298]" dev="pipefs" ino=8298 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fifo_file
avc: denied { write } for path="pipe:[8298]" dev="pipefs" ino=8298 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fifo_file
avc: denied { mounton } for path="/storage/emulated" dev="tmpfs" ino=8913 scontext=u:r:sdcardd:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage" dev="tmpfs" ino=7444 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { getattr } for path="/storage/self/primary" dev="tmpfs" ino=7447 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file
avc: denied { read } for name="primary" dev="tmpfs" ino=7447 scontext=u:r:system_server:s0 tcontext=u:object_r:storage_file:s0 tclass=lnk_file
avc: denied { getattr } for path="/mnt/user" dev="tmpfs" ino=7441 scontext=u:r:system_server:s0 tcontext=u:object_r:mnt_user_file:s0 tclass=dir
avc: denied { read } for name="disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { open } for path="/dev/block/vold/disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { getattr } for path="/dev/block/vold/disk:179,128" dev="tmpfs" ino=3224 scontext=u:r:sgdisk:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { read } for name="/" dev="fuse" ino=0 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { open } for path="/storage/public:81F3-13EC" dev="fuse" ino=0 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { write } for name="data" dev="fuse" ino=2 scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { add_name } for name="com.google.android.googlequicksearchbox" scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { create } for name="com.google.android.googlequicksearchbox" scontext=u:r:vold:s0 tcontext=u:object_r:fuse:s0 tclass=dir
avc: denied { getattr } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { read } for name="public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { open } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { ioctl } for path="/dev/block/vold/public:179,129" dev="tmpfs" ino=16953 scontext=u:r:blkid:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file
avc: denied { use } for path="pipe:[3264]" dev="pipefs" ino=3264 scontext=u:r:sgdisk:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="pipe:[3264]" dev="pipefs" ino=3264 scontext=u:r:sgdisk:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { search } for name="block" dev="tmpfs" ino=2494 scontext=u:r:sgdisk:s0 tcontext=u:object_r:block_device:s0 tclass=dir
avc: denied { use } for path="pipe:[4200]" dev="pipefs" ino=4200 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="pipe:[4200]" dev="pipefs" ino=4200 scontext=u:r:sdcardd:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { search } for name="/" dev="tmpfs" ino=3131 scontext=u:r:sdcardd:s0 tcontext=u:object_r:storage_file:s0 tclass=dir
avc: denied { search } for name="media_rw" dev="tmpfs" ino=3127 scontext=u:r:sdcardd:s0 tcontext=u:object_r:mnt_media_rw_file:s0 tclass=dir
avc: denied { getattr } for path="pipe:[3648]" dev="pipefs" ino=3648 scontext=u:r:blkid:s0 tcontext=u:r:vold:s0 tclass=fifo_file
avc: denied { use } for path="/dev/pts/12" dev="devpts" ino=15 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="/dev/pts/12" dev="devpts" ino=15 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
avc: denied { use } for path="pipe:[4182]" dev="pipefs" ino=4182 scontext=u:r:fsck:s0 tcontext=u:r:vold:s0 tclass=fd
Change-Id: Idf3b8561baecf7faa603fac5ababdcc5708288e1
2015-03-27 19:25:39 +01:00
|
|
|
allow zygote mnt_user_file:dir create_dir_perms;
|
|
|
|
allow zygote mnt_user_file:lnk_file create_file_perms;
|
|
|
|
# Allowed to mount user-specific storage into place
|
|
|
|
allow zygote storage_file:dir { search mounton };
|
2013-07-01 21:07:03 +02:00
|
|
|
|
|
|
|
# Handle --invoke-with command when launching Zygote with a wrapper command.
|
2014-03-10 15:31:09 +01:00
|
|
|
allow zygote zygote_exec:file rx_file_perms;
|
2015-05-01 16:09:43 +02:00
|
|
|
|
2016-01-27 19:54:16 +01:00
|
|
|
# Read access to pseudo filesystems.
|
|
|
|
r_dir_file(zygote, proc_net)
|
|
|
|
|
|
|
|
# Root fs.
|
2016-09-10 01:27:17 +02:00
|
|
|
r_dir_file(zygote, rootfs)
|
2016-01-27 19:54:16 +01:00
|
|
|
|
|
|
|
# System file accesses.
|
2016-09-10 01:27:17 +02:00
|
|
|
r_dir_file(zygote, system_file)
|
2016-01-27 19:54:16 +01:00
|
|
|
|
2015-11-10 19:49:57 +01:00
|
|
|
userdebug_or_eng(`
|
|
|
|
# Allow zygote to create and write method traces in /data/misc/trace.
|
|
|
|
allow zygote method_trace_data_file:dir w_dir_perms;
|
|
|
|
allow zygote method_trace_data_file:file { create w_file_perms };
|
|
|
|
')
|
|
|
|
|
2016-09-10 01:27:17 +02:00
|
|
|
allow zygote ion_device:chr_file r_file_perms;
|
|
|
|
allow zygote tmpfs:dir r_dir_perms;
|
|
|
|
|
2016-11-18 14:42:35 +01:00
|
|
|
# Let the zygote access overlays so it can initialize the AssetManager.
|
2016-11-09 21:19:05 +01:00
|
|
|
get_prop(zygote, overlay_prop)
|
|
|
|
|
2015-05-01 16:09:43 +02:00
|
|
|
###
|
|
|
|
### neverallow rules
|
|
|
|
###
|
|
|
|
|
|
|
|
# Ensure that all types assigned to app processes are included
|
|
|
|
# in the appdomain attribute, so that all allow and neverallow rules
|
|
|
|
# written on appdomain are applied to all app processes.
|
|
|
|
# This is achieved by ensuring that it is impossible for zygote to
|
|
|
|
# setcon (dyntransition) to any types other than those associated
|
|
|
|
# with appdomain plus system_server.
|
2017-01-19 19:56:18 +01:00
|
|
|
neverallow zygote ~{ appdomain system_server }:process dyntransition;
|
2015-06-22 16:26:26 +02:00
|
|
|
|
|
|
|
# Zygote should never execute anything from /data except for /data/dalvik-cache files.
|
|
|
|
neverallow zygote {
|
|
|
|
data_file_type
|
|
|
|
-dalvikcache_data_file # map PROT_EXEC
|
|
|
|
}:file no_x_file_perms;
|
2016-12-28 03:05:46 +01:00
|
|
|
|
|
|
|
# Do not allow access to Bluetooth-related system properties and files
|
|
|
|
neverallow zygote bluetooth_prop:file create_file_perms;
|