blob: 0cd087246a80138405a9c047a2bba3983d11d08f [file] [log] [blame]
Stephen Smalley2dd4e512012-01-04 12:33:27 -05001# network manager
2type netd, domain;
3type netd_exec, exec_type, file_type;
4
5init_daemon_domain(netd)
Geremy Condra3bb1ccc2013-09-16 14:53:41 -07006allow netd self:capability { net_admin net_raw kill fsetid };
Nick Kralevichdbd28d92013-06-27 15:11:02 -07007allow netd self:netlink_kobject_uevent_socket *;
8allow netd self:netlink_route_socket *;
9allow netd self:netlink_nflog_socket *;
10allow netd self:rawip_socket *;
11allow netd self:udp_socket *;
12allow netd node:udp_socket node_bind;
13allow netd port:udp_socket name_bind;
14allow netd self:unix_stream_socket *;
15allow netd shell_exec:file rx_file_perms;
16allow netd system_file:file x_file_perms;
17allow netd devpts:chr_file rw_file_perms;
18
19# For /proc/sys/net/ipv[46]/route/flush.
20# XXX Split /proc/sys/net into its own type.
21allow netd proc:file write;
22
23# For /sys/modules/bcmdhd/parameters/firmware_path
24# XXX Split into its own type.
25allow netd sysfs:file write;
26
27# Set dhcp lease for PAN connection
28unix_socket_connect(netd, property, init)
29allow netd system_prop:property_service set;
30
31# Connect to PAN
Stephen Smalley9de4c692013-04-04 11:31:00 -040032domain_auto_trans(netd, dhcp_exec, dhcp)
Nick Kralevichdbd28d92013-06-27 15:11:02 -070033allow netd dhcp:process signal;
34
35# Needed to update /data/misc/wifi/hostapd.conf
36# TODO: See what we can do to reduce the need for
37# these capabilities
38allow netd self:capability { dac_override chown fowner };
39allow netd wifi_data_file:file create_file_perms;
40allow netd wifi_data_file:dir rw_dir_perms;
41
42# Allow netd to spawn hostapd in it's own domain
43domain_auto_trans(netd, hostapd_exec, hostapd)
44allow netd hostapd:process signal;
45
46# Allow netd to spawn dnsmasq in it's own domain
47domain_auto_trans(netd, dnsmasq_exec, dnsmasq)
48allow netd dnsmasq:process signal;
49
Lorenzo Colittiab7dfab2013-08-05 15:32:56 +090050# Allow netd to start clatd in its own domain
51domain_auto_trans(netd, clatd_exec, clatd)
52allow netd clatd:process signal;
53
Nick Kralevich4a13f782013-07-10 14:58:27 -070054# Support netd running mdnsd
55# TODO: prune this back further
56allow netd ctl_default_prop:property_service set;
57allow netd device:sock_file write;
Nick Kralevich9a198852013-07-12 21:28:41 -070058
59###
60### Neverallow rules
61###
62### netd should NEVER do any of this
63
64# Block device access.
65neverallow netd dev_type:blk_file { read write };
66
67# Kernel memory access.
68neverallow netd kmem_device:chr_file { read write };
69
70# Setting SELinux enforcing status or booleans.
71# Conditionally allowed to system_app for SEAndroidManager.
72neverallow netd kernel:security { setenforce setbool };
73
74# Load security policy.
75neverallow netd kernel:security load_policy;
76
77# ptrace any other app
78neverallow netd { domain }:process ptrace;
79
80# Write to /system.
81neverallow netd system_file:dir_file_class_set write;
82
83# Write to files in /data/data or system files on /data
84neverallow netd { app_data_file system_data_file }:dir_file_class_set write;