blob: 4bf46f8554484bd5fbeb72ec9b3611f685ca27cf [file] [log] [blame]
jaihindye7a074e2017-08-08 13:59:00 +05301# Copyright (c) 2017, 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
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070028typeattribute qvrd coredomain;
29typeattribute qvrd mlstrustedsubject;
30type qvrd_exec, exec_type, file_type;
jaihindye7a074e2017-08-08 13:59:00 +053031init_daemon_domain(qvrd)
32
33#
34# General
35#
36
37# Allow interracting with qvrd directory
38allow qvrd qvrd_data_file:dir create_dir_perms;
39allow qvrd qvrd_data_file:file create_file_perms;
40
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070041#Allow hardware binder use
42hwbinder_use(qvrd)
43get_prop(qvrd, hwservicemanager_prop)
44
jaihindye7a074e2017-08-08 13:59:00 +053045# Allow access to our socket
46allow qvrd qvrd_socket:sock_file rw_file_perms;
47
48#
49# Sensors
50#
51
jaihindye7a074e2017-08-08 13:59:00 +053052# Allow access to adsprpcd
jaihindye7a074e2017-08-08 13:59:00 +053053allow qvrd system_file:dir read;
54
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070055# Allow access to sensor1 API
56allow qvrd self:socket create_socket_perms_no_ioctl;
57
jaihindye7a074e2017-08-08 13:59:00 +053058#
59# Display
60#
61
jaihindye7a074e2017-08-08 13:59:00 +053062# Allow access to /dev/graphics/fb0 for configuring vsync interrupts
63allow qvrd graphics_device:dir r_dir_perms;
64allow qvrd graphics_device:chr_file rw_file_perms;
65
66#
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070067# Graphics
68#
69
70#Allow hal graphics mapper permissions
71hal_client_domain(qvrd, hal_graphics_composer);
72
73#Allow hal graphics allocator permissions
74hal_client_domain(qvrd, hal_graphics_allocator);
75
76#
jaihindye7a074e2017-08-08 13:59:00 +053077# Scheduler
78#
79
80allow qvrd self:capability { sys_nice };
81userdebug_or_eng(`
82 allow qvrd su:process setsched;
83')
84allow qvrd appdomain:process setsched;
85
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070086# whitelisting ioctlcmd c302
87allowxperm qvrd self:socket ioctl msm_sock_ipc_ioctls_system;
88allow qvrd self:socket ioctl;