Skip to content
Snippets Groups Projects
Commit d345906b authored by Jin Qian's avatar Jin Qian
Browse files

Define policy for /proc/uid_io/stats

New procfs file read by storaged to dump fg/bg IO usage.

Remove kmsg rule since it's no longer used by storaged.

Allow storaged to find permission_service to translate UID
to package name.

Test: adb shell storaged -u
Bug: 34198239
Change-Id: I74654662c75571cbe166cf2b8cbab84828218cbd
parent 615b60bd
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ genfscon proc /timer_stats u:object_r:proc_timer:s0 ...@@ -32,6 +32,7 @@ genfscon proc /timer_stats u:object_r:proc_timer:s0
genfscon proc /tty/drivers u:object_r:proc_tty_drivers:s0 genfscon proc /tty/drivers u:object_r:proc_tty_drivers:s0
genfscon proc /uid_cputime/show_uid_stat u:object_r:proc_uid_cputime_showstat:s0 genfscon proc /uid_cputime/show_uid_stat u:object_r:proc_uid_cputime_showstat:s0
genfscon proc /uid_cputime/remove_uid_range u:object_r:proc_uid_cputime_removeuid:s0 genfscon proc /uid_cputime/remove_uid_range u:object_r:proc_uid_cputime_removeuid:s0
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_procstat/set u:object_r:proc_uid_procstat_set:s0
genfscon proc /zoneinfo u:object_r:proc_zoneinfo:s0 genfscon proc /zoneinfo u:object_r:proc_zoneinfo:s0
......
...@@ -4,14 +4,14 @@ type storaged_exec, exec_type, file_type; ...@@ -4,14 +4,14 @@ type storaged_exec, exec_type, file_type;
init_daemon_domain(storaged) init_daemon_domain(storaged)
# Write to /dev/kmsg (opened in init)
allow storaged kmsg_device:chr_file { write append };
# Read access to pseudo filesystems # Read access to pseudo filesystems
r_dir_file(storaged, sysfs_type) r_dir_file(storaged, sysfs_type)
r_dir_file(storaged, proc_net) r_dir_file(storaged, proc_net)
r_dir_file(storaged, domain) r_dir_file(storaged, domain)
# Read /proc/uid_io/stats
allow storaged proc_uid_io_stats:file r_file_perms;
allow storaged self:capability { setgid setuid sys_nice sys_ptrace }; allow storaged self:capability { setgid setuid sys_nice sys_ptrace };
userdebug_or_eng(` userdebug_or_eng(`
...@@ -22,6 +22,8 @@ userdebug_or_eng(` ...@@ -22,6 +22,8 @@ userdebug_or_eng(`
# Binder permissions # Binder permissions
allow storaged storaged_service:service_manager add; allow storaged storaged_service:service_manager add;
allow storaged permission_service:service_manager find;
binder_use(storaged) binder_use(storaged)
binder_call(storaged, system_server) binder_call(storaged, system_server)
......
...@@ -23,6 +23,7 @@ type proc_timer, fs_type; ...@@ -23,6 +23,7 @@ type proc_timer, fs_type;
type proc_tty_drivers, fs_type; type proc_tty_drivers, fs_type;
type proc_uid_cputime_showstat, fs_type; type proc_uid_cputime_showstat, fs_type;
type proc_uid_cputime_removeuid, fs_type; type proc_uid_cputime_removeuid, fs_type;
type proc_uid_io_stats, fs_type;
type proc_uid_procstat_set, fs_type; type proc_uid_procstat_set, fs_type;
type proc_zoneinfo, fs_type; type proc_zoneinfo, fs_type;
type selinuxfs, fs_type, mlstrustedobject; type selinuxfs, fs_type, mlstrustedobject;
......
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