From 0cf1cb02d9f6993b3012dad782ff6411d455bc26 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Sat, 18 Jan 2020 09:54:43 +0800 Subject: [PATCH] [ALPS03940710] add label for usb hidl [Detail] Add label "sysfs_dual_role_usb20" for access usb20 dual role path. MTK-Commit-Id: 5022209befe791a0045b155fc070d831ef5f7beb Change-Id: Ib7ff9a04833aff10945f51f854026a29df0747ca CR-Id: ALPS03940710 Feature: [Android Default] SELinux, SEAndroid, and SE-MTK --- non_plat/file.te | 3 +++ non_plat/file_contexts | 1 + non_plat/hal_usb.te | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 non_plat/hal_usb.te diff --git a/non_plat/file.te b/non_plat/file.te index 5d53c27..276a4b3 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -267,3 +267,6 @@ type sysfs_pump_express, fs_type, sysfs_type; # Widevine move data/mediadrm folder from system to vendor type mediadrm_vendor_data_file, file_type, data_file_type; + +# mtk usb hal +type sysfs_dual_role_usb20, fs_type, sysfs_type; \ No newline at end of file diff --git a/non_plat/file_contexts b/non_plat/file_contexts index 3d1cb98..c286c61 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -484,6 +484,7 @@ /sys/bus/platform/drivers/meta_uart_port_info/meta_uart_port_info(/.*)? u:object_r:sysfs_uart_info:s0 /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 ############################# # debugfs files diff --git a/non_plat/hal_usb.te b/non_plat/hal_usb.te new file mode 100644 index 0000000..33e78d1 --- /dev/null +++ b/non_plat/hal_usb.te @@ -0,0 +1,2 @@ +allow hal_usb_default sysfs_dual_role_usb20:dir search; +allow hal_usb_default sysfs_dual_role_usb20:file {open read getattr};