LuK1337 | 8928745 | 2018-01-11 12:31:01 +0200 | [diff] [blame] | 1 | type perfd, domain; |
| 2 | type perfd_exec, exec_type, vendor_file_type, file_type; |
| 3 | |
| 4 | init_daemon_domain(perfd) |
| 5 | |
Michael Bestas | 3ef5cf8 | 2018-05-18 23:21:41 +0300 | [diff] [blame] | 6 | allow perfd self:capability { fsetid kill }; |
LuK1337 | 443c0d8 | 2018-02-28 09:58:11 +0000 | [diff] [blame] | 7 | |
LuK1337 | 8928745 | 2018-01-11 12:31:01 +0200 | [diff] [blame] | 8 | allow perfd { |
| 9 | sysfs_devices_system_cpu |
| 10 | sysfs_cpu_online |
| 11 | sysfs_scsi_host |
| 12 | proc |
| 13 | sysfs |
| 14 | }:file rw_file_perms; |
| 15 | |
| 16 | # Allow access to devfreq sysfs entry |
| 17 | r_dir_file(perfd, sysfs_devfreq) |
| 18 | allow perfd sysfs_devfreq:file write; |
| 19 | |
| 20 | # Allow access to msm_perf sysfs entry |
| 21 | r_dir_file(perfd, sysfs_msm_perf) |
| 22 | allow perfd sysfs_msm_perf:file write; |
| 23 | |
| 24 | # Allow access to msm_power sysfs entry |
| 25 | r_dir_file(perfd, sysfs_msm_power) |
| 26 | allow perfd sysfs_msm_power:file write; |
| 27 | |
| 28 | # Allow access to lib sysfs entry |
| 29 | allow perfd sysfs_lib:file w_file_perms; |
| 30 | |
| 31 | # Allow access to kgsl sysfs entry |
| 32 | r_dir_file(perfd, sysfs_kgsl) |
Michael Bestas | c51e127 | 2018-03-22 18:29:47 +0200 | [diff] [blame] | 33 | allow perfd sysfs_kgsl:file write; |
LuK1337 | 8928745 | 2018-01-11 12:31:01 +0200 | [diff] [blame] | 34 | |
LuK1337 | 443c0d8 | 2018-02-28 09:58:11 +0000 | [diff] [blame] | 35 | # Allow access to thermal sysfs entry |
| 36 | allow perfd sysfs_thermal:dir search; |
| 37 | allow perfd sysfs_thermal:file w_file_perms; |
| 38 | |
LuK1337 | 8928745 | 2018-01-11 12:31:01 +0200 | [diff] [blame] | 39 | # mpctl socket |
Michael Bestas | 55286ff | 2016-12-04 21:05:56 +0200 | [diff] [blame] | 40 | allow perfd mpctl_socket:dir rw_dir_perms; |
| 41 | allow perfd mpctl_socket:sock_file create_file_perms; |
LuK1337 | 8928745 | 2018-01-11 12:31:01 +0200 | [diff] [blame] | 42 | |
| 43 | # default_values file |
| 44 | allow perfd mpctl_data_file:dir rw_dir_perms; |
| 45 | allow perfd mpctl_data_file:file create_file_perms; |
| 46 | |
| 47 | # Thermal lib access |
| 48 | unix_socket_connect(perfd, thermal, thermal-engine) |
| 49 | |
Matt Wagantall | 731dac5 | 2015-11-24 12:11:11 -0800 | [diff] [blame] | 50 | # Allow perfd to check for existence of other processes |
| 51 | allow perfd domain:process signull; |
| 52 | |
LuK1337 | 8928745 | 2018-01-11 12:31:01 +0200 | [diff] [blame] | 53 | # Allow perfd to set properties |
| 54 | set_prop(perfd, freq_prop) |
| 55 | |
| 56 | allow perfd cgroup:file r_file_perms; |
| 57 | allow perfd sysfs:dir r_dir_perms; |
LuK1337 | 443c0d8 | 2018-02-28 09:58:11 +0000 | [diff] [blame] | 58 | |
| 59 | r_dir_file(perfd, hal_power_default) |