blob: c6ab7bbab166d320f9e0f776a12d4565aba022e4 [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
Orion Hodson7c6b3eb2021-04-09 15:17:38 +010010# Allow odrefresh to create data files (typically for metrics before statsd starts).
11allow odrefresh odrefresh_data_file:dir create_dir_perms;
12allow odrefresh odrefresh_data_file:file create_file_perms;
13
Lokesh Gidra06edcd82021-03-11 11:32:47 -080014userfaultfd_use(odrefresh)
15
Orion Hodson8f75f762020-10-16 15:29:55 +010016# Staging area labels (/data/misc/apexdata/com.android.art/staging). odrefresh
17# sets up files here and passes file descriptors for dex2oat to write to.
18allow odrefresh apex_art_staging_data_file:dir { create_dir_perms relabelto };
19allow odrefresh apex_art_staging_data_file:file create_file_perms;
20
21# Run dex2oat in its own sandbox.
22domain_auto_trans(odrefresh, dex2oat_exec, dex2oat)
23
Orion Hodson522bcbe2021-08-17 19:02:42 +010024# Allow odrefresh to kill dex2oat if compilation times out.
25allow odrefresh dex2oat:process sigkill;
26
Orion Hodson8f75f762020-10-16 15:29:55 +010027# Run dexoptanalyzer in its own sandbox.
28domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer)
29
Orion Hodson522bcbe2021-08-17 19:02:42 +010030# Allow odrefresh to kill dexoptanalyzer if analysis times out.
31allow odrefresh dexoptanalyzer:process sigkill;
32
Martijn Coenen6afdb722020-11-27 12:23:54 +010033# Use devpts and fd from odsign (which exec()'s odrefresh)
34allow odrefresh odsign_devpts:chr_file { read write };
35allow odrefresh odsign:fd use;
36
Alan Stokesd3438b02021-09-15 14:28:12 +010037# Allow odrefresh to read /apex/apex-info-list.xml to determine
38# whether current apex is in /system or /data.
39allow odrefresh apex_info_file:file r_file_perms;
40
41# Allow updating boot animation status.
42set_prop(odrefresh, bootanim_system_prop)
43
44# Allow query ART device config properties
45get_prop(odrefresh, device_config_runtime_native_prop)
46get_prop(odrefresh, device_config_runtime_native_boot_prop)
47
48# Use inherited stdin/stdout/stderr from composd which exec()'s
49# odrefesh.
50allow odrefresh composd:fd use;
51
Alan Stokesec4a90f2021-09-21 13:32:24 +010052# Run binaries from the CompOS APEX in the same domain
Alan Stokesd3438b02021-09-15 14:28:12 +010053allow odrefresh system_file:file execute_no_trans;
54
Alan Stokesec4a90f2021-09-21 13:32:24 +010055# Make binder calls back to composd
56binder_use(odrefresh)
57allow odrefresh compos_service:service_manager find;
58binder_call(odrefresh, composd)
59
60# Run fd_server in its own domain
61domain_auto_trans(odrefresh, fd_server_exec, compos_fd_server)
62
63# And kill it via SIGTERM
64allow odrefresh compos_fd_server:process signal;
65
Orion Hodson8f75f762020-10-16 15:29:55 +010066# Do not audit unused resources from parent processes (adb, shell, su).
67# These appear to be unnecessary for odrefresh.
68dontaudit odrefresh { adbd shell }:fd use;
69dontaudit odrefresh devpts:chr_file rw_file_perms;
70dontaudit odrefresh adbd:unix_stream_socket { getattr read write };
71
Orion Hodson8f75f762020-10-16 15:29:55 +010072# No other processes should be creating files in the staging area.
73neverallow { domain -init -odrefresh } apex_art_staging_data_file:file open;
Orion Hodson7c6b3eb2021-04-09 15:17:38 +010074
75# No processes other than init, odrefresh and system_server access
76# odrefresh_data_files.
77neverallow { domain -init -odrefresh -system_server } odrefresh_data_file:dir *;
78neverallow { domain -init -odrefresh -system_server } odrefresh_data_file:file *;