aboutsummaryrefslogtreecommitdiffstats
path: root/vold.te
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-04-01 10:15:51 -0700
committerJeff Sharkey <jsharkey@android.com>2015-04-01 14:41:24 -0700
commit84e1c61193cf880ff899c4c34f9140c2e23c7811 (patch)
treeba7755cc836b9397b09a71d40c0f03de704abee6 /vold.te
parentd9128a45c656724a5152ad52c11feeb05f867953 (diff)
downloadandroid_external_sepolicy-84e1c61193cf880ff899c4c34f9140c2e23c7811.tar.gz
android_external_sepolicy-84e1c61193cf880ff899c4c34f9140c2e23c7811.tar.bz2
android_external_sepolicy-84e1c61193cf880ff899c4c34f9140c2e23c7811.zip
Different blkid and fsck execution domains.
vold works with two broad classes of block devices: untrusted devices that come in from the wild, and trusted devices. When running blkid and fsck, we pick which SELinux execution domain to use based on which class the device belongs to. Bug: 19993667 Change-Id: I44f5bac5dd94f0f76f3e4ef50ddbde5a32bd17a5
Diffstat (limited to 'vold.te')
-rw-r--r--vold.te18
1 files changed, 13 insertions, 5 deletions
diff --git a/vold.te b/vold.te
index c2bd064..dfdc3d9 100644
--- a/vold.te
+++ b/vold.te
@@ -6,9 +6,20 @@ init_daemon_domain(vold)
# Switch to more restrictive domains when executing common tools
domain_auto_trans(vold, sgdisk_exec, sgdisk);
-domain_auto_trans(vold, blkid_exec, blkid);
domain_auto_trans(vold, sdcardd_exec, sdcardd);
-domain_auto_trans(vold, fsck_exec, vold_fsck);
+
+# For a handful of probing tools, we choose an even more restrictive
+# domain when working with untrusted block devices
+domain_trans(vold, shell_exec, blkid);
+domain_trans(vold, shell_exec, blkid_untrusted);
+domain_trans(vold, fsck_exec, fsck);
+domain_trans(vold, fsck_exec, fsck_untrusted);
+
+# Allow us to jump into execution domains of above tools
+allow vold self:process setexec;
+
+# For sgdisk launched through popen()
+allow vold shell_exec:file rx_file_perms;
typeattribute vold mlstrustedsubject;
allow vold self:process setfscreate;
@@ -58,9 +69,6 @@ allow vold domain:{ file lnk_file } r_file_perms;
allow vold domain:process { signal sigkill };
allow vold self:capability { sys_ptrace kill };
-# For blkid and sgdisk
-allow vold shell_exec:file rx_file_perms;
-
# XXX Label sysfs files with a specific type?
allow vold sysfs:file rw_file_perms;