Jaihind Yadav | c650338 | 2019-01-25 15:44:50 +0530 | [diff] [blame] | 1 | # Copyright (c) 2019, The Linux Foundation. All rights reserved. |
Sridhar Parasuram | c997f65 | 2018-01-25 10:31:03 -0800 | [diff] [blame] | 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 | |
Jaihind Yadav | c650338 | 2019-01-25 15:44:50 +0530 | [diff] [blame] | 28 | type qti, domain; |
| 29 | type qti_exec, exec_type, vendor_file_type, file_type; |
| 30 | init_daemon_domain(qti) |
| 31 | net_domain(qti) |
Sridhar Parasuram | c997f65 | 2018-01-25 10:31:03 -0800 | [diff] [blame] | 32 | |
Jaihind Yadav | c650338 | 2019-01-25 15:44:50 +0530 | [diff] [blame] | 33 | allow qti { |
| 34 | rmnet_device |
| 35 | smem_log_device |
| 36 | mhi_device |
| 37 | smd_device |
| 38 | userdebug_or_eng(`kmsg_device') |
| 39 | }:chr_file rw_file_perms; |
Sridhar Parasuram | c997f65 | 2018-01-25 10:31:03 -0800 | [diff] [blame] | 40 | |
Jaihind Yadav | c650338 | 2019-01-25 15:44:50 +0530 | [diff] [blame] | 41 | qmux_socket(qti) |
Sridhar Parasuram | c997f65 | 2018-01-25 10:31:03 -0800 | [diff] [blame] | 42 | |
Jaihind Yadav | c650338 | 2019-01-25 15:44:50 +0530 | [diff] [blame] | 43 | allow qti self:{ |
| 44 | netlink_socket |
| 45 | socket |
| 46 | udp_socket |
| 47 | qipcrtr_socket |
| 48 | } create_socket_perms_no_ioctl; |
| 49 | |
| 50 | allow qti self:socket ioctl; |
| 51 | allowxperm qti self:{ socket qipcrtr_socket } ioctl msm_sock_ipc_ioctls; |
| 52 | allow qti vendor_shell_exec:file rx_file_perms; |
| 53 | |
| 54 | allow qti sysfs_data:file r_file_perms; |
| 55 | |
| 56 | # Allow write permissions for log file |
| 57 | allow qti vendor_qti_data_file:file create_file_perms; |
| 58 | allow qti vendor_qti_data_file:dir rw_dir_perms; |
| 59 | |
| 60 | #diag |
| 61 | userdebug_or_eng(` |
| 62 | diag_use(qti) |
| 63 | ') |
Aman Gupta | cacf28c | 2019-03-08 13:22:45 +0530 | [diff] [blame] | 64 | |
| 65 | #Allow qti to create qti socket |
| 66 | allow qti dataqti_socket:sock_file rw_file_perms; |