blob: 41473b73db7b1f1ff34c8aa15fa16fe9ef3c7203 [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
Chenbo Feng7b571042018-12-04 17:57:27 -080012# give netd permission to setup iptables rule with xt_bpf, attach program to cgroup, and read/write
13# the map created by bpfloader
14allow netd bpfloader:bpf { prog_run map_read map_write };
Joel Fernandesb76a6392019-01-11 08:32:45 -050015
Chenbo Feng8a5539b2019-02-27 17:44:26 -080016# in order to invoke side effect of close() on such a socket calling synchronize_rcu()
17# TODO: Remove this permission when 4.9 kernel is deprecated.
18allow netd self:key_socket create;
19
Joel Fernandesb76a6392019-01-11 08:32:45 -050020get_prop(netd, bpf_progs_loaded_prop)
lifr980c08c2018-11-21 22:53:48 +080021
22# Allow netd to write to statsd.
23unix_socket_send(netd, statsdw, statsd)
Remi NGUYEN VAN780fbad2019-01-28 13:08:42 +090024
25# Allow netd to send callbacks to network_stack
26binder_call(netd, network_stack)
27
Chalard Jeana4c9f7b2019-04-05 17:33:56 +090028# Allow netd to send dump info to dumpstate
29allow netd dumpstate:fd use;
30allow netd dumpstate:fifo_file { getattr write };