blob: d87b9a60817e4e90fedbaad8e76bc74327147821 [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute netd coredomain;
2
dcashmancc39f632016-07-22 13:13:11 -07003init_daemon_domain(netd)
4
5# Allow netd to spawn dnsmasq in it's own domain
6domain_auto_trans(netd, dnsmasq_exec, dnsmasq)
7
Maciej Żenczykowski44328c02019-05-08 18:50:27 -07008# Allow netd to start clatd in its own domain and kill it
dcashmancc39f632016-07-22 13:13:11 -07009domain_auto_trans(netd, clatd_exec, clatd)
Maciej Żenczykowski44328c02019-05-08 18:50:27 -070010allow netd clatd:process signal;
Chenbo Feng566411e2018-01-02 15:31:18 -080011
Hungming Chenffa08bb2021-11-26 18:26:23 +080012# Allow netd to setup packet socket and pass to clatd
13allow netd self:packet_socket { bind create setopt };
14
Chenbo Feng7b571042018-12-04 17:57:27 -080015# give netd permission to setup iptables rule with xt_bpf, attach program to cgroup, and read/write
16# the map created by bpfloader
17allow netd bpfloader:bpf { prog_run map_read map_write };
Joel Fernandesb76a6392019-01-11 08:32:45 -050018
Chenbo Feng8a5539b2019-02-27 17:44:26 -080019# in order to invoke side effect of close() on such a socket calling synchronize_rcu()
20# TODO: Remove this permission when 4.9 kernel is deprecated.
21allow netd self:key_socket create;
22
Inseob Kim55e5c9b2020-03-04 17:20:35 +090023set_prop(netd, ctl_mdnsd_prop)
24set_prop(netd, netd_stable_secret_prop)
25
steven_fannd3e8f6f2021-01-26 13:34:00 +080026get_prop(netd, adbd_config_prop)
Joel Fernandesb76a6392019-01-11 08:32:45 -050027get_prop(netd, bpf_progs_loaded_prop)
Inseob Kim55e5c9b2020-03-04 17:20:35 +090028get_prop(netd, hwservicemanager_prop)
29get_prop(netd, device_config_netd_native_prop)
lifr980c08c2018-11-21 22:53:48 +080030
31# Allow netd to write to statsd.
32unix_socket_send(netd, statsdw, statsd)
Remi NGUYEN VAN780fbad2019-01-28 13:08:42 +090033
34# Allow netd to send callbacks to network_stack
35binder_call(netd, network_stack)
36
Chalard Jeana4c9f7b2019-04-05 17:33:56 +090037# Allow netd to send dump info to dumpstate
38allow netd dumpstate:fd use;
39allow netd dumpstate:fifo_file { getattr write };
Inseob Kim55e5c9b2020-03-04 17:20:35 +090040
41# persist.netd.stable_secret contains RFC 7217 secret key which should never be
42# leaked to other processes. Make sure it never leaks.
43neverallow { domain -netd -init -dumpstate } netd_stable_secret_prop:file r_file_perms;
44
45# We want to ensure that no other process ever tries tampering with persist.netd.stable_secret,
46# the RFC 7217 secret key managed by netd. Doing so could compromise user privacy.
47neverallow { domain -netd -init } netd_stable_secret_prop:property_service set;