Skip to content
Snippets Groups Projects
Commit 68e6109d authored by Alex Klyubin's avatar Alex Klyubin Committed by android-build-merger
Browse files

Vendor domains must not use Binder am: f5446eb1 am: 2fe065d7

am: 49ce4394

Change-Id: I1b38d903e61188594d0de80be479e7d9e045fb26
parents 463f9a49 49ce4394
No related branches found
No related tags found
No related merge requests found
Showing
with 74 additions and 21 deletions
# type_transition must be private policy the domain_trans rules could stay typeattribute tombstoned coredomain;
# public, but conceptually should go with this
init_daemon_domain(tombstoned) init_daemon_domain(tombstoned)
# type_transition must be private policy the domain_trans rules could stay typeattribute toolbox coredomain;
# public, but conceptually should go with this
init_daemon_domain(toolbox) init_daemon_domain(toolbox)
# type_transition must be private policy the domain_trans rules could stay typeattribute tzdatacheck coredomain;
# public, but conceptually should go with this
init_daemon_domain(tzdatacheck) init_daemon_domain(tzdatacheck)
# type_transition must be private policy the domain_trans rules could stay typeattribute ueventd coredomain;
# public, but conceptually should go with this
tmpfs_domain(ueventd) tmpfs_domain(ueventd)
# type_transition must be private policy the domain_trans rules could stay typeattribute uncrypt coredomain;
# public, but conceptually should go with this
init_daemon_domain(uncrypt) init_daemon_domain(uncrypt)
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
### seapp_contexts. ### seapp_contexts.
### ###
typeattribute untrusted_app coredomain;
app_domain(untrusted_app) app_domain(untrusted_app)
untrusted_app_domain(untrusted_app) untrusted_app_domain(untrusted_app)
net_domain(untrusted_app) net_domain(untrusted_app)
... ...
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
### seapp_contexts. ### seapp_contexts.
### ###
typeattribute untrusted_app_25 coredomain;
app_domain(untrusted_app_25) app_domain(untrusted_app_25)
untrusted_app_domain(untrusted_app_25) untrusted_app_domain(untrusted_app_25)
net_domain(untrusted_app_25) net_domain(untrusted_app_25)
... ...
......
### ###
### Untrusted v2 sandbox apps. ### Untrusted v2 sandbox apps.
### ###
typeattribute untrusted_v2_app coredomain;
app_domain(untrusted_v2_app) app_domain(untrusted_v2_app)
net_domain(untrusted_v2_app) net_domain(untrusted_v2_app)
bluetooth_domain(untrusted_v2_app) bluetooth_domain(untrusted_v2_app)
... ...
......
# type_transition must be private policy the domain_trans rules could stay typeattribute update_engine coredomain;
# public, but conceptually should go with this
init_daemon_domain(update_engine); init_daemon_domain(update_engine);
# type_transition must be private policy the domain_trans rules could stay typeattribute update_verifier coredomain;
# public, but conceptually should go with this
init_daemon_domain(update_verifier) init_daemon_domain(update_verifier)
# type_transition must be private policy the domain_trans rules could stay typeattribute vdc coredomain;
# public, but conceptually should go with this
init_daemon_domain(vdc) init_daemon_domain(vdc)
typeattribute virtual_touchpad coredomain;
init_daemon_domain(virtual_touchpad) init_daemon_domain(virtual_touchpad)
# type_transition must be private policy the domain_trans rules could stay typeattribute vold coredomain;
# public, but conceptually should go with this
init_daemon_domain(vold) init_daemon_domain(vold)
# Switch to more restrictive domains when executing common tools # Switch to more restrictive domains when executing common tools
... ...
......
typeattribute watchdogd coredomain;
# webview_zygote is an auxiliary zygote process that is used to spawn # webview_zygote is an auxiliary zygote process that is used to spawn
# isolated_app processes for rendering untrusted web content. # isolated_app processes for rendering untrusted web content.
typeattribute webview_zygote coredomain;
# The webview_zygote needs to be able to transition domains. # The webview_zygote needs to be able to transition domains.
typeattribute webview_zygote mlstrustedsubject; typeattribute webview_zygote mlstrustedsubject;
... ...
......
# type_transition must be private policy the domain_trans rules could stay typeattribute wificond coredomain;
# public, but conceptually should go with this
init_daemon_domain(wificond) init_daemon_domain(wificond)
# zygote # zygote
typeattribute zygote coredomain;
typeattribute zygote domain_deprecated; typeattribute zygote domain_deprecated;
typeattribute zygote mlstrustedsubject; typeattribute zygote mlstrustedsubject;
... ...
......
...@@ -115,6 +115,13 @@ attribute binderservicedomain; ...@@ -115,6 +115,13 @@ attribute binderservicedomain;
# recovery for A/B devices. # recovery for A/B devices.
attribute update_engine_common; attribute update_engine_common;
# All core domains (as opposed to vendor/device-specific domains)
attribute coredomain;
# All vendor domains which violate the requirement of not using Binder
# TODO(b/35870313): Remove this once there are no violations
attribute binder_in_vendor_violators;
# All HAL servers # All HAL servers
attribute halserverdomain; attribute halserverdomain;
# All HAL clients # All HAL clients
... ...
......
...@@ -66,7 +66,10 @@ allow domain owntty_device:chr_file rw_file_perms; ...@@ -66,7 +66,10 @@ allow domain owntty_device:chr_file rw_file_perms;
allow domain null_device:chr_file rw_file_perms; allow domain null_device:chr_file rw_file_perms;
allow domain zero_device:chr_file rw_file_perms; allow domain zero_device:chr_file rw_file_perms;
allow domain ashmem_device:chr_file rw_file_perms; allow domain ashmem_device:chr_file rw_file_perms;
allow { domain -hwservicemanager -vndservicemanager } binder_device:chr_file rw_file_perms; # /dev/binder can be accessed by non-vendor domains and by apps
allow { coredomain appdomain -hwservicemanager } binder_device:chr_file rw_file_perms;
# Devices which are not full TREBLE have fewer restrictions on access to /dev/binder
not_full_treble(`allow { domain -hwservicemanager -vndservicemanager } binder_device:chr_file rw_file_perms;')
allow { domain -servicemanager -vndservicemanager } hwbinder_device:chr_file rw_file_perms; allow { domain -servicemanager -vndservicemanager } hwbinder_device:chr_file rw_file_perms;
allow domain ptmx_device:chr_file rw_file_perms; allow domain ptmx_device:chr_file rw_file_perms;
allow domain alarm_device:chr_file r_file_perms; allow domain alarm_device:chr_file r_file_perms;
...@@ -420,6 +423,24 @@ neverallow hwservicemanager vndbinder_device:chr_file no_rw_file_perms; ...@@ -420,6 +423,24 @@ neverallow hwservicemanager vndbinder_device:chr_file no_rw_file_perms;
neverallow vndservicemanager binder_device:chr_file no_rw_file_perms; neverallow vndservicemanager binder_device:chr_file no_rw_file_perms;
neverallow vndservicemanager hwbinder_device:chr_file no_rw_file_perms; neverallow vndservicemanager hwbinder_device:chr_file no_rw_file_perms;
# On full TREBLE devices, only core components and apps can use Binder and servicemanager. Non-core
# domain apps need this because Android framework offers many of its services to apps as Binder
# services.
full_treble_only(`
neverallow {
domain
-coredomain
-appdomain
-binder_in_vendor_violators # TODO(b/35870313): Remove once all violations are gone
} binder_device:chr_file rw_file_perms;
neverallow {
domain
-coredomain
-appdomain
-binder_in_vendor_violators # TODO(b/35870313): Remove once all violations are gone
} servicemanager:binder { call transfer };
')
# Only authorized processes should be writing to files in /data/dalvik-cache # Only authorized processes should be writing to files in /data/dalvik-cache
neverallow { neverallow {
domain domain
... ...
......
...@@ -394,6 +394,18 @@ define(`non_system_app_set', `{ appdomain -system_app }') ...@@ -394,6 +394,18 @@ define(`non_system_app_set', `{ appdomain -system_app }')
# #
define(`recovery_only', ifelse(target_recovery, `true', $1, )) define(`recovery_only', ifelse(target_recovery, `true', $1, ))
#####################################
# Full TREBLE only
# SELinux rules which apply only to full TREBLE devices
#
define(`full_treble_only', ifelse(target_full_treble, `true', $1, ))
#####################################
# Not full TREBLE
# SELinux rules which apply only to devices which are not full TREBLE devices
#
define(`not_full_treble', ifelse(target_full_treble, `true', , $1))
##################################### #####################################
# Userdebug or eng builds # Userdebug or eng builds
# SELinux rules which apply only to userdebug or eng builds # SELinux rules which apply only to userdebug or eng builds
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment