blob: e6b10233fad7f374cb183317266a07278a4370c0 [file] [log] [blame]
Orion Hodson8f75f762020-10-16 15:29:55 +01001# odrefresh
2type odrefresh, domain, coredomain;
3type odrefresh_exec, system_file_type, exec_type, file_type;
4
5# Allow odrefresh to create files and directories for on device signing.
6allow odrefresh apex_module_data_file:dir { getattr search };
7allow odrefresh apex_art_data_file:dir { create_dir_perms relabelfrom };
Orion Hodson46c2aad2021-03-01 15:03:26 +00008allow odrefresh apex_art_data_file:file create_file_perms;
Orion Hodson8f75f762020-10-16 15:29:55 +01009
Lokesh Gidra06edcd82021-03-11 11:32:47 -080010userfaultfd_use(odrefresh)
11
Orion Hodson8f75f762020-10-16 15:29:55 +010012# Staging area labels (/data/misc/apexdata/com.android.art/staging). odrefresh
13# sets up files here and passes file descriptors for dex2oat to write to.
14allow odrefresh apex_art_staging_data_file:dir { create_dir_perms relabelto };
15allow odrefresh apex_art_staging_data_file:file create_file_perms;
16
17# Run dex2oat in its own sandbox.
18domain_auto_trans(odrefresh, dex2oat_exec, dex2oat)
19
20# Run dexoptanalyzer in its own sandbox.
21domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer)
22
Martijn Coenen6afdb722020-11-27 12:23:54 +010023# Use devpts and fd from odsign (which exec()'s odrefresh)
24allow odrefresh odsign_devpts:chr_file { read write };
25allow odrefresh odsign:fd use;
26
Orion Hodson8f75f762020-10-16 15:29:55 +010027# Do not audit unused resources from parent processes (adb, shell, su).
28# These appear to be unnecessary for odrefresh.
29dontaudit odrefresh { adbd shell }:fd use;
30dontaudit odrefresh devpts:chr_file rw_file_perms;
31dontaudit odrefresh adbd:unix_stream_socket { getattr read write };
32
33# Allow odrefresh to read /apex/apex-info-list.xml to determine
34# whether current apex is in /system or /data.
35allow odrefresh apex_info_file:file r_file_perms;
36
37# No other processes should be creating files in the staging area.
38neverallow { domain -init -odrefresh } apex_art_staging_data_file:file open;