From 3640ebadbfbdcd9e36c13854a1b034c4224ecd3f Mon Sep 17 00:00:00 2001 From: Shwetha B Date: Mon, 2 Sep 2024 13:44:11 +0530 Subject: [PATCH] Sepolicy for power-stats and power hal Add sepolicy for vendor power and power stats implementation. Tracked-On: OAM-126029 Signed-off-by: Shwetha B --- power/file_contexts | 2 +- power/hal_power_service.te | 2 ++ power_stats/file_contexts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 power_stats/file_contexts diff --git a/power/file_contexts b/power/file_contexts index c6cf2234..5102b1fb 100644 --- a/power/file_contexts +++ b/power/file_contexts @@ -1,4 +1,4 @@ # Power HAL service -/(vendor|system/vendor)/bin/hw/android\.hardware\.power@[0-9]+.?[0-9]*-service u:object_r:hal_power_service_exec:s0 +/(vendor|system/vendor)/bin/hw/android\.hardware\.power-service\.intel u:object_r:hal_power_default_exec:s0 # Power HAL helper (/system)?/vendor/bin/power_hal_helper u:object_r:power_hal_helper_exec:s0 diff --git a/power/hal_power_service.te b/power/hal_power_service.te index b16801dc..f327e49d 100644 --- a/power/hal_power_service.te +++ b/power/hal_power_service.te @@ -1,4 +1,6 @@ +#type hal_power_service, domain; type hal_power_service_exec, exec_type, vendor_file_type, file_type; +#init_daemon_domain(hal_power_service) allow hal_power_service cgroup:file rw_file_perms; allowxperm hal_power_service fs_type:file ioctl { FIOCLEX FIONCLEX }; diff --git a/power_stats/file_contexts b/power_stats/file_contexts new file mode 100644 index 00000000..f05fd8a2 --- /dev/null +++ b/power_stats/file_contexts @@ -0,0 +1 @@ +/vendor/bin/hw/android\.hardware\.power\.stats-service\.intel u:object_r:hal_power_stats_default_exec:s0