Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemSEPolicy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemSEPolicy
Commits
1eb00fb6
Commit
1eb00fb6
authored
8 years ago
by
Jorge Lucangeli Obes
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Use with_dexpreopt macro for zygote execute permissions."
parents
3319d5ee
84db84e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Android.mk
+4
-0
4 additions, 0 deletions
Android.mk
public/te_macros
+6
-0
6 additions, 0 deletions
public/te_macros
public/zygote.te
+23
-8
23 additions, 8 deletions
public/zygote.te
with
33 additions
and
8 deletions
Android.mk
+
4
−
0
View file @
1eb00fb6
...
@@ -139,6 +139,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
...
@@ -139,6 +139,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
target_build_variant
=
$(
TARGET_BUILD_VARIANT
)
\
-D
target_build_variant
=
$(
TARGET_BUILD_VARIANT
)
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_with_dexpreopt
=
$(
WITH_DEXPREOPT
)
\
-s
$^
>
$@
-s
$^
>
$@
$(
hide
)
sed
'/dontaudit/d'
$@
>
$@
.dontaudit
$(
hide
)
sed
'/dontaudit/d'
$@
>
$@
.dontaudit
...
@@ -156,6 +157,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY) $(BOARD_SEPOLICY_DIRS))
...
@@ -156,6 +157,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY) $(BOARD_SEPOLICY_DIRS))
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
target_build_variant
=
$(
TARGET_BUILD_VARIANT
)
\
-D
target_build_variant
=
$(
TARGET_BUILD_VARIANT
)
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_with_dexpreopt
=
$(
WITH_DEXPREOPT
)
\
-D
target_arch
=
$(
LOCAL_TARGET_ARCH
)
\
-D
target_arch
=
$(
LOCAL_TARGET_ARCH
)
\
-s
$^
>
$@
-s
$^
>
$@
$(
hide
)
sed
'/dontaudit/d'
$@
>
$@
.dontaudit
$(
hide
)
sed
'/dontaudit/d'
$@
>
$@
.dontaudit
...
@@ -197,6 +199,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY) $(BOARD_SEPOLICY_DIRS))
...
@@ -197,6 +199,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY) $(BOARD_SEPOLICY_DIRS))
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
target_build_variant
=
$(
TARGET_BUILD_VARIANT
)
\
-D
target_build_variant
=
$(
TARGET_BUILD_VARIANT
)
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_with_dexpreopt
=
$(
WITH_DEXPREOPT
)
\
-D
target_recovery
=
true
\
-D
target_recovery
=
true
\
-s
$^
>
$@
-s
$^
>
$@
...
@@ -233,6 +236,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
...
@@ -233,6 +236,7 @@ $(PLAT_PUBLIC_POLICY) $(PLAT_PRIVATE_POLICY))
$(
hide
)
m4
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
$(
hide
)
m4
-D
mls_num_sens
=
$(
PRIVATE_MLS_SENS
)
-D
mls_num_cats
=
$(
PRIVATE_MLS_CATS
)
\
-D
target_build_variant
=
user
\
-D
target_build_variant
=
user
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_build_treble
=
$(
ENABLE_TREBLE
)
\
-D
target_with_dexpreopt
=
$(
WITH_DEXPREOPT
)
\
-s
$^
>
$@
-s
$^
>
$@
$(
hide
)
sed
'/dontaudit/d'
$@
>
$@
.dontaudit
$(
hide
)
sed
'/dontaudit/d'
$@
>
$@
.dontaudit
...
...
This diff is collapsed.
Click to expand it.
public/te_macros
+
6
−
0
View file @
1eb00fb6
...
@@ -288,6 +288,12 @@ define(`eng', ifelse(target_build_variant, `eng', $1))
...
@@ -288,6 +288,12 @@ define(`eng', ifelse(target_build_variant, `eng', $1))
define(`binderized_hal', ifelse(target_build_treble, `true', $1))
define(`binderized_hal', ifelse(target_build_treble, `true', $1))
define(`passthrough_hal', ifelse(target_build_treble, `', $1))
define(`passthrough_hal', ifelse(target_build_treble, `', $1))
#####################################
# WITH_DEXPREOPT builds
# SELinux rules which apply only when pre-opting.
#
define(`with_dexpreopt', ifelse(target_with_dexpreopt, `true', $1))
#####################################
#####################################
# write_logd(domain)
# write_logd(domain)
# Ability to write to android log
# Ability to write to android log
...
...
This diff is collapsed.
Click to expand it.
public/zygote.te
+
23
−
8
View file @
1eb00fb6
...
@@ -3,46 +3,61 @@ type zygote, domain, domain_deprecated;
...
@@ -3,46 +3,61 @@ type zygote, domain, domain_deprecated;
type zygote_exec, exec_type, file_type;
type zygote_exec, exec_type, file_type;
typeattribute zygote mlstrustedsubject;
typeattribute zygote mlstrustedsubject;
# Override DAC on files and switch uid/gid.
# Override DAC on files and switch uid/gid.
allow zygote self:capability { dac_override setgid setuid fowner chown };
allow zygote self:capability { dac_override setgid setuid fowner chown };
# Drop capabilities from bounding set.
# Drop capabilities from bounding set.
allow zygote self:capability setpcap;
allow zygote self:capability setpcap;
# Switch SELinux context to app domains.
# Switch SELinux context to app domains.
allow zygote self:process setcurrent;
allow zygote self:process setcurrent;
allow zygote system_server:process dyntransition;
allow zygote system_server:process dyntransition;
allow zygote { appdomain ephemeral_app }:process dyntransition;
allow zygote { appdomain ephemeral_app }:process dyntransition;
# Allow zygote to read app /proc/pid dirs (b/10455872)
# Allow zygote to read app /proc/pid dirs (b/10455872).
allow zygote { appdomain ephemeral_app }:dir { getattr search };
allow zygote { appdomain ephemeral_app }:dir { getattr search };
allow zygote { appdomain ephemeral_app }:file { r_file_perms };
allow zygote { appdomain ephemeral_app }:file { r_file_perms };
# Move children into the peer process group.
# Move children into the peer process group.
allow zygote system_server:process { getpgid setpgid };
allow zygote system_server:process { getpgid setpgid };
allow zygote { appdomain ephemeral_app }:process { getpgid setpgid };
allow zygote { appdomain ephemeral_app }:process { getpgid setpgid };
# Read system data.
# Read system data.
allow zygote system_data_file:dir r_dir_perms;
allow zygote system_data_file:dir r_dir_perms;
allow zygote system_data_file:file r_file_perms;
allow zygote system_data_file:file r_file_perms;
# Write to /data/dalvik-cache.
# Write to /data/dalvik-cache.
allow zygote dalvikcache_data_file:dir create_dir_perms;
allow zygote dalvikcache_data_file:dir create_dir_perms;
allow zygote dalvikcache_data_file:file create_file_perms;
allow zygote dalvikcache_data_file:file create_file_perms;
# Create symlinks in /data/dalvik-cache
# Create symlinks in /data/dalvik-cache.
allow zygote dalvikcache_data_file:lnk_file create_file_perms;
allow zygote dalvikcache_data_file:lnk_file create_file_perms;
# Write to /data/resource-cache
# Write to /data/resource-cache.
allow zygote resourcecache_data_file:dir rw_dir_perms;
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 libart_file:file { execute read open getattr };
allow zygote libart_file:file { execute read open getattr };
# 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;
# Execute idmap and dex2oat within zygote's own domain.
# Execute idmap and dex2oat within zygote's own domain.
# TODO: Should either of these be transitioned to the same domain
# TODO: Should either of these be transitioned to the same domain
# used by installd or stay in-domain for zygote?
# used by installd or stay in-domain for zygote?
allow zygote idmap_exec:file rx_file_perms;
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;
allow zygote cgroup:{ file lnk_file } r_file_perms;
allow zygote cgroup:{ file lnk_file } r_file_perms;
allow zygote self:capability sys_admin;
allow zygote self:capability sys_admin;
# Allow zygote to stat the files that it opens. The zygote must
# 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
# be able to inspect them so that it can reopen them on fork
# if necessary: b/30963384
# if necessary: b/30963384
.
allow zygote pmsg_device:chr_file { getattr };
allow zygote pmsg_device:chr_file { getattr };
allow zygote debugfs_trace_marker:file { getattr };
allow zygote debugfs_trace_marker:file { getattr };
...
@@ -55,13 +70,13 @@ selinux_check_access(zygote)
...
@@ -55,13 +70,13 @@ selinux_check_access(zygote)
# /proc/cpuinfo with /system/lib/<ISA>/cpuinfo using a bind mount
# /proc/cpuinfo with /system/lib/<ISA>/cpuinfo using a bind mount
allow zygote proc_cpuinfo:file mounton;
allow zygote proc_cpuinfo:file mounton;
# Allow remounting rootfs as MS_SLAVE
# Allow remounting rootfs as MS_SLAVE
.
allow zygote rootfs:dir mounton;
allow zygote rootfs:dir mounton;
allow zygote tmpfs:filesystem { mount unmount };
allow zygote tmpfs:filesystem { mount unmount };
allow zygote fuse:filesystem { unmount };
allow zygote fuse:filesystem { unmount };
allow zygote sdcardfs:filesystem { unmount };
allow zygote sdcardfs:filesystem { unmount };
# Allow
ed to
creat
e
user-specific storage source if started before vold
# Allow creat
ing
user-specific storage source if started before vold
.
allow zygote mnt_user_file:dir create_dir_perms;
allow zygote mnt_user_file:dir create_dir_perms;
allow zygote mnt_user_file:lnk_file create_file_perms;
allow zygote mnt_user_file:lnk_file create_file_perms;
# Allowed to mount user-specific storage into place
# Allowed to mount user-specific storage into place
...
@@ -88,7 +103,7 @@ userdebug_or_eng(`
...
@@ -88,7 +103,7 @@ userdebug_or_eng(`
allow zygote ion_device:chr_file r_file_perms;
allow zygote ion_device:chr_file r_file_perms;
allow zygote tmpfs:dir r_dir_perms;
allow zygote tmpfs:dir r_dir_perms;
# Let the zygote access overlays so it can initialize the AssetManager
# Let the zygote access overlays so it can initialize the AssetManager
.
get_prop(zygote, overlay_prop)
get_prop(zygote, overlay_prop)
###
###
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment