netd.te 1.71 KB
Newer Older
Stephen Smalley's avatar
Stephen Smalley committed
1 2 3 4 5
# network manager
type netd, domain;
type netd_exec, exec_type, file_type;

init_daemon_domain(netd)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
typeattribute netd mlstrustedsubject;
allow netd self:capability { net_admin net_raw kill };
allow netd self:netlink_kobject_uevent_socket *;
allow netd self:netlink_route_socket *;
allow netd self:netlink_nflog_socket *;
allow netd self:rawip_socket *;
allow netd self:udp_socket *;
allow netd node:udp_socket node_bind;
allow netd port:udp_socket name_bind;
allow netd self:unix_stream_socket *;
allow netd shell_exec:file rx_file_perms;
allow netd system_file:file x_file_perms;
allow netd devpts:chr_file rw_file_perms;

# For /proc/sys/net/ipv[46]/route/flush.
# XXX Split /proc/sys/net into its own type.
allow netd proc:file write;

# For /sys/modules/bcmdhd/parameters/firmware_path
# XXX Split into its own type.
allow netd sysfs:file write;

# Set dhcp lease for PAN connection
unix_socket_connect(netd, property, init)
allow netd system_prop:property_service set;

# Connect to PAN
33
domain_auto_trans(netd, dhcp_exec, dhcp)
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
allow netd dhcp:process signal;

# Needed to update /data/misc/wifi/hostapd.conf
# TODO: See what we can do to reduce the need for
# these capabilities
allow netd self:capability { dac_override chown fowner };
allow netd wifi_data_file:file create_file_perms;
allow netd wifi_data_file:dir rw_dir_perms;

# Allow netd to spawn hostapd in it's own domain
domain_auto_trans(netd, hostapd_exec, hostapd)
allow netd hostapd:process signal;

# Allow netd to spawn dnsmasq in it's own domain
domain_auto_trans(netd, dnsmasq_exec, dnsmasq)
allow netd dnsmasq:process signal;

Nick Kralevich's avatar
Nick Kralevich committed
51 52 53 54
# Support netd running mdnsd
# TODO: prune this back further
allow netd ctl_default_prop:property_service set;
allow netd device:sock_file write;