2020-10-16 16:29:55 +02:00
|
|
|
# odrefresh
|
|
|
|
type odrefresh, domain, coredomain;
|
|
|
|
type odrefresh_exec, system_file_type, exec_type, file_type;
|
|
|
|
|
|
|
|
# Allow odrefresh to create files and directories for on device signing.
|
|
|
|
allow odrefresh apex_module_data_file:dir { getattr search };
|
|
|
|
allow odrefresh apex_art_data_file:dir { create_dir_perms relabelfrom };
|
2024-03-15 17:39:13 +01:00
|
|
|
allow odrefresh apex_art_data_file:file { create_file_perms relabelto } ;
|
2020-10-16 16:29:55 +02:00
|
|
|
|
2021-04-09 16:17:38 +02:00
|
|
|
# Allow odrefresh to create data files (typically for metrics before statsd starts).
|
|
|
|
allow odrefresh odrefresh_data_file:dir create_dir_perms;
|
|
|
|
allow odrefresh odrefresh_data_file:file create_file_perms;
|
|
|
|
|
2021-03-11 20:32:47 +01:00
|
|
|
userfaultfd_use(odrefresh)
|
|
|
|
|
2020-10-16 16:29:55 +02:00
|
|
|
# Staging area labels (/data/misc/apexdata/com.android.art/staging). odrefresh
|
|
|
|
# sets up files here and passes file descriptors for dex2oat to write to.
|
|
|
|
allow odrefresh apex_art_staging_data_file:dir { create_dir_perms relabelto };
|
2024-03-15 17:39:13 +01:00
|
|
|
allow odrefresh apex_art_staging_data_file:file { create_file_perms relabelfrom };
|
2020-10-16 16:29:55 +02:00
|
|
|
|
|
|
|
# Run dex2oat in its own sandbox.
|
|
|
|
domain_auto_trans(odrefresh, dex2oat_exec, dex2oat)
|
|
|
|
|
2021-08-17 20:02:42 +02:00
|
|
|
# Allow odrefresh to kill dex2oat if compilation times out.
|
|
|
|
allow odrefresh dex2oat:process sigkill;
|
|
|
|
|
2020-10-16 16:29:55 +02:00
|
|
|
# Run dexoptanalyzer in its own sandbox.
|
|
|
|
domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer)
|
|
|
|
|
2021-08-17 20:02:42 +02:00
|
|
|
# Allow odrefresh to kill dexoptanalyzer if analysis times out.
|
|
|
|
allow odrefresh dexoptanalyzer:process sigkill;
|
|
|
|
|
2020-11-27 12:23:54 +01:00
|
|
|
# Use devpts and fd from odsign (which exec()'s odrefresh)
|
|
|
|
allow odrefresh odsign_devpts:chr_file { read write };
|
|
|
|
allow odrefresh odsign:fd use;
|
|
|
|
|
2021-09-15 15:28:12 +02:00
|
|
|
# Allow odrefresh to read /apex/apex-info-list.xml to determine
|
|
|
|
# whether current apex is in /system or /data.
|
|
|
|
allow odrefresh apex_info_file:file r_file_perms;
|
|
|
|
|
|
|
|
# Allow updating boot animation status.
|
|
|
|
set_prop(odrefresh, bootanim_system_prop)
|
|
|
|
|
|
|
|
# Allow query ART device config properties
|
|
|
|
get_prop(odrefresh, device_config_runtime_native_prop)
|
|
|
|
get_prop(odrefresh, device_config_runtime_native_boot_prop)
|
|
|
|
|
2020-10-16 16:29:55 +02:00
|
|
|
# Do not audit unused resources from parent processes (adb, shell, su).
|
|
|
|
# These appear to be unnecessary for odrefresh.
|
|
|
|
dontaudit odrefresh { adbd shell }:fd use;
|
|
|
|
dontaudit odrefresh devpts:chr_file rw_file_perms;
|
|
|
|
dontaudit odrefresh adbd:unix_stream_socket { getattr read write };
|
|
|
|
|
2024-03-15 17:39:13 +01:00
|
|
|
# Read access to SELinux context files, for restorecon.
|
|
|
|
allow odrefresh file_contexts_file:file r_file_perms;
|
|
|
|
allow odrefresh seapp_contexts_file:file r_file_perms;
|
|
|
|
|
|
|
|
# Check validity of SELinux context, for restorecon.
|
|
|
|
selinux_check_context(odrefresh)
|
2024-03-20 12:24:54 +01:00
|
|
|
|
|
|
|
# odrefresh iterates over all properties to find the ones that it's interested
|
|
|
|
# in. It's okay to ignore denials on other properties.
|
|
|
|
dontaudit odrefresh property_type:file r_file_perms;
|
|
|
|
|
|
|
|
# Allow to be called by artd in Pre-reboot Dexopt.
|
|
|
|
allow odrefresh artd:fd use;
|
|
|
|
|
|
|
|
# Neverallow rules.
|
|
|
|
|
|
|
|
# No other processes should be creating files in the staging area.
|
|
|
|
neverallow { domain -init -odrefresh -compos_fd_server } apex_art_staging_data_file:file open;
|
|
|
|
|
|
|
|
# No processes other than init, odrefresh, system_server, and artd access
|
|
|
|
# odrefresh_data_files.
|
|
|
|
# Among those, artd only needs to bind-mount /data/misc/odrefresh, but doesn't
|
|
|
|
# need to access the files.
|
|
|
|
neverallow { domain -init -odrefresh -system_server -artd } odrefresh_data_file:dir *;
|
|
|
|
neverallow { domain -init -odrefresh -system_server } odrefresh_data_file:file *;
|