From cdee7b6e789d63e59ddb0e2288aa9abfde7213e5 Mon Sep 17 00:00:00 2001 From: Ted Lin Date: Thu, 13 Jan 2022 16:30:37 +0800 Subject: [PATCH] fix avc denied for charge_stats 01-13 11:05:03.196 1000 3806 3806 I pixelstats-vend: type=1400 audit(0.0:32): avc: denied { search } for name="i2c-p9412" dev="sysfs" ino=59835 scontext=u:r:pixelstats_vendor:s0 tcontext=u:object_r:sysfs_wlc:s0 tclass=dir permissive=1 01-13 11:05:03.196 1000 3806 3806 I pixelstats-vend: type=1400 audit(0.0:33): avc: denied { read } for name="charge_stats" dev="sysfs" ino=70092 scontext=u:r:pixelstats_vendor:s0 tcontext=u:object_r:sysfs_wlc:s0 tclass=file permissive=1 01-13 11:05:03.196 1000 3806 3806 I pixelstats-vend: type=1400 audit(0.0:34): avc: denied { open } for path="/sys/devices/platform/10da0000.hsi2c/i2c-6/i2c-p9412/charge_stats" dev="sysfs" ino=70092 scontext=u:r:pixelstats_vendor:s0 tcontext=u:object_r:sysfs_wlc:s0 tclass=file permissive=1 01-13 11:05:03.196 1000 3806 3806 I pixelstats-vend: type=1400 audit(0.0:35): avc: denied { getattr } for path="/sys/devices/platform/10da0000.hsi2c/i2c-6/i2c-p9412/charge_stats" dev="sysfs" ino=70092 scontext=u:r:pixelstats_vendor:s0 tcontext=u:object_r:sysfs_wlc:s0 tclass=file permissive=1 Bug:208909060 Test: adb bugreport Change-Id: Idf43a85d07727bbeb8c3f34475da6f697573bfed Signed-off-by: Ted Lin --- whitechapel_pro/pixelstats_vendor.te | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/whitechapel_pro/pixelstats_vendor.te b/whitechapel_pro/pixelstats_vendor.te index 392c3b1c..a88db935 100644 --- a/whitechapel_pro/pixelstats_vendor.te +++ b/whitechapel_pro/pixelstats_vendor.te @@ -2,3 +2,7 @@ binder_use(pixelstats_vendor) allow pixelstats_vendor sysfs_scsi_devices_0000:file rw_file_perms; allow pixelstats_vendor sysfs_pixelstats:file r_file_perms; + +# Wireless charge +allow pixelstats_vendor sysfs_wlc:dir search; +allow pixelstats_vendor sysfs_wlc:file rw_file_perms;