aboutsummaryrefslogtreecommitdiffstats
path: root/vold.te
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-06-28 20:15:37 -0700
committerNick Kralevich <nnk@google.com>2013-06-28 20:41:16 -0700
commit7914a47f05ac4f00928062d08275fe4680f1747c (patch)
treedf87658d8441eed6bc083e7f47189327b0031851 /vold.te
parentdbd28d91d3c6d970f1704df8350b0333b51758b1 (diff)
downloadandroid_external_sepolicy-7914a47f05ac4f00928062d08275fe4680f1747c.tar.gz
android_external_sepolicy-7914a47f05ac4f00928062d08275fe4680f1747c.tar.bz2
android_external_sepolicy-7914a47f05ac4f00928062d08275fe4680f1747c.zip
Enable SELinux on vold
This change enables SELinux security enforcement on vold. For the vold.te file ONLY, this change is conceptually a revert of 77d4731e9d30c8971e076e2469d6957619019921 and 50e37b93ac97631dcac6961285b92af5026557af, with the following additional changes: 1) Removal of "allow vold proc:file write;" and "allow vold self:capability { sys_boot };". As of system/vold change adfba3626e76c1931649634275d241b226cd1b9a, vold no longer performs it's own reboots, so these capabilities are no longer needed. 2) Addition of the powerctl property, which vold contacts to tell init to reboot. 3) Removal of "allow vold kernel:system module_request;". As of CTS commit f2cfdf5c057140d9442fcfeb4e4a648e8258b659, Android devices no longer ship with loadable modules, hence we don't require this rule. 4) Removal of "fsetid" from "self:capability". Any setuid / setgid bits SHOULD be cleared if vold is able to change the permissions of files. IMHO, it was a mistake to ever include this capability in the first place. Testing: As much as possible, I've tested filesystem related functionality, including factory reset and device encryption. I wasn't able to test fstrim functionality, which is a fairly new feature. I didn't see any policy denials in dmesg. It's quite possible I've missed something. If we experience problems, I happy to roll back this change. Bug: 9629920 Change-Id: I683afa0dffe9f28952287bfdb7ee4e0423c2e97a
Diffstat (limited to 'vold.te')
-rw-r--r--vold.te63
1 files changed, 61 insertions, 2 deletions
diff --git a/vold.te b/vold.te
index e91d6c3..fe6c297 100644
--- a/vold.te
+++ b/vold.te
@@ -1,7 +1,66 @@
# volume manager
type vold, domain;
-permissive vold;
type vold_exec, exec_type, file_type;
init_daemon_domain(vold)
-unconfined_domain(vold)
+
+typeattribute vold mlstrustedsubject;
+allow vold system_file:file x_file_perms;
+allow vold block_device:dir create_dir_perms;
+allow vold block_device:blk_file create_file_perms;
+allow vold device:dir write;
+allow vold devpts:chr_file rw_file_perms;
+allow vold rootfs:dir mounton;
+allow vold sdcard_type:dir mounton;
+allow vold sdcard_type:filesystem { mount remount unmount };
+allow vold sdcard_type:dir create_dir_perms;
+allow vold tmpfs:filesystem { mount unmount };
+allow vold tmpfs:dir create_dir_perms;
+allow vold tmpfs:dir mounton;
+allow vold self:capability { net_admin dac_override mknod sys_admin chown fowner };
+allow vold self:netlink_kobject_uevent_socket *;
+allow vold app_data_file:dir search;
+allow vold app_data_file:file rw_file_perms;
+allow vold loop_device:blk_file rw_file_perms;
+allow vold dm_device:chr_file rw_file_perms;
+# For vold Process::killProcessesWithOpenFiles function.
+allow vold domain:dir r_dir_perms;
+allow vold domain:{ file lnk_file } r_file_perms;
+allow vold domain:process { signal sigkill };
+allow vold self:capability { sys_ptrace };
+
+# XXX Label sysfs files with a specific type?
+allow vold sysfs:file rw_file_perms;
+
+write_klog(vold)
+
+#
+# Rules to support encrypted fs support.
+#
+
+# Set property.
+unix_socket_connect(vold, property, init)
+
+# Unmount and mount the fs.
+allow vold labeledfs:filesystem { mount unmount remount };
+
+# Access /efs/userdata_footer.
+# XXX Split into a separate type?
+allow vold efs_file:file rw_file_perms;
+
+# Create and mount on /data/tmp_mnt.
+allow vold system_data_file:dir { create rw_dir_perms mounton };
+
+# Set scheduling policy of kernel processes
+allow vold kernel:process setsched;
+
+# Property Service
+allow vold vold_prop:property_service set;
+allow vold powerctl_prop:property_service set;
+
+# ASEC
+allow vold asec_image_file:file create_file_perms;
+allow vold asec_image_file:dir rw_dir_perms;
+security_access_policy(vold)
+allow vold asec_apk_file:dir { rw_dir_perms setattr };
+allow vold asec_apk_file:file { r_file_perms setattr };