blob: ae6960828a7108bc3434d4f38b835e45b70a19b7 [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;
Ravi Kumar Siddojigari8d082302018-10-15 13:07:00 -070030type qvrd_exec, system_file_type, exec_type, file_type;
Ravi Kumar Siddojigari78d92d72018-06-04 16:26:49 +053031
jaihindye7a074e2017-08-08 13:59:00 +053032init_daemon_domain(qvrd)
33
34#
35# General
36#
37
Ashwani Jhac0d47552018-04-26 16:46:22 -070038binder_call(qvrd, system_server);
39
jaihindye7a074e2017-08-08 13:59:00 +053040# Allow interracting with qvrd directory
41allow qvrd qvrd_data_file:dir create_dir_perms;
42allow qvrd qvrd_data_file:file create_file_perms;
43
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070044#Allow hardware binder use
45hwbinder_use(qvrd)
46get_prop(qvrd, hwservicemanager_prop)
47
jaihindye7a074e2017-08-08 13:59:00 +053048# Allow access to our socket
49allow qvrd qvrd_socket:sock_file rw_file_perms;
50
jaihindye7a074e2017-08-08 13:59:00 +053051
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070052# Allow access to sensor1 API
53allow qvrd self:socket create_socket_perms_no_ioctl;
54
jaihindye7a074e2017-08-08 13:59:00 +053055#
56# Display
57#
58
jaihindye7a074e2017-08-08 13:59:00 +053059# Allow access to /dev/graphics/fb0 for configuring vsync interrupts
60allow qvrd graphics_device:dir r_dir_perms;
61allow qvrd graphics_device:chr_file rw_file_perms;
62
63#
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070064# Graphics
65#
66
67#Allow hal graphics mapper permissions
68hal_client_domain(qvrd, hal_graphics_composer);
69
70#Allow hal graphics allocator permissions
71hal_client_domain(qvrd, hal_graphics_allocator);
72
73#
jaihindye7a074e2017-08-08 13:59:00 +053074# Scheduler
75#
76
77allow qvrd self:capability { sys_nice };
78userdebug_or_eng(`
79 allow qvrd su:process setsched;
80')
81allow qvrd appdomain:process setsched;
82
Kiran Rudramuni2dbf7d32017-08-05 02:16:56 -070083# whitelisting ioctlcmd c302
84allowxperm qvrd self:socket ioctl msm_sock_ipc_ioctls_system;
85allow qvrd self:socket ioctl;