2017-03-23 22:27:32 +01:00
|
|
|
typeattribute netd coredomain;
|
2022-02-10 01:32:44 +01:00
|
|
|
typeattribute netd bpfdomain;
|
2017-03-23 22:27:32 +01:00
|
|
|
|
2016-07-22 22:13:11 +02:00
|
|
|
init_daemon_domain(netd)
|
|
|
|
|
|
|
|
# Allow netd to spawn dnsmasq in it's own domain
|
|
|
|
domain_auto_trans(netd, dnsmasq_exec, dnsmasq)
|
|
|
|
|
2019-05-09 03:50:27 +02:00
|
|
|
# Allow netd to start clatd in its own domain and kill it
|
2016-07-22 22:13:11 +02:00
|
|
|
domain_auto_trans(netd, clatd_exec, clatd)
|
2019-05-09 03:50:27 +02:00
|
|
|
allow netd clatd:process signal;
|
2018-01-03 00:31:18 +01:00
|
|
|
|
2021-11-26 11:26:23 +01:00
|
|
|
# Allow netd to setup packet socket and pass to clatd
|
|
|
|
allow netd self:packet_socket { bind create setopt };
|
|
|
|
|
2018-12-05 02:57:27 +01:00
|
|
|
# give netd permission to setup iptables rule with xt_bpf, attach program to cgroup, and read/write
|
|
|
|
# the map created by bpfloader
|
|
|
|
allow netd bpfloader:bpf { prog_run map_read map_write };
|
2019-01-11 14:32:45 +01:00
|
|
|
|
2019-02-28 02:44:26 +01:00
|
|
|
# in order to invoke side effect of close() on such a socket calling synchronize_rcu()
|
|
|
|
# TODO: Remove this permission when 4.9 kernel is deprecated.
|
2022-01-28 08:04:09 +01:00
|
|
|
# TODO: Remove this after we remove all bpf interactions from netd.
|
2019-02-28 02:44:26 +01:00
|
|
|
allow netd self:key_socket create;
|
|
|
|
|
2020-03-04 09:20:35 +01:00
|
|
|
set_prop(netd, ctl_mdnsd_prop)
|
|
|
|
set_prop(netd, netd_stable_secret_prop)
|
|
|
|
|
2021-01-26 06:34:00 +01:00
|
|
|
get_prop(netd, adbd_config_prop)
|
2019-01-11 14:32:45 +01:00
|
|
|
get_prop(netd, bpf_progs_loaded_prop)
|
2020-03-04 09:20:35 +01:00
|
|
|
get_prop(netd, hwservicemanager_prop)
|
|
|
|
get_prop(netd, device_config_netd_native_prop)
|
2018-11-21 15:53:48 +01:00
|
|
|
|
|
|
|
# Allow netd to write to statsd.
|
|
|
|
unix_socket_send(netd, statsdw, statsd)
|
2019-01-28 05:08:42 +01:00
|
|
|
|
|
|
|
# Allow netd to send callbacks to network_stack
|
|
|
|
binder_call(netd, network_stack)
|
|
|
|
|
2019-04-05 10:33:56 +02:00
|
|
|
# Allow netd to send dump info to dumpstate
|
|
|
|
allow netd dumpstate:fd use;
|
|
|
|
allow netd dumpstate:fifo_file { getattr write };
|
2020-03-04 09:20:35 +01:00
|
|
|
|
|
|
|
# persist.netd.stable_secret contains RFC 7217 secret key which should never be
|
|
|
|
# leaked to other processes. Make sure it never leaks.
|
|
|
|
neverallow { domain -netd -init -dumpstate } netd_stable_secret_prop:file r_file_perms;
|
|
|
|
|
|
|
|
# We want to ensure that no other process ever tries tampering with persist.netd.stable_secret,
|
|
|
|
# the RFC 7217 secret key managed by netd. Doing so could compromise user privacy.
|
|
|
|
neverallow { domain -netd -init } netd_stable_secret_prop:property_service set;
|