Alex Klyubin | f5446eb | 2017-03-23 14:27:32 -0700 | [diff] [blame] | 1 | typeattribute netd coredomain; |
| 2 | |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 3 | init_daemon_domain(netd) |
| 4 | |
| 5 | # Allow netd to spawn dnsmasq in it's own domain |
| 6 | domain_auto_trans(netd, dnsmasq_exec, dnsmasq) |
| 7 | |
Maciej Żenczykowski | 44328c0 | 2019-05-08 18:50:27 -0700 | [diff] [blame] | 8 | # Allow netd to start clatd in its own domain and kill it |
dcashman | cc39f63 | 2016-07-22 13:13:11 -0700 | [diff] [blame] | 9 | domain_auto_trans(netd, clatd_exec, clatd) |
Maciej Żenczykowski | 44328c0 | 2019-05-08 18:50:27 -0700 | [diff] [blame] | 10 | allow netd clatd:process signal; |
Chenbo Feng | 566411e | 2018-01-02 15:31:18 -0800 | [diff] [blame] | 11 | |
Chenbo Feng | 7b57104 | 2018-12-04 17:57:27 -0800 | [diff] [blame] | 12 | # give netd permission to setup iptables rule with xt_bpf, attach program to cgroup, and read/write |
| 13 | # the map created by bpfloader |
| 14 | allow netd bpfloader:bpf { prog_run map_read map_write }; |
Joel Fernandes | b76a639 | 2019-01-11 08:32:45 -0500 | [diff] [blame] | 15 | |
Chenbo Feng | 8a5539b | 2019-02-27 17:44:26 -0800 | [diff] [blame] | 16 | # 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. |
| 18 | allow netd self:key_socket create; |
| 19 | |
Inseob Kim | 55e5c9b | 2020-03-04 17:20:35 +0900 | [diff] [blame] | 20 | set_prop(netd, ctl_mdnsd_prop) |
| 21 | set_prop(netd, netd_stable_secret_prop) |
| 22 | |
steven_fann | d3e8f6f | 2021-01-26 13:34:00 +0800 | [diff] [blame] | 23 | get_prop(netd, adbd_config_prop) |
Joel Fernandes | b76a639 | 2019-01-11 08:32:45 -0500 | [diff] [blame] | 24 | get_prop(netd, bpf_progs_loaded_prop) |
Inseob Kim | 55e5c9b | 2020-03-04 17:20:35 +0900 | [diff] [blame] | 25 | get_prop(netd, hwservicemanager_prop) |
| 26 | get_prop(netd, device_config_netd_native_prop) |
lifr | 980c08c | 2018-11-21 22:53:48 +0800 | [diff] [blame] | 27 | |
| 28 | # Allow netd to write to statsd. |
| 29 | unix_socket_send(netd, statsdw, statsd) |
Remi NGUYEN VAN | 780fbad | 2019-01-28 13:08:42 +0900 | [diff] [blame] | 30 | |
| 31 | # Allow netd to send callbacks to network_stack |
| 32 | binder_call(netd, network_stack) |
| 33 | |
Chalard Jean | a4c9f7b | 2019-04-05 17:33:56 +0900 | [diff] [blame] | 34 | # Allow netd to send dump info to dumpstate |
| 35 | allow netd dumpstate:fd use; |
| 36 | allow netd dumpstate:fifo_file { getattr write }; |
Inseob Kim | 55e5c9b | 2020-03-04 17:20:35 +0900 | [diff] [blame] | 37 | |
| 38 | # persist.netd.stable_secret contains RFC 7217 secret key which should never be |
| 39 | # leaked to other processes. Make sure it never leaks. |
| 40 | neverallow { domain -netd -init -dumpstate } netd_stable_secret_prop:file r_file_perms; |
| 41 | |
| 42 | # We want to ensure that no other process ever tries tampering with persist.netd.stable_secret, |
| 43 | # the RFC 7217 secret key managed by netd. Doing so could compromise user privacy. |
| 44 | neverallow { domain -netd -init } netd_stable_secret_prop:property_service set; |