From 42d69738b4c89529fd2d6cbb36ca384091626102 Mon Sep 17 00:00:00 2001 From: "gang.wei" Date: Sat, 18 Jan 2020 10:07:15 +0800 Subject: [PATCH] [ALPS04110031] Add permission [Detail] Add selinux permission for usb online status checking. MTK-Commit-Id: fa788cddb4ddc90b3611a67f5905765410dd54d5 Change-Id: Ica59ffca98340e03be24f7ec7e4b62390ef12de9 CR-Id: ALPS04110031 Feature: SP META Tool --- non_plat/meta_tst.te | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/non_plat/meta_tst.te b/non_plat/meta_tst.te index cdce5b0..f1f71d1 100644 --- a/non_plat/meta_tst.te +++ b/non_plat/meta_tst.te @@ -402,3 +402,12 @@ set_prop(meta_tst, powerctl_prop); # Purpose : Allow meta_tst to set system clock # avc: denied { sys_time } for capability=25 scontext=u:r:meta_tst:s0 tcontext=u:r:meta_tst:s0 tclass=capability permissive=0 allow meta_tst self:capability sys_time; + +# Data: W18.35 +# Operation: Android P migration +# Purpose : check usb online status +# avc: denied { search } for name="power_supply" dev="sysfs" ino=8712 scontext=u:r:meta_tst:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=dir permissive=0 +# avc: denied { read } for name="online" dev="sysfs" ino=8764 scontext=u:r:meta_tst:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=0 +# avc: denied { open } for path="/sys/devices/platform/mt_charger/power_supply/usb/online" dev="sysfs" ino=8764 scontext=u:r:meta_tst:s0 tcontext=u:object_r:sysfs_batteryinfo:s0 tclass=file permissive=0 +allow meta_tst sysfs_batteryinfo:dir search; +allow meta_tst sysfs_batteryinfo:file {read open};