2021-09-09 18:08:15 +02:00
|
|
|
type composd, domain, coredomain;
|
|
|
|
type composd_exec, system_file_type, exec_type, file_type;
|
|
|
|
|
2021-11-19 18:33:34 +01:00
|
|
|
# Host dynamic AIDL services
|
2021-09-09 18:08:15 +02:00
|
|
|
init_daemon_domain(composd)
|
|
|
|
binder_use(composd)
|
|
|
|
add_service(composd, compos_service)
|
|
|
|
|
2021-10-19 17:50:24 +02:00
|
|
|
# Call back into system server
|
|
|
|
binder_call(composd, system_server)
|
|
|
|
|
2021-09-09 18:08:15 +02:00
|
|
|
# Start a VM
|
|
|
|
virtualizationservice_use(composd)
|
|
|
|
|
2021-12-16 15:31:14 +01:00
|
|
|
# Prepare staging directory for odrefresh
|
2021-12-04 01:46:18 +01:00
|
|
|
allow composd apex_art_data_file:dir { create_dir_perms relabelfrom };
|
|
|
|
allow composd apex_art_staging_data_file:dir { create_dir_perms relabelto };
|
2021-12-21 15:43:39 +01:00
|
|
|
allow composd apex_art_staging_data_file:file { getattr unlink };
|
2021-12-04 01:46:18 +01:00
|
|
|
|
2023-03-15 01:43:09 +01:00
|
|
|
# Delete files or enable fs-verity in the odrefresh target directory
|
|
|
|
allow composd apex_art_data_file:file { open ioctl read unlink write };
|
|
|
|
allowxperm composd apex_art_data_file:file ioctl FS_IOC_ENABLE_VERITY;
|
2021-12-16 15:31:14 +01:00
|
|
|
|
2021-09-09 18:08:15 +02:00
|
|
|
# Access our APEX data files
|
|
|
|
allow composd apex_module_data_file:dir search;
|
|
|
|
allow composd apex_compos_data_file:dir create_dir_perms;
|
|
|
|
allow composd apex_compos_data_file:file create_file_perms;
|
2021-09-15 15:28:12 +02:00
|
|
|
|
2021-11-30 23:21:06 +01:00
|
|
|
# Run fd_server in its own domain, and send SIGTERM when finished.
|
|
|
|
domain_auto_trans(composd, fd_server_exec, compos_fd_server)
|
|
|
|
allow composd compos_fd_server:process signal;
|
|
|
|
|
2023-03-22 10:48:30 +01:00
|
|
|
# Read properties used to configure the CompOS VM
|
|
|
|
get_prop(composd, composd_vm_art_prop)
|
|
|
|
get_prop(composd, composd_vm_vendor_prop)
|
|
|
|
|
2021-12-02 00:25:23 +01:00
|
|
|
# Read ART's properties
|
2023-03-30 16:50:05 +02:00
|
|
|
get_prop(composd, dalvik_config_prop_type)
|
2022-05-11 01:14:30 +02:00
|
|
|
get_prop(composd, device_config_runtime_native_boot_prop)
|
2021-12-16 15:31:14 +01:00
|
|
|
|
|
|
|
# We never create any artifact files directly
|
2023-03-15 01:43:09 +01:00
|
|
|
neverallow composd apex_art_data_file:file create;
|
2023-03-22 10:48:30 +01:00
|
|
|
|
|
|
|
# ART sets these properties via init script, nothing else should
|
|
|
|
neverallow { domain -init } composd_vm_art_prop:property_service set;
|