From 296823785dae503fbf55b4a97d6d05a0b68ae430 Mon Sep 17 00:00:00 2001 From: Mason Wang Date: Thu, 17 Mar 2022 13:38:06 +0800 Subject: [PATCH] vendor_init: Fix touch avc denial of high_sensitivity.[DO NOT MERGE] Fixed following avc denial: avc: denied { write } for name="high_sensitivity" dev="proc" ino=4026534550 scontext=u:r:vendor_init:s0 tcontext=u:object_r:proc:s0 tclass=file permissive=1 //The file node is proc/focaltech_touch/high_sensitivity Bug: 199105136 Test: Verify pass by checking device log are w/o above errors while switching setting/display/increase touch sensitivity. Change-Id: I8dbe4190056767407413082580320593292725fe --- whitechapel_pro/file.te | 5 ++++- whitechapel_pro/genfs_contexts | 3 ++- whitechapel_pro/vendor_init.te | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/whitechapel_pro/file.te b/whitechapel_pro/file.te index c6c274f3..798b1e1f 100644 --- a/whitechapel_pro/file.te +++ b/whitechapel_pro/file.te @@ -93,4 +93,7 @@ type sysfs_st33spi, sysfs_type, fs_type; type sysfs_gpu, sysfs_type, fs_type; # USB-C throttling stats -type sysfs_usbc_throttling_stats, sysfs_type, fs_type; \ No newline at end of file +type sysfs_usbc_throttling_stats, sysfs_type, fs_type; + +# Touch +type proc_touch, proc_type, fs_type; \ No newline at end of file diff --git a/whitechapel_pro/genfs_contexts b/whitechapel_pro/genfs_contexts index 1d0bd2fd..a2219599 100644 --- a/whitechapel_pro/genfs_contexts +++ b/whitechapel_pro/genfs_contexts @@ -29,7 +29,8 @@ genfscon sysfs /devices/soc0/revision u # Touch genfscon sysfs /devices/platform/10d10000.spi/spi_master/spi0/spi0.0/synaptics_tcm.0/sysfs u:object_r:sysfs_touch:s0 -genfscon sysfs /devices/virtual/sec/tsp u:object_r:sysfs_touch:s0 +genfscon sysfs /devices/virtual/sec/tsp u:object_r:sysfs_touch:s0 +genfscon proc /focaltech_touch u:object_r:proc_touch:s0 # tracefs genfscon tracefs /events/dmabuf_heap/dma_heap_stat u:object_r:debugfs_tracing:s0 diff --git a/whitechapel_pro/vendor_init.te b/whitechapel_pro/vendor_init.te index f936f4e0..4410e6d9 100644 --- a/whitechapel_pro/vendor_init.te +++ b/whitechapel_pro/vendor_init.te @@ -23,3 +23,6 @@ allow vendor_init sysfs_st33spi:file w_file_perms; # Fingerprint property set_prop(vendor_init, vendor_fingerprint_prop) + +# Touch +allow vendor_init proc_touch:file w_file_perms;