From 93ce157da279b55474f5fcd362297dfa804b4911 Mon Sep 17 00:00:00 2001 From: Gaurav Kashyap Date: Thu, 10 Jun 2021 14:15:03 -0700 Subject: [PATCH] sepolicy_vndr: add policy for KeyMint 1.0 Add policy for KeyMint 1.0. Change-Id: I6dac22eee78beb80e6d940788649280c448a4d38 --- generic/vendor/common/file_contexts | 1 + generic/vendor/common/hal_keymint_qti.te | 41 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 generic/vendor/common/hal_keymint_qti.te diff --git a/generic/vendor/common/file_contexts b/generic/vendor/common/file_contexts index 0a061bd5..5f81dc50 100755 --- a/generic/vendor/common/file_contexts +++ b/generic/vendor/common/file_contexts @@ -211,6 +211,7 @@ /vendor/bin/hw/android\.hardware\.keymaster@3\.0-service-qti u:object_r:vendor_hal_keymaster_qti_exec:s0 /vendor/bin/hw/android\.hardware\.keymaster@4\.0-service-qti u:object_r:vendor_hal_keymaster_qti_exec:s0 /vendor/bin/hw/android\.hardware\.keymaster@4\.1-service-qti u:object_r:vendor_hal_keymaster_qti_exec:s0 +/vendor/bin/hw/android\.hardware\.security\.keymint-service-qti u:object_r:vendor_hal_keymint_qti_exec:s0 /vendor/bin/init\.qti\.keymaster\.sh u:object_r:vendor_init-qti-keymaster-sh_exec:s0 /vendor/bin/hw/android\.hardware\.gatekeeper@1\.0-service-qti u:object_r:vendor_hal_gatekeeper_qti_exec:s0 /(vendor|system/vendor)/bin/hw/android\.hardware\.gnss.*-service-qti u:object_r:vendor_hal_gnss_qti_exec:s0 diff --git a/generic/vendor/common/hal_keymint_qti.te b/generic/vendor/common/hal_keymint_qti.te new file mode 100644 index 00000000..c87bf348 --- /dev/null +++ b/generic/vendor/common/hal_keymint_qti.te @@ -0,0 +1,41 @@ +# Copyright (c) 2021, 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_keymint_qti, domain; +hal_server_domain(vendor_hal_keymint_qti, hal_keymint) + +type vendor_hal_keymint_qti_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(vendor_hal_keymint_qti) + +dontaudit vendor_hal_keymint_qti firmware_file:dir search; + +get_prop(vendor_hal_keymint_qti, vendor_tee_listener_prop) + +allow vendor_hal_keymint_qti tee_device:chr_file rw_file_perms; + +# As each dma buf is seperate device, need to allow access to those devices +allow vendor_hal_keymint_qti vendor_dmabuf_qseecom_heap_device:chr_file r_file_perms;