From c39a735ab5212823b1d45a66a11d7873a0bc66ac Mon Sep 17 00:00:00 2001 From: "Kevin F. Haggerty" Date: Tue, 13 Nov 2018 22:09:58 -0700 Subject: [PATCH] msm8974-common: sepolicy: Label sysfs_msm_perf, resolve denials * avc: denied { write } for name="suspend_enabled" dev="sysfs" ino=10567 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_msm_perf:s0 tclass=file permissive=1 * avc: denied { open } for name="suspend_enabled" dev="sysfs" ino=10567 scontext=u:r:init:s0 tcontext=u:object_r:sysfs_msm_perf:s0 tclass=file permissive=1 Change-Id: I23d69f0442d126b2a6ac3aaeda5032856a4483f2 --- sepolicy/common/file_contexts | 3 +++ sepolicy/common/init.te | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sepolicy/common/file_contexts b/sepolicy/common/file_contexts index c8b3dfa..b0dd684 100644 --- a/sepolicy/common/file_contexts +++ b/sepolicy/common/file_contexts @@ -46,6 +46,9 @@ # sysfs - block/storage /sys/devices/msm_sdcc\.[0-9]/mmc_host/mmc[0-9]/mmc[0-9]:[0-9]+/block/mmcblk[0-9]/stat u:object_r:sysfs_disk_stat:s0 +# sysfs - cpu/perf +/sys/module/msm_pm/modes/cpu[0-9](/.*)? u:object_r:sysfs_msm_perf:s0 + # sysfs - graphics/panel /sys/class/mhl(/.*)? u:object_r:sysfs_graphics:s0 /sys/devices/mdp\.[0-9](/.*)? u:object_r:sysfs_graphics:s0 diff --git a/sepolicy/common/init.te b/sepolicy/common/init.te index 8c86832..08935c1 100644 --- a/sepolicy/common/init.te +++ b/sepolicy/common/init.te @@ -7,8 +7,6 @@ allow init sysfs_input:file rw_file_perms; allow init sysfs_graphics:file r_file_perms; -allow init sysfs_sec_key:file w_file_perms; - allow init { sysfs_batteryinfo sysfs_graphics @@ -27,3 +25,8 @@ allow init { sysfs_sec_touchkey sysfs_sec_tsp }:file setattr; + +allow init { + sysfs_msm_perf + sysfs_sec_key +}:file w_file_perms;