Skip to content
Snippets Groups Projects
Commit 80ee23f7 authored by Marissa Wall's avatar Marissa Wall Committed by Jeffrey Vander Stoep
Browse files

Restrict access to uid_concurrent_*_time

Do not let apps read uid_concurrent_active_time and
uid_concurrent_policy_time.

b/68399339

Test: Check that they can't be read from the shell
    without root permissions and system_server was able
    to read them

Change-Id: I6f09ef608607cb9f4084ba403a1e7254b8c49a06
parent e9ae7735
No related branches found
No related tags found
No related merge requests found
......@@ -541,3 +541,12 @@ neverallow {
-bluetooth
-system_app
} bluetooth_prop:file create_file_perms;
# Apps cannot access proc_uid_time_in_state
neverallow appdomain proc_uid_time_in_state:file *;
# Apps cannot access proc_uid_concurrent_active_time
neverallow appdomain proc_uid_concurrent_active_time:file *;
# Apps cannot access proc_uid_concurrent_policy_time
neverallow appdomain proc_uid_concurrent_policy_time:file *;
......@@ -127,9 +127,6 @@ neverallow all_untrusted_apps {
# Avoid all access to kernel configuration
neverallow all_untrusted_apps config_gz:file { no_rw_file_perms no_x_file_perms };
# Only system_server can access proc_uid_time_in_state
neverallow { domain -init -system_server } proc_uid_time_in_state:file *;
# Do not allow untrusted apps access to preloads data files
neverallow all_untrusted_apps preloads_data_file:file no_rw_file_perms;
......
......@@ -473,6 +473,8 @@
proc_sched
proc_swaps
proc_uid_time_in_state
proc_uid_concurrent_active_time
proc_uid_concurrent_policy_time
proc_uptime
proc_version
proc_vmallocinfo))
......
......@@ -74,6 +74,8 @@ genfscon proc /uid_cputime/remove_uid_range u:object_r:proc_uid_cputime_removeui
genfscon proc /uid_io/stats u:object_r:proc_uid_io_stats:s0
genfscon proc /uid_procstat/set u:object_r:proc_uid_procstat_set:s0
genfscon proc /uid_time_in_state u:object_r:proc_uid_time_in_state:s0
genfscon proc /uid_concurrent_active_time u:object_r:proc_uid_concurrent_active_time:s0
genfscon proc /uid_concurrent_policy_time u:object_r:proc_uid_concurrent_policy_time:s0
genfscon proc /uptime u:object_r:proc_uptime:s0
genfscon proc /version u:object_r:proc_version:s0
genfscon proc /vmallocinfo u:object_r:proc_vmallocinfo:s0
......
......@@ -694,6 +694,8 @@ allow system_server {
proc_stat
proc_uid_cputime_showstat
proc_uid_time_in_state
proc_uid_concurrent_active_time
proc_uid_concurrent_policy_time
proc_version
proc_vmallocinfo
}:file r_file_perms;
......
......@@ -52,6 +52,8 @@ type proc_uid_cputime_removeuid, fs_type;
type proc_uid_io_stats, fs_type;
type proc_uid_procstat_set, fs_type;
type proc_uid_time_in_state, fs_type;
type proc_uid_concurrent_active_time, fs_type;
type proc_uid_concurrent_policy_time, fs_type;
type proc_uptime, fs_type;
type proc_version, fs_type;
type proc_vmallocinfo, fs_type;
......
......@@ -164,6 +164,8 @@ allow vendor_init {
-sdcard_type
-rootfs
-proc_uid_time_in_state
-proc_uid_concurrent_active_time
-proc_uid_concurrent_policy_time
}:file { open read setattr };
allow vendor_init {
......@@ -172,6 +174,8 @@ allow vendor_init {
-sdcard_type
-rootfs
-proc_uid_time_in_state
-proc_uid_concurrent_active_time
-proc_uid_concurrent_policy_time
}:dir { open read setattr search };
# chown/chmod on devices, e.g. /dev/ttyHS0
......
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