blob: 04cb70ffafee1e4165c4d16d50eaac6ce8c0e9ec [file] [log] [blame]
Yakun Xu07429e32023-06-02 03:36:01 +00001#
2# ot_daemon is the native Thread network stack on the host (Android) side.
3# Refer to https://www.threadgroup.org for Thread network knowledge.
4#
5
6# ot_daemon
7type ot_daemon, domain, coredomain;
8type ot_daemon_exec, exec_type, file_type, system_file_type;
9
10# Allow init ot_daemon
11init_daemon_domain(ot_daemon)
12# Allow the ot_daemon to use the net domain.
13net_domain(ot_daemon)
14
Kangping Donge21496b2024-01-02 15:10:27 +080015# Allow ot_daemon to find /data/misc/apexdata/com.android.tethering
16allow ot_daemon apex_module_data_file:dir search;
17
18# Allow the ot_daemon to access files and subdirectories under
19# /data/misc/apexdata/com\.android\.tethering
20allow ot_daemon apex_tethering_data_file:dir {create rw_dir_perms};
21allow ot_daemon apex_tethering_data_file:file create_file_perms;
Yakun Xu07429e32023-06-02 03:36:01 +000022
Kangping Dong0b3e8c62022-10-28 15:56:02 +080023# Allow OT daemon to read/write the Thread tunnel interface
24allow ot_daemon tun_device:chr_file {read write};
25
Handa Wang8612e802023-08-23 15:40:49 +080026# Allow OT daemon to read/write on the socket created by System Server
27allow ot_daemon system_server:rawip_socket rw_socket_perms_no_ioctl;
28
Kangping Dong47425ae2024-11-20 15:49:39 +080029# Allow OT daemon to read/write on the UDP sockets created by system server
30allow ot_daemon system_server:udp_socket rw_socket_perms;
31
Zhanglong Xiab2d1fbb2023-06-14 05:26:15 +000032hal_client_domain(ot_daemon, hal_threadnetwork)
Kangping Dong0b3e8c62022-10-28 15:56:02 +080033
34# Only ot_daemon can publish the binder service
35binder_use(ot_daemon)
36add_service(ot_daemon, ot_daemon_service)
37binder_call(ot_daemon, system_server)
Tony Zhou4ed6a0d2023-10-26 13:43:59 +080038
39# Allow OT daemon to write to statsd
40unix_socket_send(ot_daemon, statsdw, statsd)
Kangping Donge1ee7682023-12-01 13:02:38 +080041
42# For collecting bugreports.
43allow ot_daemon dumpstate:fd use;
44allow ot_daemon dumpstate:fifo_file write;
Kangping Dong90495cc2024-02-29 23:43:34 +080045
46# ot-daemon socket is for only ot-daemon and ot-ctl
47neverallow {
48 domain
49 -ot_daemon
50 userdebug_or_eng(`-ot_ctl')
51 -init
52 -vendor_init
53} ot_daemon_socket:sock_file *;