blob: 9603ce3ea6b8a8118e705cce1faa61a6a4e4209b [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)
Nick Kralevichdbd28d92013-06-27 15:11:02 -07006typeattribute netd mlstrustedsubject;
7allow netd self:capability { net_admin net_raw kill };
8allow netd self:netlink_kobject_uevent_socket *;
9allow netd self:netlink_route_socket *;
10allow netd self:netlink_nflog_socket *;
11allow netd self:rawip_socket *;
12allow netd self:udp_socket *;
13allow netd node:udp_socket node_bind;
14allow netd port:udp_socket name_bind;
15allow netd self:unix_stream_socket *;
16allow netd shell_exec:file rx_file_perms;
17allow netd system_file:file x_file_perms;
18allow netd devpts:chr_file rw_file_perms;
19
20# For /proc/sys/net/ipv[46]/route/flush.
21# XXX Split /proc/sys/net into its own type.
22allow netd proc:file write;
23
24# For /sys/modules/bcmdhd/parameters/firmware_path
25# XXX Split into its own type.
26allow netd sysfs:file write;
27
28# Set dhcp lease for PAN connection
29unix_socket_connect(netd, property, init)
30allow netd system_prop:property_service set;
31
32# Connect to PAN
Stephen Smalley9de4c692013-04-04 11:31:00 -040033domain_auto_trans(netd, dhcp_exec, dhcp)
Nick Kralevichdbd28d92013-06-27 15:11:02 -070034allow netd dhcp:process signal;
35
36# Needed to update /data/misc/wifi/hostapd.conf
37# TODO: See what we can do to reduce the need for
38# these capabilities
39allow netd self:capability { dac_override chown fowner };
40allow netd wifi_data_file:file create_file_perms;
41allow netd wifi_data_file:dir rw_dir_perms;
42
43# Allow netd to spawn hostapd in it's own domain
44domain_auto_trans(netd, hostapd_exec, hostapd)
45allow netd hostapd:process signal;
46
47# Allow netd to spawn dnsmasq in it's own domain
48domain_auto_trans(netd, dnsmasq_exec, dnsmasq)
49allow netd dnsmasq:process signal;
50
Nick Kralevich4a13f782013-07-10 14:58:27 -070051# Support netd running mdnsd
52# TODO: prune this back further
53allow netd ctl_default_prop:property_service set;
54allow netd device:sock_file write;