xref: /aosp_15_r20/system/sepolicy/private/linkerconfig.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1type linkerconfig, domain, coredomain;
2type linkerconfig_exec, exec_type, file_type, system_file_type;
3
4init_daemon_domain(linkerconfig)
5
6## Read and write linkerconfig subdirectory.
7allow linkerconfig linkerconfig_file:dir create_dir_perms;
8allow linkerconfig linkerconfig_file:file create_file_perms;
9
10# Allow linkerconfig to log to the kernel.
11allow linkerconfig kmsg_device:chr_file w_file_perms;
12
13# Allow linkerconfig to be invoked with logwrapper from init.
14allow linkerconfig devpts:chr_file { getattr ioctl read write };
15
16# Allow linkerconfig to scan for apex modules
17allow linkerconfig apex_mnt_dir:dir r_dir_perms;
18
19# Allow linkerconfig to read apex-info-list.xml
20allow linkerconfig apex_info_file:file r_file_perms;
21
22# Allow linkerconfig to read apex_manifest.pb file from vendor apex
23r_dir_file(linkerconfig, vendor_apex_metadata_file)
24
25# Allow linkerconfig to be called in the otapreopt_chroot
26allow linkerconfig otapreopt_chroot:fd use;
27allow linkerconfig postinstall_apex_mnt_dir:dir r_dir_perms;
28allow linkerconfig postinstall_apex_mnt_dir:file r_file_perms;
29
30# Allow for use in Pre-reboot Dexopt.
31allow linkerconfig dexopt_chroot_setup:fd use;
32
33neverallow {
34  domain
35  -dexopt_chroot_setup
36  -init
37  -linkerconfig
38  -otapreopt_chroot
39} linkerconfig_exec:file no_x_file_perms;
40