Skip to content
Snippets Groups Projects
Commit 76035ea0 authored by dcashman's avatar dcashman
Browse files

Restore app_domain macro and move to private use.

app_domain was split up in commit: 2e00e637 to
enable compilation by hiding type_transition rules from public policy.  These
rules need to be hidden from public policy because they describe how objects are
labeled, of which non-platform should be unaware.  Instead of cutting apart the
app_domain macro, which non-platform policy may rely on for implementing new app
types, move all app_domain calls to private policy.

Bug: 33428593
Test: bullhead and sailfish both boot. sediff shows no policy change.
Change-Id: I4beead8ccc9b6e13c6348da98bb575756f539665
parent 19a21cd8
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,4 @@ ...@@ -3,7 +3,4 @@
# Socket creation under /data/misc/bluedroid. # Socket creation under /data/misc/bluedroid.
type_transition bluetooth bluetooth_data_file:sock_file bluetooth_socket; type_transition bluetooth bluetooth_data_file:sock_file bluetooth_socket;
# app_domain macro fallout app_domain(bluetooth)
tmpfs_domain(bluetooth)
# Map with PROT_EXEC.
allow bluetooth bluetooth_tmpfs:file execute;
# app_domain fallout app_domain(isolated_app)
tmpfs_domain(isolated_app)
# Map with PROT_EXEC.
allow isolated_app isolated_app_tmpfs:file execute;
# Read system properties managed by webview_zygote. # Read system properties managed by webview_zygote.
allow isolated_app webview_zygote_tmpfs:file read; allow isolated_app webview_zygote_tmpfs:file read;
# app_domain_fallout app_domain(nfc)
tmpfs_domain(nfc) \ No newline at end of file
# Map with PROT_EXEC.
allow nfc nfc_tmpfs:file execute;
# app_domain fallout app_domain(platform_app)
tmpfs_domain(platform_app) \ No newline at end of file
# Map with PROT_EXEC.
allow platform_app platform_app_tmpfs:file execute;
# app_domain fallout app_domain(priv_app)
tmpfs_domain(priv_app)
# Map with PROT_EXEC.
allow priv_app priv_app_tmpfs:file execute;
# Allow the allocation and use of ptys # Allow the allocation and use of ptys
# Used by: https://play.privileged.com/store/apps/details?id=jackpal.androidterm # Used by: https://play.privileged.com/store/apps/details?id=jackpal.androidterm
......
# app_domain fallout app_domain(radio)
tmpfs_domain(radio) \ No newline at end of file
# Map with PROT_EXEC.
allow radio radio_tmpfs:file execute;
# app_domain fallout # The shared relro process is a Java program forked from the zygote, so it
tmpfs_domain(shared_relro) # inherits from app to get basic permissions it needs to run.
# Map with PROT_EXEC. app_domain(shared_relro)
allow shared_relro shared_relro_tmpfs:file execute;
...@@ -4,7 +4,6 @@ allow shell debugfs_tracing:file rw_file_perms; ...@@ -4,7 +4,6 @@ allow shell debugfs_tracing:file rw_file_perms;
allow shell debugfs_trace_marker:file getattr; allow shell debugfs_trace_marker:file getattr;
allow shell atrace_exec:file rx_file_perms; allow shell atrace_exec:file rx_file_perms;
# app_domain fallout # Run app_process.
tmpfs_domain(shell) # XXX Transition into its own domain?
# Map with PROT_EXEC. app_domain(shell)
allow shell shell_tmpfs:file execute;
...@@ -11,8 +11,5 @@ userdebug_or_eng(` ...@@ -11,8 +11,5 @@ userdebug_or_eng(`
# su is also permissive to permit setenforce. # su is also permissive to permit setenforce.
permissive su; permissive su;
# app_domain fallout app_domain(su)
tmpfs_domain(su)
# Map with PROT_EXEC.
allow su su_tmpfs:file execute;
') ')
# app_domain fallout app_domain(system_app)
tmpfs_domain(system_app)
# Map with PROT_EXEC.
allow system_app system_app_tmpfs:file execute;
# app_domain fallout app_domain(untrusted_app)
tmpfs_domain(untrusted_app)
# Map with PROT_EXEC.
allow untrusted_app untrusted_app_tmpfs:file execute;
# Allow the allocation and use of ptys # Allow the allocation and use of ptys
# Used by: https://play.google.com/store/apps/details?id=jackpal.androidterm # Used by: https://play.google.com/store/apps/details?id=jackpal.androidterm
......
# bluetooth subsystem # bluetooth subsystem
type bluetooth, domain, domain_deprecated; type bluetooth, domain, domain_deprecated;
app_domain(bluetooth)
net_domain(bluetooth) net_domain(bluetooth)
# Allow access to net_admin ioctls # Allow access to net_admin ioctls
allowxperm bluetooth self:udp_socket ioctl priv_sock_ioctls; allowxperm bluetooth self:udp_socket ioctl priv_sock_ioctls;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
### ###
type isolated_app, domain; type isolated_app, domain;
app_domain(isolated_app)
# Access already open app data files received over Binder or local socket IPC. # Access already open app data files received over Binder or local socket IPC.
allow isolated_app app_data_file:file { append read write getattr lock }; allow isolated_app app_data_file:file { append read write getattr lock };
......
# nfc subsystem # nfc subsystem
type nfc, domain, domain_deprecated; type nfc, domain, domain_deprecated;
app_domain(nfc)
net_domain(nfc) net_domain(nfc)
binder_service(nfc) binder_service(nfc)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
### ###
type platform_app, domain, domain_deprecated; type platform_app, domain, domain_deprecated;
app_domain(platform_app)
# Access the network. # Access the network.
net_domain(platform_app) net_domain(platform_app)
# Access bluetooth. # Access bluetooth.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
### A domain for further sandboxing privileged apps. ### A domain for further sandboxing privileged apps.
### ###
type priv_app, domain, domain_deprecated; type priv_app, domain, domain_deprecated;
app_domain(priv_app)
# Access the network. # Access the network.
net_domain(priv_app) net_domain(priv_app)
# Access bluetooth. # Access bluetooth.
......
# phone subsystem # phone subsystem
type radio, domain, domain_deprecated, mlstrustedsubject; type radio, domain, domain_deprecated, mlstrustedsubject;
app_domain(radio)
net_domain(radio) net_domain(radio)
bluetooth_domain(radio) bluetooth_domain(radio)
binder_service(radio) binder_service(radio)
......
# Process which creates/updates shared RELRO files to be used by other apps. # Process which creates/updates shared RELRO files to be used by other apps.
type shared_relro, domain, domain_deprecated; type shared_relro, domain, domain_deprecated;
# The shared relro process is a Java program forked from the zygote, so it
# inherits from app to get basic permissions it needs to run.
app_domain(shared_relro)
# Grant write access to the shared relro files/directory. # Grant write access to the shared relro files/directory.
allow shared_relro shared_relro_file:dir rw_dir_perms; allow shared_relro shared_relro_file:dir rw_dir_perms;
allow shared_relro shared_relro_file:file create_file_perms; allow shared_relro shared_relro_file:file create_file_perms;
......
...@@ -5,10 +5,6 @@ type shell_exec, exec_type, file_type; ...@@ -5,10 +5,6 @@ type shell_exec, exec_type, file_type;
# Create and use network sockets. # Create and use network sockets.
net_domain(shell) net_domain(shell)
# Run app_process.
# XXX Transition into its own domain?
app_domain(shell)
# logcat # logcat
read_logd(shell) read_logd(shell)
control_logd(shell) control_logd(shell)
......
...@@ -9,7 +9,6 @@ userdebug_or_eng(` ...@@ -9,7 +9,6 @@ userdebug_or_eng(`
# Add su to various domains # Add su to various domains
net_domain(su) net_domain(su)
app_domain(su)
dontaudit su self:capability_class_set *; dontaudit su self:capability_class_set *;
dontaudit su kernel:security *; dontaudit su kernel:security *;
......
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