Skip to content
Snippets Groups Projects
Commit 99f24779 authored by Tri Vo's avatar Tri Vo Committed by Gerrit Code Review
Browse files

Merge "Constrain cgroups access."

parents 49531c81 f55c989d
No related branches found
No related tags found
No related merge requests found
...@@ -274,3 +274,6 @@ neverallow all_untrusted_apps mediaextractor_update_service:service_manager find ...@@ -274,3 +274,6 @@ neverallow all_untrusted_apps mediaextractor_update_service:service_manager find
# This will go away in a future Android release # This will go away in a future Android release
neverallow { all_untrusted_apps -untrusted_app_25 } proc_tty_drivers:file r_file_perms; neverallow { all_untrusted_apps -untrusted_app_25 } proc_tty_drivers:file r_file_perms;
neverallow all_untrusted_apps proc_tty_drivers:file ~r_file_perms; neverallow all_untrusted_apps proc_tty_drivers:file ~r_file_perms;
# Untrusted apps are not allowed to use cgroups.
neverallow all_untrusted_apps cgroup:file *;
...@@ -218,3 +218,6 @@ neverallow priv_app file_type:file link; ...@@ -218,3 +218,6 @@ neverallow priv_app file_type:file link;
# upon traceur to pass a file descriptor which they can then read # upon traceur to pass a file descriptor which they can then read
neverallow priv_app trace_data_file:dir *; neverallow priv_app trace_data_file:dir *;
neverallow priv_app trace_data_file:file { no_w_file_perms open }; neverallow priv_app trace_data_file:file { no_w_file_perms open };
# Do not allow priv_app access to cgroups.
neverallow priv_app cgroup:file *;
...@@ -122,6 +122,9 @@ allow system_app { ...@@ -122,6 +122,9 @@ allow system_app {
proc_version proc_version
}:file r_file_perms; }:file r_file_perms;
# Settings app writes to /dev/stune/foreground/tasks.
allow system_app cgroup:file w_file_perms;
control_logd(system_app) control_logd(system_app)
read_runtime_log_tags(system_app) read_runtime_log_tags(system_app)
get_prop(system_app, device_logging_prop) get_prop(system_app, device_logging_prop)
......
...@@ -22,10 +22,6 @@ allow appdomain zygote_exec:file rx_file_perms; ...@@ -22,10 +22,6 @@ allow appdomain zygote_exec:file rx_file_perms;
# Notify zygote of death; # Notify zygote of death;
allow appdomain zygote:process sigchld; allow appdomain zygote:process sigchld;
# Place process into foreground / background
allow appdomain cgroup:dir { search write };
allow appdomain cgroup:file rw_file_perms;
# Read /data/dalvik-cache. # Read /data/dalvik-cache.
allow appdomain dalvikcache_data_file:dir { search getattr }; allow appdomain dalvikcache_data_file:dir { search getattr };
allow appdomain dalvikcache_data_file:file r_file_perms; allow appdomain dalvikcache_data_file:file r_file_perms;
......
...@@ -258,9 +258,34 @@ allow domain selinuxfs:file getattr; ...@@ -258,9 +258,34 @@ allow domain selinuxfs:file getattr;
allow domain sysfs:dir search; allow domain sysfs:dir search;
allow domain selinuxfs:filesystem getattr; allow domain selinuxfs:filesystem getattr;
# For /acct/uid/*/tasks. # Path resolution access in cgroups.
allow domain cgroup:dir { search write }; allow domain cgroup:dir search;
allow domain cgroup:file w_file_perms; allow { coredomain -appdomain } cgroup:dir w_dir_perms;
allow { coredomain -appdomain } cgroup:file w_file_perms;
# TODO(b/110043362): Clean up cgroup access from app domains.
allow {
# Can not use all_untrusted_apps macro here, so expanding inline.
# This list is essentially { appdomain -all_untrusted_apps -priv_app }
appdomain
-ephemeral_app
-isolated_app
-mediaprovider
-untrusted_app
-untrusted_app_25
-untrusted_app_27
-untrusted_app_all
-priv_app
} cgroup:file w_file_perms;
auditallow appdomain cgroup:file w_file_perms;
# TODO(b/110043362): Clean up cgroup access from non-system domains.
allow { domain -coredomain } cgroup:file w_file_perms;
auditallow {
domain
-coredomain
-vendor_init
} cgroup:file w_file_perms;
# Almost all processes log tracing information to # Almost all processes log tracing information to
# /sys/kernel/debug/tracing/trace_marker # /sys/kernel/debug/tracing/trace_marker
......
...@@ -93,7 +93,7 @@ allow init sysfs:dir mounton; ...@@ -93,7 +93,7 @@ allow init sysfs:dir mounton;
allow init tmpfs:dir create_dir_perms; allow init tmpfs:dir create_dir_perms;
allow init tmpfs:dir mounton; allow init tmpfs:dir mounton;
allow init cgroup:dir create_dir_perms; allow init cgroup:dir create_dir_perms;
r_dir_file(init, cgroup) allow init cgroup:file rw_file_perms;
allow init cpuctl_device:dir { create mounton }; allow init cpuctl_device:dir { create mounton };
# /config # /config
......
...@@ -15,6 +15,7 @@ allow vendor_init rootfs:lnk_file { create unlink }; ...@@ -15,6 +15,7 @@ allow vendor_init rootfs:lnk_file { create unlink };
# Create cgroups mount points in tmpfs and mount cgroups on them. # Create cgroups mount points in tmpfs and mount cgroups on them.
allow vendor_init cgroup:dir create_dir_perms; allow vendor_init cgroup:dir create_dir_perms;
allow vendor_init cgroup:file w_file_perms;
# /config # /config
allow vendor_init configfs:dir mounton; allow vendor_init configfs:dir mounton;
......
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