Inseob Kim | ff43be2 | 2021-06-07 16:56:56 +0900 | [diff] [blame] | 1 | # healthd - battery/charger monitoring service daemon |
| 2 | type healthd, domain; |
| 3 | type healthd_exec, system_file_type, exec_type, file_type; |
| 4 | |
| 5 | # Write to /dev/kmsg |
| 6 | allow healthd kmsg_device:chr_file rw_file_perms; |
| 7 | |
| 8 | # Read access to pseudo filesystems. |
| 9 | allow healthd sysfs_type:dir search; |
| 10 | # Allow to read /sys/class/power_supply directory. |
| 11 | allow healthd sysfs:dir r_dir_perms; |
| 12 | r_dir_file(healthd, rootfs) |
| 13 | r_dir_file(healthd, cgroup) |
| 14 | r_dir_file(healthd, cgroup_v2) |
| 15 | |
| 16 | allow healthd self:global_capability_class_set { sys_tty_config }; |
| 17 | allow healthd self:global_capability_class_set sys_boot; |
| 18 | dontaudit healthd self:global_capability_class_set sys_resource; |
| 19 | |
| 20 | allow healthd self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; |
| 21 | |
| 22 | wakelock_use(healthd) |
| 23 | |
| 24 | hal_client_domain(healthd, hal_health) |
| 25 | |
| 26 | # Read/write to /sys/power/state |
| 27 | allow healthd sysfs_power:file rw_file_perms; |
| 28 | |
| 29 | # TODO: added to match above sysfs rule. Remove me? |
| 30 | allow healthd sysfs_usb:file write; |
| 31 | |
| 32 | r_dir_file(healthd, sysfs_batteryinfo) |
| 33 | |
| 34 | ### |
| 35 | ### healthd: charger mode |
| 36 | ### |
| 37 | |
| 38 | # Read /sys/fs/pstore/console-ramoops |
| 39 | # Don't worry about overly broad permissions for now, as there's |
| 40 | # only one file in /sys/fs/pstore |
| 41 | allow healthd pstorefs:dir r_dir_perms; |
| 42 | allow healthd pstorefs:file r_file_perms; |
| 43 | |
| 44 | allow healthd graphics_device:dir r_dir_perms; |
| 45 | allow healthd graphics_device:chr_file rw_file_perms; |
| 46 | allow healthd input_device:dir r_dir_perms; |
| 47 | allow healthd input_device:chr_file r_file_perms; |
| 48 | allow healthd tty_device:chr_file rw_file_perms; |
| 49 | allow healthd ashmem_device:chr_file execute; |
| 50 | allow healthd proc_sysrq:file rw_file_perms; |