1# Networking service app
2typeattribute network_stack coredomain;
3
4app_domain(network_stack);
5net_domain(network_stack);
6
7allow network_stack self:global_capability_class_set {
8    net_admin
9    net_bind_service
10    net_broadcast
11    net_raw
12};
13
14# Allow access to net_admin ioctl, DHCP server uses SIOCSARP
15allowxperm network_stack self:udp_socket ioctl priv_sock_ioctls;
16
17# The DhcpClient uses packet_sockets
18allow network_stack self:packet_socket create_socket_perms_no_ioctl;
19
20# Monitor neighbors via netlink.
21allow network_stack self:netlink_route_socket nlmsg_write;
22
23allow network_stack app_api_service:service_manager find;
24allow network_stack dnsresolver_service:service_manager find;
25allow network_stack netd_service:service_manager find;
26allow network_stack radio_service:service_manager find;
27allow network_stack radio_data_file:dir create_dir_perms;
28allow network_stack radio_data_file:file create_file_perms;
29
30binder_call(network_stack, netd);
31
32# Create/use netlink_tcpdiag_socket to get tcp info
33allow network_stack self:netlink_tcpdiag_socket { create_socket_perms_no_ioctl nlmsg_read nlmsg_write };
34############### Tethering Service app - Tethering.apk ##############
35hal_client_domain(network_stack, hal_tetheroffload)
36# Create and share netlink_netfilter_sockets for tetheroffload.
37allow network_stack self:netlink_netfilter_socket create_socket_perms_no_ioctl;
38allow network_stack network_stack_service:service_manager find;
39