blob: c1ccc38b00320feb672baea48e2c8bd0c634f374 [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 };
8allow odrefresh apex_art_data_file:file { open create write read getattr unlink };
9
10# Staging area labels (/data/misc/apexdata/com.android.art/staging). odrefresh
11# sets up files here and passes file descriptors for dex2oat to write to.
12allow odrefresh apex_art_staging_data_file:dir { create_dir_perms relabelto };
13allow odrefresh apex_art_staging_data_file:file create_file_perms;
14
15# Run dex2oat in its own sandbox.
16domain_auto_trans(odrefresh, dex2oat_exec, dex2oat)
17
18# Run dexoptanalyzer in its own sandbox.
19domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer)
20
21# Do not audit unused resources from parent processes (adb, shell, su).
22# These appear to be unnecessary for odrefresh.
23dontaudit odrefresh { adbd shell }:fd use;
24dontaudit odrefresh devpts:chr_file rw_file_perms;
25dontaudit odrefresh adbd:unix_stream_socket { getattr read write };
26
27# Allow odrefresh to read /apex/apex-info-list.xml to determine
28# whether current apex is in /system or /data.
29allow odrefresh apex_info_file:file r_file_perms;
30
31# No other processes should be creating files in the staging area.
32neverallow { domain -init -odrefresh } apex_art_staging_data_file:file open;