From 340e51e71ca62516cddb6d17f5dee95fdb526d77 Mon Sep 17 00:00:00 2001 From: Browse Zhang Date: Sat, 18 Jan 2020 09:39:04 +0800 Subject: [PATCH] [ALPS03503758] P migration selinux build failed fix For /proc/uid_procstat/set from UsageStatsService MTK-Commit-Id: c2f372432b08f78b8e5b9f7cc08b1b436bfe7161 Change-Id: I45b7bbfbd2c0ab7e098983d40722e4274e8e783a CR-Id: ALPS03503758 Feature: [Android Default] SELinux, SEAndroid, and SE-MTK --- non_plat/file.te | 3 +++ non_plat/file_contexts | 3 ++- non_plat/system_server.te | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/non_plat/file.te b/non_plat/file.te index 6928a8a..f553a8e 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -256,3 +256,6 @@ type consyslog_data_file, file_type, data_file_type; # Purpose : for meta to get com port type and uart port info type sysfs_comport_type, fs_type, sysfs_type; type sysfs_uart_info, fs_type, sysfs_type; + +# Purpose : for /proc/uid_procstat/set from UsageStatsService +type proc_uid_procstat, fs_type, proc_type; diff --git a/non_plat/file_contexts b/non_plat/file_contexts index 1fdc9ee..a9ae165 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -561,7 +561,8 @@ /(system\/vendor|vendor)/bin/hw/vendor\.mediatek\.hardware\.pq@2\.0-service u:object_r:mtk_hal_pq_exec:s0 # Keymaster Attestation Hal /(system\/vendor|vendor)/bin/hw/vendor\.mediatek\.hardware\.keymaster_attestation@1\.1-service u:object_r:hal_keymaster_attestation_exec:s0 - +#For /proc/uid_procstat/set from UsageStatsService +/proc/uid_procstat/set u:object_r:proc_uid_procstat:s0 ############################# # System/bin files diff --git a/non_plat/system_server.te b/non_plat/system_server.te index 5ec9d53..a5f4e6f 100644 --- a/non_plat/system_server.te +++ b/non_plat/system_server.te @@ -17,7 +17,6 @@ allow system_server wmtWifi_device:chr_file w_file_perms; #allow system_server proc:file w_file_perms; # /data/dontpanic access. -typeattribute system_server data_between_core_and_vendor_violators; allow system_server dontpanic_data_file:dir search; # /data/agps_supl access. @@ -216,3 +215,7 @@ allow system_server mtk_thermal_config_prop:property_service set; # Purpose : perfmgr permission allow system_server proc_perfmgr:dir {read search}; allow system_server proc_perfmgr:file {open read ioctl}; + +# Date :WK1817 +# Purpose : for /proc/uid_procstat/set from UsageStatsService +allow system_server proc_uid_procstat:file w_file_perms; \ No newline at end of file