From 64d5afcf51714da39bfd156c5a300f4dd8b3a241 Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Tue, 10 Nov 2020 00:39:20 +0530 Subject: [PATCH] sepolicy_vndr: Add sepolicy support for vendor limits hal Add sepolicy support for vendor limits hal and limits hal service. Change-Id: Ice953d59dcda0132c00f31cf8c1609666c7fcf2b --- generic/vendor/common/file_contexts | 1 + generic/vendor/common/hwservice.te | 1 + generic/vendor/common/hwservice_contexts | 1 + .../vendor/common/vendor_hal_limits_qti.te | 42 +++++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 generic/vendor/common/vendor_hal_limits_qti.te diff --git a/generic/vendor/common/file_contexts b/generic/vendor/common/file_contexts index 8c56ccdd..9475564e 100644 --- a/generic/vendor/common/file_contexts +++ b/generic/vendor/common/file_contexts @@ -120,6 +120,7 @@ /vendor/bin/hw/android\.hardware\.vr@1\.0-service.crosshatch u:object_r:hal_vr_default_exec:s0 /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.fpc u:object_r:hal_fingerprint_default_exec:s0 /vendor/bin/hw/android.hardware.thermal@2.0-service.qti u:object_r:hal_thermal_default_exec:s0 +/vendor/bin/hw/vendor.qti.hardware.limits@1.0-service u:object_r:vendor_hal_limits_qti_exec:s0 /vendor/bin/thermal-engine u:object_r:vendor_thermal-engine_exec:s0 /vendor/bin/sensors.qcom u:object_r:vendor_sensors_exec:s0 /vendor/bin/sensors.qti u:object_r:vendor_sensors_exec:s0 diff --git a/generic/vendor/common/hwservice.te b/generic/vendor/common/hwservice.te index 9404f98d..744d4fc3 100644 --- a/generic/vendor/common/hwservice.te +++ b/generic/vendor/common/hwservice.te @@ -34,6 +34,7 @@ type vendor_hal_imsrtp_hwservice, hwservice_manager_type, protected_hwservice; type vendor_hal_imscallinfo_hwservice, hwservice_manager_type, protected_hwservice; type vendor_hal_ipacm_hwservice, hwservice_manager_type, protected_hwservice; type vendor_hal_hbtp_hwservice, hwservice_manager_type, protected_hwservice; +type vendor_hal_limits_hwservice, hwservice_manager_type, protected_hwservice; type vendor_hal_perf_hwservice, hwservice_manager_type, protected_hwservice; type vendor_hal_tui_comm_hwservice, hwservice_manager_type, protected_hwservice; type vendor_hal_qdutils_disp_hwservice, hwservice_manager_type, protected_hwservice; diff --git a/generic/vendor/common/hwservice_contexts b/generic/vendor/common/hwservice_contexts index 7d35ed9c..aa0da859 100644 --- a/generic/vendor/common/hwservice_contexts +++ b/generic/vendor/common/hwservice_contexts @@ -43,6 +43,7 @@ vendor.qti.hardware.capabilityconfigstore::ICapabilityConfigStore u:object_r vendor.qti.hardware.improvetouch.touchcompanion::ITouchCompanion u:object_r:vendor_hal_hbtp_hwservice:s0 vendor.qti.hardware.improvetouch.gesturemanager::IGestureManager u:object_r:vendor_hal_hbtp_hwservice:s0 vendor.qti.hardware.improvetouch.blobmanager::IBlobManager u:object_r:vendor_hal_hbtp_hwservice:s0 +vendor.qti.hardware.limits::ILimits u:object_r:vendor_hal_limits_hwservice:s0 vendor.qti.hardware.perf::IPerf u:object_r:vendor_hal_perf_hwservice:s0 vendor.qti.hardware.radio.atcmdfwd::IAtCmdFwd u:object_r:vendor_hal_atfwd_hwservice:s0 vendor.qti.hardware.radio.qcrilhook::IQtiOemHook u:object_r:hal_telephony_hwservice:s0 diff --git a/generic/vendor/common/vendor_hal_limits_qti.te b/generic/vendor/common/vendor_hal_limits_qti.te new file mode 100644 index 00000000..0b740520 --- /dev/null +++ b/generic/vendor/common/vendor_hal_limits_qti.te @@ -0,0 +1,42 @@ +# Copyright (c) 2020, The Linux Foundation. All rights reserved. + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +type vendor_hal_limits_qti, domain; +hal_server_domain(vendor_hal_limits_qti, vendor_hal_limits) + +# Allow hwbinder call from hal client to server and vice-versa +binder_call(vendor_hal_limits_client, vendor_hal_limits_server) +binder_call(vendor_hal_limits_server, vendor_hal_limits_client) + +# Allow hwservice related rules +hal_attribute_hwservice(vendor_hal_limits, vendor_hal_limits_hwservice) + +type vendor_hal_limits_qti_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(vendor_hal_limits_qti) + +# Allow access to thermal hal +hal_client_domain(vendor_hal_limits_qti, hal_thermal)