Stephen Smalley | 2dd4e51 | 2012-01-04 12:33:27 -0500 | [diff] [blame] | 1 | # network manager |
| 2 | type netd, domain; |
| 3 | type netd_exec, exec_type, file_type; |
| 4 | |
| 5 | init_daemon_domain(netd) |
Nick Kralevich | dbd28d9 | 2013-06-27 15:11:02 -0700 | [diff] [blame] | 6 | typeattribute netd mlstrustedsubject; |
| 7 | allow netd self:capability { net_admin net_raw kill }; |
| 8 | allow netd self:netlink_kobject_uevent_socket *; |
| 9 | allow netd self:netlink_route_socket *; |
| 10 | allow netd self:netlink_nflog_socket *; |
| 11 | allow netd self:rawip_socket *; |
| 12 | allow netd self:udp_socket *; |
| 13 | allow netd node:udp_socket node_bind; |
| 14 | allow netd port:udp_socket name_bind; |
| 15 | allow netd self:unix_stream_socket *; |
| 16 | allow netd shell_exec:file rx_file_perms; |
| 17 | allow netd system_file:file x_file_perms; |
| 18 | allow 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. |
| 22 | allow netd proc:file write; |
| 23 | |
| 24 | # For /sys/modules/bcmdhd/parameters/firmware_path |
| 25 | # XXX Split into its own type. |
| 26 | allow netd sysfs:file write; |
| 27 | |
| 28 | # Set dhcp lease for PAN connection |
| 29 | unix_socket_connect(netd, property, init) |
| 30 | allow netd system_prop:property_service set; |
| 31 | |
| 32 | # Connect to PAN |
Stephen Smalley | 9de4c69 | 2013-04-04 11:31:00 -0400 | [diff] [blame] | 33 | domain_auto_trans(netd, dhcp_exec, dhcp) |
Nick Kralevich | dbd28d9 | 2013-06-27 15:11:02 -0700 | [diff] [blame] | 34 | allow 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 |
| 39 | allow netd self:capability { dac_override chown fowner }; |
| 40 | allow netd wifi_data_file:file create_file_perms; |
| 41 | allow netd wifi_data_file:dir rw_dir_perms; |
| 42 | |
| 43 | # Allow netd to spawn hostapd in it's own domain |
| 44 | domain_auto_trans(netd, hostapd_exec, hostapd) |
| 45 | allow netd hostapd:process signal; |
| 46 | |
| 47 | # Allow netd to spawn dnsmasq in it's own domain |
| 48 | domain_auto_trans(netd, dnsmasq_exec, dnsmasq) |
| 49 | allow netd dnsmasq:process signal; |
| 50 | |
Nick Kralevich | 4a13f78 | 2013-07-10 14:58:27 -0700 | [diff] [blame^] | 51 | # Support netd running mdnsd |
| 52 | # TODO: prune this back further |
| 53 | allow netd ctl_default_prop:property_service set; |
| 54 | allow netd device:sock_file write; |