netdomain: move to public policy
Vendor domains may use net_domain() so it should be moved to public policy. This will allow removal of permissions such as rawip_socket in future releases without breaking Treble compatiblity. Bug: 122572608 Test: build Change-Id: Id84feb11587d305334cd9dbbc6e4f6f71ffff6f2
This commit is contained in:
parent
ef6f1b52ad
commit
937f256b2d
2 changed files with 27 additions and 26 deletions
|
@ -1,25 +0,0 @@
|
|||
###
|
||||
### Domain with network access
|
||||
###
|
||||
|
||||
# Use network sockets.
|
||||
allow netdomain self:tcp_socket create_stream_socket_perms;
|
||||
allow netdomain self:{ icmp_socket udp_socket rawip_socket } create_socket_perms;
|
||||
|
||||
# Connect to ports.
|
||||
allow netdomain port_type:tcp_socket name_connect;
|
||||
# Bind to ports.
|
||||
allow {netdomain -ephemeral_app} node_type:{ tcp_socket udp_socket } node_bind;
|
||||
allow {netdomain -ephemeral_app} port_type:udp_socket name_bind;
|
||||
allow {netdomain -ephemeral_app} port_type:tcp_socket name_bind;
|
||||
# See changes to the routing table.
|
||||
allow netdomain self:netlink_route_socket { create read getattr write setattr lock append bind connect getopt setopt shutdown nlmsg_read };
|
||||
|
||||
# Talks to netd via dnsproxyd socket.
|
||||
unix_socket_connect(netdomain, dnsproxyd, netd)
|
||||
|
||||
# Talks to netd via fwmarkd socket.
|
||||
unix_socket_connect(netdomain, fwmarkd, netd)
|
||||
|
||||
# Connect to mdnsd via mdnsd socket.
|
||||
unix_socket_connect(netdomain, mdnsd, mdnsd)
|
|
@ -1,4 +1,30 @@
|
|||
# Network types
|
||||
## Network types
|
||||
type node, node_type;
|
||||
type netif, netif_type;
|
||||
type port, port_type;
|
||||
|
||||
###
|
||||
### Domain with network access
|
||||
###
|
||||
|
||||
# Use network sockets.
|
||||
allow netdomain self:tcp_socket create_stream_socket_perms;
|
||||
allow netdomain self:{ icmp_socket udp_socket rawip_socket } create_socket_perms;
|
||||
|
||||
# Connect to ports.
|
||||
allow netdomain port_type:tcp_socket name_connect;
|
||||
# Bind to ports.
|
||||
allow {netdomain -ephemeral_app} node_type:{ tcp_socket udp_socket } node_bind;
|
||||
allow {netdomain -ephemeral_app} port_type:udp_socket name_bind;
|
||||
allow {netdomain -ephemeral_app} port_type:tcp_socket name_bind;
|
||||
# See changes to the routing table.
|
||||
allow netdomain self:netlink_route_socket { create read getattr write setattr lock append bind connect getopt setopt shutdown nlmsg_read };
|
||||
|
||||
# Talks to netd via dnsproxyd socket.
|
||||
unix_socket_connect(netdomain, dnsproxyd, netd)
|
||||
|
||||
# Talks to netd via fwmarkd socket.
|
||||
unix_socket_connect(netdomain, fwmarkd, netd)
|
||||
|
||||
# Connect to mdnsd via mdnsd socket.
|
||||
unix_socket_connect(netdomain, mdnsd, mdnsd)
|
||||
|
|
Loading…
Reference in a new issue