blob: d3c07fc43f090aa68fe4c264f07300afd6f46a9e [file] [log] [blame]
# Copyright (c) 2018, 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.
# vendor_spdaemon service
type vendor_spdaemon, domain;
type vendor_spdaemon_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(vendor_spdaemon)
# Allow access to spss_utils device
allow vendor_spdaemon vendor_spss_utils_device:chr_file rw_file_perms;
allow vendor_spdaemon vendor_spcom_device:chr_file { getattr rw_file_perms };
allow vendor_spdaemon vendor_skp_device:chr_file { getattr rw_file_perms };
# Allow access to spss_utils device
allow vendor_spdaemon vendor_spss_utils_device:chr_file rw_file_perms;
allow vendor_spdaemon mnt_vendor_file:dir search;
# Need to check if really needed
set_prop(vendor_spdaemon, vendor_spcomlib_prop)
allow vendor_spdaemon vendor_spdaemon_ssr_device:chr_file rw_file_perms;
allow vendor_spdaemon vendor_sp_ssr_device:chr_file rw_file_perms;
allow vendor_spdaemon vendor_sp_nvm_device:chr_file rw_file_perms;
allow vendor_spdaemon vendor_sp_keymaster_device:chr_file rw_file_perms;
allow vendor_spdaemon vendor_cryptoapp_device:chr_file rw_file_perms;
allow vendor_spdaemon vendor_iuicc_device:chr_file rw_file_perms;
allow vendor_spdaemon ion_device:chr_file rw_file_perms;
r_dir_file(vendor_spdaemon, firmware_file);
use_vendor_per_mgr(vendor_spdaemon)
hal_client_domain(vendor_spdaemon, hal_telephony)
# Allow to access IAR-DB at /mnt/vendor/persist/iar_db
allow vendor_spdaemon vendor_persist_iar_db_file:dir rw_dir_perms;
allow vendor_spdaemon vendor_persist_iar_db_file:file create_file_perms;
# Allow to access IAR-DB at /mnt/vendor/spunvm
allow vendor_spdaemon vendor_spunvm_file:dir rw_dir_perms;
allow vendor_spdaemon vendor_spunvm_file:file create_file_perms;
allow vendor_spdaemon vendor_sysfs_data:file r_file_perms;
allow vendor_spdaemon vendor_sysfs_spdaemon:file r_file_perms;
r_dir_file(vendor_spdaemon, vendor_sysfs_spss);
# Allow to allocate HLOS<=>SP share buffers for loading SP apps (r_file_perms includes ioctl)
allow vendor_spdaemon vendor_dmabuf_sp_hlos_heap_device:chr_file r_file_perms;
allow vendor_spdaemon vendor_dmabuf_system_heap_device:chr_file r_file_perms;
# Allow hyp_assign() for HLOS<=>SP share buffers (r_file_perms includes ioctl)
allow vendor_spdaemon vendor_vm_hlos_device:chr_file r_file_perms;
allow vendor_spdaemon vendor_vm_cp_spss_sp_device:chr_file r_file_perms;
allow vendor_spdaemon vendor_vm_cp_spss_sp_shared_device:chr_file r_file_perms;
allow vendor_spdaemon vendor_vm_cp_spss_hlos_shared_device:chr_file r_file_perms;
allow vendor_spdaemon vendor_membuf_dev:chr_file r_file_perms;
# Access to wakelock sysfs
wakelock_use(vendor_spdaemon)