jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 1 | # 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 Rudramuni | 2dbf7d3 | 2017-08-05 02:16:56 -0700 | [diff] [blame] | 28 | typeattribute qvrd coredomain; |
| 29 | typeattribute qvrd mlstrustedsubject; |
| 30 | type qvrd_exec, exec_type, file_type; |
jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 31 | init_daemon_domain(qvrd) |
| 32 | |
| 33 | # |
| 34 | # General |
| 35 | # |
| 36 | |
| 37 | # Allow interracting with qvrd directory |
| 38 | allow qvrd qvrd_data_file:dir create_dir_perms; |
| 39 | allow qvrd qvrd_data_file:file create_file_perms; |
| 40 | |
Kiran Rudramuni | 2dbf7d3 | 2017-08-05 02:16:56 -0700 | [diff] [blame] | 41 | #Allow hardware binder use |
| 42 | hwbinder_use(qvrd) |
| 43 | get_prop(qvrd, hwservicemanager_prop) |
| 44 | |
jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 45 | # Allow access to our socket |
| 46 | allow qvrd qvrd_socket:sock_file rw_file_perms; |
| 47 | |
| 48 | # |
| 49 | # Sensors |
| 50 | # |
| 51 | |
jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 52 | # Allow access to adsprpcd |
jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 53 | allow qvrd system_file:dir read; |
| 54 | |
Kiran Rudramuni | 2dbf7d3 | 2017-08-05 02:16:56 -0700 | [diff] [blame] | 55 | # Allow access to sensor1 API |
| 56 | allow qvrd self:socket create_socket_perms_no_ioctl; |
| 57 | |
jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 58 | # |
| 59 | # Display |
| 60 | # |
| 61 | |
jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 62 | # Allow access to /dev/graphics/fb0 for configuring vsync interrupts |
| 63 | allow qvrd graphics_device:dir r_dir_perms; |
| 64 | allow qvrd graphics_device:chr_file rw_file_perms; |
| 65 | |
| 66 | # |
Kiran Rudramuni | 2dbf7d3 | 2017-08-05 02:16:56 -0700 | [diff] [blame] | 67 | # Graphics |
| 68 | # |
| 69 | |
| 70 | #Allow hal graphics mapper permissions |
| 71 | hal_client_domain(qvrd, hal_graphics_composer); |
| 72 | |
| 73 | #Allow hal graphics allocator permissions |
| 74 | hal_client_domain(qvrd, hal_graphics_allocator); |
| 75 | |
| 76 | # |
jaihindy | e7a074e | 2017-08-08 13:59:00 +0530 | [diff] [blame] | 77 | # Scheduler |
| 78 | # |
| 79 | |
| 80 | allow qvrd self:capability { sys_nice }; |
| 81 | userdebug_or_eng(` |
| 82 | allow qvrd su:process setsched; |
| 83 | ') |
| 84 | allow qvrd appdomain:process setsched; |
| 85 | |
Kiran Rudramuni | 2dbf7d3 | 2017-08-05 02:16:56 -0700 | [diff] [blame] | 86 | # whitelisting ioctlcmd c302 |
| 87 | allowxperm qvrd self:socket ioctl msm_sock_ipc_ioctls_system; |
| 88 | allow qvrd self:socket ioctl; |