From 37801d6a65e1e3aafdbf87be8a51261502266ba2 Mon Sep 17 00:00:00 2001 From: Dian Wang Date: Sat, 18 Jan 2020 09:59:47 +0800 Subject: [PATCH] [ALPS03888283] usb close and bootprof [Detail] modify sepolicy [Solution] modify sepolicy for read and write system and proc/bootprof MTK-Commit-Id: 2df7f3b055778e043c9cc2ad75a2c9a7abcb7ad6 Change-Id: I3c4f4dd2435a2b2dee72c54d60e9e1adf2ec671f CR-Id: ALPS03888283 Feature: SP META Tool --- non_plat/file.te | 1 + non_plat/file_contexts | 1 + non_plat/meta_tst.te | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/non_plat/file.te b/non_plat/file.te index e80c9c3..01d0c0d 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -260,6 +260,7 @@ 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; +type sysfs_usb_cmode, fs_type, sysfs_type; # Date : WK1820 # Purpose : for charger to access vbus info and pump_express diff --git a/non_plat/file_contexts b/non_plat/file_contexts index 7abec2e..0434854 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -485,6 +485,7 @@ /sys/devices/platform/(charger|battery)/ADC_Charger_Voltage u:object_r:sysfs_vbus:s0 /sys/devices/platform/(charger|battery)/Pump_Express u:object_r:sysfs_pump_express:s0 /sys/devices/platform/mt_usb/musb-hdrc/dual_role_usb(/.*)? u:object_r:sysfs_dual_role_usb20:s0 +/sys/devices/platform/mt_usb/musb-hdrc/cmode(/.*)? u:object_r:sysfs_usb_cmode:s0 ############################# # debugfs files diff --git a/non_plat/meta_tst.te b/non_plat/meta_tst.te index 86ff33d..59cad79 100644 --- a/non_plat/meta_tst.te +++ b/non_plat/meta_tst.te @@ -209,6 +209,8 @@ allow meta_tst sysfs_uart_info:file rw_file_perms; allow meta_tst sysfs_boot_mode:file rw_file_perms; allow meta_tst sysfs_android_usb:file rw_file_perms; allow meta_tst sysfs_android_usb:dir search; +allow meta_tst sysfs_usb_cmode:file rw_file_perms; +allow meta_tst sysfs_usb_cmode:dir search; #Date: W16.17 # Purpose: N Migration For meta_tst load MD NVRAM database @@ -340,8 +342,7 @@ allow meta_tst audiohal_prop:property_service set; #Data:W1745 # Purpose : Allow meta_tst to open and read proc/bootprof -allow meta_tst proc:file write; -allow meta_tst proc:file getattr; +allow meta_tst proc_bootprof:file {write open read}; # Date:W17.51 # Operation : lbs hal