Skip to content
Snippets Groups Projects
Commit b335e384 authored by Stephen Smalley's avatar Stephen Smalley
Browse files

Run idmap in its own domain.


Run idmap in its own domain rather than leaving it in installd's domain.
This prevents misuse of installd's permissions by idmap.

zygote also needs to run idmap.  For now, just run it in zygote's
domain as it was previously since that is what is done for dex2oat
invocation by zygote.  zygote appears to run idmap with system uid
while installd runs it with app UIDs, so using different domains
seems appropriate.

Remove system_file execute_no_trans from both installd and zygote;
this should no longer be needed with explicit labels for dex2oat and
idmap.

Change-Id: If47e2c1326b84c20e94a20f5e699300dce12bdfe
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
parent 9d439d3d
No related branches found
No related tags found
No related merge requests found
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
/system/bin/sgdisk u:object_r:sgdisk_exec:s0 /system/bin/sgdisk u:object_r:sgdisk_exec:s0
/system/bin/blkid u:object_r:blkid_exec:s0 /system/bin/blkid u:object_r:blkid_exec:s0
/system/bin/tzdatacheck u:object_r:tzdatacheck_exec:s0 /system/bin/tzdatacheck u:object_r:tzdatacheck_exec:s0
/system/bin/idmap u:object_r:idmap_exec:s0
############################# #############################
# Vendor files # Vendor files
......
idmap.te 0 → 100644
# idmap, when executed by installd
type idmap, domain;
type idmap_exec, exec_type, file_type;
# Use open file to /data/resource-cache file inherited from installd.
allow idmap installd:fd use;
allow idmap resourcecache_data_file:file { getattr read write };
# Open and read from target and overlay apk files passed by argument.
allow idmap apk_data_file:file r_file_perms;
...@@ -20,7 +20,6 @@ allow installd apk_tmp_file:file { r_file_perms unlink }; ...@@ -20,7 +20,6 @@ allow installd apk_tmp_file:file { r_file_perms unlink };
allow installd apk_tmp_file:dir { relabelfrom create_dir_perms }; allow installd apk_tmp_file:dir { relabelfrom create_dir_perms };
allow installd oemfs:dir r_dir_perms; allow installd oemfs:dir r_dir_perms;
allow installd oemfs:file r_file_perms; allow installd oemfs:file r_file_perms;
allow installd system_file:file x_file_perms;
allow installd cgroup:dir create_dir_perms; allow installd cgroup:dir create_dir_perms;
allow installd mnt_expand_file:dir search; allow installd mnt_expand_file:dir search;
# Check validity of SELinux context before use. # Check validity of SELinux context before use.
...@@ -71,6 +70,9 @@ allow installd resourcecache_data_file:file create_file_perms; ...@@ -71,6 +70,9 @@ allow installd resourcecache_data_file:file create_file_perms;
# Run dex2oat in its own sandbox. # Run dex2oat in its own sandbox.
domain_auto_trans(installd, dex2oat_exec, dex2oat) domain_auto_trans(installd, dex2oat_exec, dex2oat)
# Run idmap in its own sandbox.
domain_auto_trans(installd, idmap_exec, idmap)
# Upgrade from unlabeled userdata. # Upgrade from unlabeled userdata.
# Just need enough to remove and/or relabel it. # Just need enough to remove and/or relabel it.
allow installd unlabeled:dir { getattr search relabelfrom rw_dir_perms rmdir }; allow installd unlabeled:dir { getattr search relabelfrom rw_dir_perms rmdir };
......
...@@ -31,8 +31,10 @@ allow zygote resourcecache_data_file:dir rw_dir_perms; ...@@ -31,8 +31,10 @@ allow zygote resourcecache_data_file:dir rw_dir_perms;
allow zygote resourcecache_data_file:file create_file_perms; allow zygote resourcecache_data_file:file create_file_perms;
# For art. # For art.
allow zygote dalvikcache_data_file:file execute; allow zygote dalvikcache_data_file:file execute;
# Execute dexopt. # Execute idmap and dex2oat within zygote's own domain.
allow zygote system_file:file x_file_perms; # 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;
allow zygote dex2oat_exec:file rx_file_perms; allow zygote dex2oat_exec:file rx_file_perms;
# Control cgroups. # Control cgroups.
allow zygote cgroup:dir create_dir_perms; allow zygote cgroup:dir create_dir_perms;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment