xref: /aosp_15_r20/system/sepolicy/prebuilts/api/31.0/private/clatd.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker# 464xlat daemon
2*e4a36f41SAndroid Build Coastguard Workertype clatd, domain, coredomain;
3*e4a36f41SAndroid Build Coastguard Workertype clatd_exec, system_file_type, exec_type, file_type;
4*e4a36f41SAndroid Build Coastguard Worker
5*e4a36f41SAndroid Build Coastguard Workernet_domain(clatd)
6*e4a36f41SAndroid Build Coastguard Worker
7*e4a36f41SAndroid Build Coastguard Workerr_dir_file(clatd, proc_net_type)
8*e4a36f41SAndroid Build Coastguard Workeruserdebug_or_eng(`
9*e4a36f41SAndroid Build Coastguard Worker  auditallow clatd proc_net_type:{ dir file lnk_file } { getattr open read };
10*e4a36f41SAndroid Build Coastguard Worker')
11*e4a36f41SAndroid Build Coastguard Worker
12*e4a36f41SAndroid Build Coastguard Worker# Access objects inherited from netd.
13*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:fd use;
14*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:fifo_file { read write };
15*e4a36f41SAndroid Build Coastguard Worker# TODO: Check whether some or all of these sockets should be close-on-exec.
16*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:netlink_kobject_uevent_socket { read write };
17*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:netlink_nflog_socket { read write };
18*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:netlink_route_socket { read write };
19*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:udp_socket { read write };
20*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:unix_stream_socket { read write };
21*e4a36f41SAndroid Build Coastguard Workerallow clatd netd:unix_dgram_socket { read write };
22*e4a36f41SAndroid Build Coastguard Worker
23*e4a36f41SAndroid Build Coastguard Workerallow clatd self:global_capability_class_set { net_admin net_raw setuid setgid };
24*e4a36f41SAndroid Build Coastguard Worker
25*e4a36f41SAndroid Build Coastguard Worker# clatd calls mmap(MAP_LOCKED) with a 1M buffer. MAP_LOCKED first checks
26*e4a36f41SAndroid Build Coastguard Worker# capable(CAP_IPC_LOCK), and then checks to see the requested amount is
27*e4a36f41SAndroid Build Coastguard Worker# under RLIMIT_MEMLOCK. If the latter check succeeds clatd won't have
28*e4a36f41SAndroid Build Coastguard Worker# needed CAP_IPC_LOCK. But this is not guaranteed to succeed on all devices
29*e4a36f41SAndroid Build Coastguard Worker# so we permit any requests we see from clatd asking for this capability.
30*e4a36f41SAndroid Build Coastguard Worker# See https://android-review.googlesource.com/127940 and
31*e4a36f41SAndroid Build Coastguard Worker# https://b.corp.google.com/issues/21736319
32*e4a36f41SAndroid Build Coastguard Workerallow clatd self:global_capability_class_set ipc_lock;
33*e4a36f41SAndroid Build Coastguard Worker
34*e4a36f41SAndroid Build Coastguard Workerallow clatd self:netlink_route_socket nlmsg_write;
35*e4a36f41SAndroid Build Coastguard Workerallow clatd self:{ packet_socket rawip_socket } create_socket_perms_no_ioctl;
36*e4a36f41SAndroid Build Coastguard Workerallow clatd tun_device:chr_file rw_file_perms;
37