From 011d637e432bb1eb00b745185f3826059baada20 Mon Sep 17 00:00:00 2001 From: bengris32 Date: Tue, 5 Sep 2023 13:12:00 +0100 Subject: [PATCH] basic: non_plat: Import pixel `rebalance_interrupts` rules Change-Id: Idb03fd0632995e52cc9b9f008bd46002a6cc1628 Signed-off-by: bengris32 --- basic/non_plat/file.te | 2 ++ basic/non_plat/file_contexts | 2 ++ basic/non_plat/genfs_contexts | 4 ++++ basic/non_plat/rebalance_interrupts.te | 11 +++++++++++ 4 files changed, 19 insertions(+) create mode 100644 basic/non_plat/rebalance_interrupts.te diff --git a/basic/non_plat/file.te b/basic/non_plat/file.te index 20d1581..5ccbcf7 100644 --- a/basic/non_plat/file.te +++ b/basic/non_plat/file.te @@ -44,6 +44,7 @@ type proc_mtk_es_reg_dump, fs_type, proc_type; type proc_ccci_dump, fs_type, proc_type; type proc_log_much, fs_type, proc_type; type proc_vm_dirty, fs_type, proc_type; +type proc_irq, fs_type, proc_type; #For icusb type proc_icusb, fs_type, proc_type; @@ -184,6 +185,7 @@ type sysfs_vcore_debug, fs_type, sysfs_type; type sysfs_systracker, fs_type, sysfs_type; type sysfs_keypad_file, fs_type, sysfs_type; type sysfs_vcp, fs_type, sysfs_type; +type sysfs_irq, fs_type, sysfs_type; # apusys_queue sysfs file type sysfs_apusys_queue, fs_type, sysfs_type; diff --git a/basic/non_plat/file_contexts b/basic/non_plat/file_contexts index eaffa3c..9192aef 100644 --- a/basic/non_plat/file_contexts +++ b/basic/non_plat/file_contexts @@ -691,6 +691,8 @@ /(vendor|system/vendor)/bin/xcap u:object_r:xcap_exec:s0 +/(vendor|system/vendor)/bin/rebalance_interrupts-vendor.mediatek u:object_r:rebalance_interrupts_vendor_exec:s0 + /(vendor|system/vendor)/bin/biosensord_nvram u:object_r:biosensord_nvram_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.bluetooth@1\.[0-9]-service-mediatek u:object_r:mtk_hal_bluetooth_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.gnss@2\.1-service-mediatek u:object_r:mtk_hal_gnss_exec:s0 diff --git a/basic/non_plat/genfs_contexts b/basic/non_plat/genfs_contexts index 66ba2e1..3cc6965 100644 --- a/basic/non_plat/genfs_contexts +++ b/basic/non_plat/genfs_contexts @@ -674,3 +674,7 @@ genfscon sysfs /devices/platform/13000000.mali/total_gpu_mem u:object_r:sysfs_gp genfscon sysfs /devices/platform/13040000.mali/dma_buf_gpu_mem u:object_r:sysfs_gpu:s0 genfscon sysfs /devices/platform/13040000.mali/kprcs u:object_r:sysfs_gpu:s0 genfscon sysfs /devices/platform/13040000.mali/total_gpu_mem u:object_r:sysfs_gpu:s0 + +# IRQ +genfscon sysfs /kernel/irq u:object_r:sysfs_irq:s0 +genfscon proc /irq u:object_r:proc_irq:s0 diff --git a/basic/non_plat/rebalance_interrupts.te b/basic/non_plat/rebalance_interrupts.te new file mode 100644 index 0000000..a76b7d6 --- /dev/null +++ b/basic/non_plat/rebalance_interrupts.te @@ -0,0 +1,11 @@ +# rebalance_interrupts vendor +type rebalance_interrupts_vendor, domain; + +type rebalance_interrupts_vendor_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(rebalance_interrupts_vendor) + +allow rebalance_interrupts_vendor sysfs_irq:dir r_dir_perms; +allow rebalance_interrupts_vendor sysfs_irq:file r_file_perms; +allow rebalance_interrupts_vendor proc_irq:dir r_dir_perms; +allow rebalance_interrupts_vendor proc_irq:file { rw_file_perms setattr }; +allow rebalance_interrupts_vendor self:capability { chown setuid setgid };