blob: 02027919e1a355a5c16f39ae45a57134c54dfa58 [file] [log] [blame]
Amit Blayb143fa12015-10-02 11:34:27 +03001# Copyright (c) 2015, The Linux Foundation. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met:
6# * Redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer.
8# * Redistributions in binary form must reproduce the above
9# copyright notice, this list of conditions and the following
10# disclaimer in the documentation and/or other materials provided
11# with the distribution.
12# * Neither the name of The Linux Foundation nor the names of its
13# contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
Biswajit Paul6786a922017-03-16 11:53:53 -070028type mdtpdaemon, domain;
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053029type mdtpdaemon_exec, exec_type, vendor_file_type, file_type;
Amit Blayb143fa12015-10-02 11:34:27 +030030
Amit Blay84d31242016-01-14 17:07:10 +020031allow mdtpdaemon self:capability {
32 setuid
33 setgid
34};
35
36userdebug_or_eng(`
37 #Needed for kill(pid, 0) existance test
38 allow mdtpdaemon su:process signull;
39 allow mdtpdaemon self:capability kill;
Biswajit Paul277acbb2016-07-20 12:02:14 -070040 diag_use(mdtpdaemon)
Amit Blay84d31242016-01-14 17:07:10 +020041')
42
Amit Blayb143fa12015-10-02 11:34:27 +030043#Allow for transition from init domain to mdtpdaemon
44init_daemon_domain(mdtpdaemon)
45
46#Allow mdtpdaemon to use Binder IPC
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053047#binder_use(mdtpdaemon)
Amit Blayb143fa12015-10-02 11:34:27 +030048
49#Mark mdtpdaemon as a Binder service domain
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053050#binder_service(mdtpdaemon)
Amit Blayb143fa12015-10-02 11:34:27 +030051
52#Allow mdtpdaemon to be registered with service manager
Ravi Kumar Siddojigaric7def122017-06-13 00:49:19 +053053#allow mdtpdaemon mdtpdaemon_service:service_manager { add find };
Amit Blayb143fa12015-10-02 11:34:27 +030054
55#Allow apps to interact with mdtpdaemon
56binder_call(mdtpdaemon, platform_app)
57
58#Allow access to firmware
59r_dir_file(mdtpdaemon, firmware_file)
60
61#Allow access to qsee directories
62allow mdtpdaemon data_qsee_file:dir create_dir_perms;
Amit Blay84d31242016-01-14 17:07:10 +020063allow mdtpdaemon data_qsee_file:file create_file_perms;
Amit Blayb143fa12015-10-02 11:34:27 +030064
65#Allow access to qsee fifos
66allow mdtpdaemon data_qsee_file:fifo_file create_file_perms;
67
68#Allow access to tee device
69allow mdtpdaemon tee_device:chr_file rw_file_perms;
Amit Blay84d31242016-01-14 17:07:10 +020070
71# Provide access to block devices
72allow mdtpdaemon block_device:dir r_dir_perms;
73allow mdtpdaemon mdtp_device:blk_file rw_file_perms;
Amit Blay84d31242016-01-14 17:07:10 +020074allow mdtpdaemon system_block_device:blk_file r_file_perms;
75
76# Provide access to QTI Crypto driver for MDTP
77# allow mdtpdaemon qce_device:chr_file rw_file_perms;
78
79# Provide read access to all /system files for MDTP file-to-block-mapping
80r_dir_file(mdtpdaemon, exec_type)
81r_dir_file(mdtpdaemon, system_file)
82
83# Provide mdtpd ability to access QMUXD/IPCRouter for QMI
84qmux_socket(mdtpdaemon);
Biswajit Paulcc0e05e2017-03-08 16:20:35 -080085allow mdtpdaemon self:socket create_socket_perms;
86allowxperm mdtpdaemon self:socket ioctl msm_sock_ipc_ioctls;
Amit Blay84d31242016-01-14 17:07:10 +020087
88# Provide tee ability to run executables in rootfs for MDTP
89allow mdtpdaemon rootfs:file x_file_perms;
Biswajit Paulf63bd142017-03-16 16:41:02 -070090allow mdtpdaemon ion_device:chr_file r_file_perms;
91allow mdtpdaemon sysfs:file r_file_perms;
Sunmeet Gill575d2492017-05-22 19:03:52 -070092allow mdtpdaemon sysfs_data:file r_file_perms;