diff --git a/app.te b/app.te index 5215633a90f8e358ae61a89ea220f765beffe836..1afa4b5c0a6d566a2ac8212c88dba980bc9e8d12 100644 --- a/app.te +++ b/app.te @@ -437,6 +437,21 @@ neverallow appdomain { tmpfs }:lnk_file no_w_file_perms; +# Blacklist app domains not allowed to execute from /data +neverallow { + bluetooth + isolated_app + nfc + 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. 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 }; diff --git a/domain.te b/domain.te index 38a6db83c2d222b25d1e4d874d31f510b71a5bd0..7da234092a9e3685bde4cf6964b7eaaa582f4702 100644 --- a/domain.te +++ b/domain.te @@ -305,9 +305,7 @@ neverallow domain { cache_file cache_backup_file cache_private_backup_file cache # Protect most domains from executing arbitrary content from /data. neverallow { domain - -untrusted_app - -priv_app - -shell + -appdomain } { data_file_type -dalvikcache_data_file @@ -519,6 +517,11 @@ neverallow { -zygote } 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') -bluetooth +}:process { transition dyntransition }; + # Minimize read access to shell- or app-writable symlinks. # This is to prevent malicious symlink attacks. neverallow {