From 608a6fd13915ab66f79a5f180542727d57f088d1 Mon Sep 17 00:00:00 2001 From: "hua.tian" Date: Sat, 18 Jan 2020 10:17:51 +0800 Subject: [PATCH] [ALPS04709387] Support to catch MCUPM log Add SELINUX rule for MCUPM log. MTK-Commit-Id: 9fb8d206f37f0fb00581f4417473974c014ff0dd Change-Id: I7a935534d4975e444b556d133ff222a4c144b5ca CR-Id: ALPS04709387 Feature: Mobile Log Tool --- plat_private/file.te | 2 ++ plat_private/file_contexts | 1 + plat_private/genfs_contexts | 1 + plat_private/mobile_log_d.te | 5 +++++ plat_public/device.te | 1 + 5 files changed, 10 insertions(+) diff --git a/plat_private/file.te b/plat_private/file.te index b999454..268f03b 100755 --- a/plat_private/file.te +++ b/plat_private/file.te @@ -18,3 +18,5 @@ type access_sys_file, fs_type, sysfs_type; type mddb_filter_data_file, file_type, data_file_type, core_data_file_type; type debuglog_data_file, file_type, data_file_type, core_data_file_type; + +type sysfs_mcupm, fs_type, sysfs_type; \ No newline at end of file diff --git a/plat_private/file_contexts b/plat_private/file_contexts index 5d8fdf1..3b2d143 100644 --- a/plat_private/file_contexts +++ b/plat_private/file_contexts @@ -45,3 +45,4 @@ /dev/ubi[_0-9]* u:object_r:mtd_device:s0 /dev/block/mtd(.*)? u:object_r:mtd_device:s0 /dev/block/mntlblk(.*)? u:object_r:mtd_device:s0 +/dev/mcupm(/.*)? u:object_r:mcupm_device:s0 diff --git a/plat_private/genfs_contexts b/plat_private/genfs_contexts index def96b3..fdf8565 100644 --- a/plat_private/genfs_contexts +++ b/plat_private/genfs_contexts @@ -2,3 +2,4 @@ genfscon sysfs /devices/platform/vibrator@0/leds/vibrator u:object_r:sysfs_vibrator:s0 genfscon sysfs /block/mmcblk0rpmb/size u:object_r:access_sys_file:s0 +genfscon sysfs /devices/virtual/misc/mcupm u:object_r:sysfs_mcupm:s0 diff --git a/plat_private/mobile_log_d.te b/plat_private/mobile_log_d.te index ef7c7b6..549d130 100644 --- a/plat_private/mobile_log_d.te +++ b/plat_private/mobile_log_d.te @@ -81,3 +81,8 @@ allow mobile_log_d debuglog_data_file:dir {relabelto create_dir_perms}; allow mobile_log_d debuglog_data_file:file create_file_perms; allow mobile_log_d system_data_file:dir create_dir_perms; file_type_auto_trans(mobile_log_d, system_data_file, debuglog_data_file) + +#mcupm +allow mobile_log_d mcupm_device:chr_file r_file_perms; +allow mobile_log_d sysfs_mcupm:file w_file_perms; +allow mobile_log_d sysfs_mcupm:dir search; diff --git a/plat_public/device.te b/plat_public/device.te index b87df4c..43e0071 100644 --- a/plat_public/device.te +++ b/plat_public/device.te @@ -3,3 +3,4 @@ # ============================================== type mtd_device, dev_type; +type mcupm_device, dev_type;