Skip to content
Snippets Groups Projects
Commit c5266df9 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Jeff Vander Stoep
Browse files

Rework neverallow for /data execute permission

Previously appdomains allowed to execute off of /data
where whitelisted. This had the unfortunate side effect of
disallowing the creation of device specific app domains
with fewer permissions than untrusted_app. Instead grant
all apps a neverallow exemption and blacklist specific app
domains that should still abide by the restriction.

This allows devices to add new app domains that need
/data execute permission without conflicting with this rule.

Bug: 26906711
Change-Id: Ia876cc1dfd5b12908c59bd9e8620a6b890729c28
parent 493df204
No related branches found
No related tags found
No related merge requests found
...@@ -438,6 +438,22 @@ neverallow appdomain { ...@@ -438,6 +438,22 @@ neverallow appdomain {
tmpfs tmpfs
}:lnk_file no_w_file_perms; }:lnk_file no_w_file_perms;
# Blacklist app domains not allowed to execute from /data
neverallow {
bluetooth
isolated_app
nfc
platform_app
radio
shared_relro
system_app
} {
data_file_type
-dalvikcache_data_file
-system_data_file # shared libs in apks
-apk_data_file
}:file no_x_file_perms;
# Foreign dex profiles are just markers. Prevent apps to do anything but touch them. # Foreign dex profiles are just markers. Prevent apps to do anything but touch them.
neverallow appdomain user_profile_foreign_dex_data_file:file rw_file_perms; neverallow appdomain user_profile_foreign_dex_data_file:file rw_file_perms;
neverallow appdomain user_profile_foreign_dex_data_file:dir { open getattr read ioctl remove_name }; neverallow appdomain user_profile_foreign_dex_data_file:dir { open getattr read ioctl remove_name };
...@@ -292,9 +292,7 @@ neverallow domain { cache_file cache_backup_file cache_private_backup_file cache ...@@ -292,9 +292,7 @@ neverallow domain { cache_file cache_backup_file cache_private_backup_file cache
# Protect most domains from executing arbitrary content from /data. # Protect most domains from executing arbitrary content from /data.
neverallow { neverallow {
domain domain
-untrusted_app -appdomain
-priv_app
-shell
} { } {
data_file_type data_file_type
-dalvikcache_data_file -dalvikcache_data_file
...@@ -485,6 +483,11 @@ neverallow { ...@@ -485,6 +483,11 @@ neverallow {
-zygote -zygote
} shell:process { transition dyntransition }; } shell:process { transition dyntransition };
# Only domains spawned from zygote and runas may have the appdomain attribute.
neverallow { domain -runas -zygote } {
appdomain -shell userdebug_or_eng(`-su')
}:process { transition dyntransition };
# Minimize read access to shell- or app-writable symlinks. # Minimize read access to shell- or app-writable symlinks.
# This is to prevent malicious symlink attacks. # This is to prevent malicious symlink attacks.
neverallow { neverallow {
......
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