Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [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 | |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 28 | |
| 29 | typeattribute dpmd coredomain; |
Devi Sandeep Endluri V V | 40fc49f | 2017-07-08 01:26:41 +0530 | [diff] [blame] | 30 | typeattribute dpmd mlstrustedsubject; |
| 31 | type dpmd_exec, exec_type, file_type; |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 32 | |
Devi Sandeep Endluri V V | 40fc49f | 2017-07-08 01:26:41 +0530 | [diff] [blame] | 33 | init_daemon_domain(dpmd) |
| 34 | |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 35 | net_domain(dpmd) |
| 36 | |
| 37 | allow dpmd { |
| 38 | dpmd_exec |
| 39 | system_file |
| 40 | }:file x_file_perms; |
| 41 | |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 42 | allow dpmd dpmd_data_file:file create_file_perms; |
| 43 | allow dpmd dpmd_data_file:dir create_dir_perms; |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 44 | r_dir_file(dpmd,proc_net) |
| 45 | |
| 46 | allow dpmd self:capability { |
| 47 | setuid |
Devi Sandeep Endluri V V | 40fc49f | 2017-07-08 01:26:41 +0530 | [diff] [blame] | 48 | net_raw |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 49 | net_admin |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 50 | }; |
Devi Sandeep Endluri V V | 7e4544a | 2017-08-31 12:36:59 +0530 | [diff] [blame] | 51 | |
| 52 | allow dpmd self:capability2 wake_alarm; |
| 53 | |
| 54 | r_dir_file(dpmd, appdomain) |
| 55 | |
Devi Sandeep Endluri V V | 40fc49f | 2017-07-08 01:26:41 +0530 | [diff] [blame] | 56 | wakelock_use(dpmd) |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 57 | allow dpmd shell_exec:file rx_file_perms; |
Devi Sandeep Endluri V V | 40fc49f | 2017-07-08 01:26:41 +0530 | [diff] [blame] | 58 | dontaudit dpmd self:capability sys_module; |
Ashwanth Goli | c4bb6c8 | 2017-07-27 18:55:16 +0530 | [diff] [blame] | 59 | set_prop(dpmd, persist_dpm_prop) |
| 60 | get_prop(dpmd, persist_dpm_prop) |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 61 | #allow dpmd to create socket |
| 62 | allow dpmd self:socket create_socket_perms_no_ioctl; |
| 63 | allow dpmd self:{ netlink_socket netlink_generic_socket } create_socket_perms_no_ioctl; |
Ashwanth Goli | 2e22f87 | 2017-08-02 18:26:20 +0530 | [diff] [blame] | 64 | dpmd_socket_perm(priv_app) |
| 65 | dpmd_socket_perm(system_server) |
| 66 | dpmd_socket_perm(system_app) |
| 67 | dpmd_socket_perm(untrusted_app) |
| 68 | dpmd_socket_perm(untrusted_app_25) |
| 69 | dpmd_socket_perm(platform_app) |
Devi Sandeep Endluri V V | 98379eb | 2017-06-20 22:19:40 -0700 | [diff] [blame] | 70 | #allow dpmd to write to /proc/net/sys |
| 71 | allow dpmd proc_net:file write; |