blob: c7fe62c25c724064550f36b5f188d823e72db808 [file] [log] [blame]
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -07001# 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 V98379eb2017-06-20 22:19:40 -070028
29typeattribute dpmd coredomain;
Devi Sandeep Endluri V V40fc49f2017-07-08 01:26:41 +053030typeattribute dpmd mlstrustedsubject;
Ravi Kumar Siddojigari8d082302018-10-15 13:07:00 -070031type dpmd_exec, system_file_type, exec_type, file_type;
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070032
Devi Sandeep Endluri V V40fc49f2017-07-08 01:26:41 +053033init_daemon_domain(dpmd)
34
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070035net_domain(dpmd)
36
37allow dpmd {
38 dpmd_exec
39 system_file
40}:file x_file_perms;
41
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070042allow dpmd dpmd_data_file:file create_file_perms;
43allow dpmd dpmd_data_file:dir create_dir_perms;
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070044r_dir_file(dpmd,proc_net)
45
46allow dpmd self:capability {
47 setuid
Devi Sandeep Endluri V V40fc49f2017-07-08 01:26:41 +053048 net_raw
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070049 net_admin
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070050};
Devi Sandeep Endluri V V8e574702017-08-31 12:36:59 +053051
52allow dpmd self:capability2 wake_alarm;
53
54r_dir_file(dpmd, appdomain)
55
Devi Sandeep Endluri V V40fc49f2017-07-08 01:26:41 +053056wakelock_use(dpmd)
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070057allow dpmd shell_exec:file rx_file_perms;
Devi Sandeep Endluri V V40fc49f2017-07-08 01:26:41 +053058dontaudit dpmd self:capability sys_module;
Ashwanth Golic4bb6c82017-07-27 18:55:16 +053059set_prop(dpmd, persist_dpm_prop)
60get_prop(dpmd, persist_dpm_prop)
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070061#allow dpmd to create socket
62allow dpmd self:socket create_socket_perms_no_ioctl;
63allow dpmd self:{ netlink_socket netlink_generic_socket } create_socket_perms_no_ioctl;
Ashwanth Goli2e22f872017-08-02 18:26:20 +053064dpmd_socket_perm(priv_app)
65dpmd_socket_perm(system_server)
66dpmd_socket_perm(system_app)
67dpmd_socket_perm(untrusted_app)
68dpmd_socket_perm(untrusted_app_25)
69dpmd_socket_perm(platform_app)
Devi Sandeep Endluri V V98379eb2017-06-20 22:19:40 -070070#allow dpmd to write to /proc/net/sys
71allow dpmd proc_net:file write;