| # Copyright (c) 2023, 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. |
| |
| ####################### |
| # Policy for vmmgr |
| type vendor_nativehaltestservice, domain; |
| type vendor_nativehaltestservice_exec, exec_type, vendor_file_type, file_type; |
| |
| |
| ####################### |
| # Main daemon flow |
| init_daemon_domain(vendor_nativehaltestservice); |
| |
| # ignore spurious denial |
| dontaudit vendor_nativehaltestservice graphics_device:dir search; |
| |
| # This is needed to get priority for Camera process |
| allow vendor_nativehaltestservice self:capability sys_nice; |
| |
| set_prop(vendor_nativehaltestservice, vendor_camera_prop) |
| |
| allow vendor_nativehaltestservice vendor_camera_data_file:dir create_dir_perms; |
| allow vendor_nativehaltestservice vendor_camera_data_file:file create_file_perms; |
| unix_socket_connect(vendor_nativehaltestservice, vendor_thermal, vendor_thermal-engine) |
| |
| userdebug_or_eng(` |
| allow vendor_nativehaltestservice vendor_diag_device:chr_file rw_file_perms; |
| ') |
| |
| # access hexagon |
| allow vendor_nativehaltestservice vendor_qdsp_device:chr_file r_file_perms; |
| |
| #Allow camera to access synx device |
| allow vendor_nativehaltestservice vendor_synx_device:chr_file rw_file_perms; |
| |
| #allow camera to access /dsp |
| r_dir_file(vendor_nativehaltestservice, adsprpcd_file); |
| #allow camera to access adsprpc_prop |
| get_prop(vendor_nativehaltestservice, vendor_adsprpc_prop) |
| |
| allow vendor_nativehaltestservice mnt_media_rw_file:dir { getattr open read }; |
| allow vendor_nativehaltestservice aac_drc_prop:file { getattr map open }; |
| allow vendor_nativehaltestservice ab_update_gki_prop:file { getattr map open }; |
| allow vendor_nativehaltestservice adbd_config_prop:file { getattr map open }; |
| allow vendor_nativehaltestservice apexd_config_prop:file open; |
| allow vendor_nativehaltestservice dmabuf_system_heap_device:chr_file { open read }; |
| allow vendor_nativehaltestservice hal_graphics_allocator_default:binder call; |
| allow vendor_nativehaltestservice hal_graphics_allocator_default:fd use; |
| allow vendor_nativehaltestservice hal_graphics_mapper_hwservice:hwservice_manager find; |
| allow vendor_nativehaltestservice hidl_base_hwservice:hwservice_manager add; |
| allow vendor_nativehaltestservice hwservicemanager:binder { call transfer }; |
| allow vendor_nativehaltestservice self:qipcrtr_socket { create getattr read write }; |
| allow vendor_nativehaltestservice servicemanager:binder call; |
| allow vendor_nativehaltestservice vendor_camera_data_file:file rw_file_perms; |
| allow vendor_nativehaltestservice vendor_camera_data_file:dir rw_dir_perms; |
| allow vendor_nativehaltestservice vendor_hal_perf_default:binder call; |
| allow vendor_nativehaltestservice vendor_hal_perf_hwservice:hwservice_manager find; |
| allow vendor_nativehaltestservice video_device:chr_file ioctl; |