blob: 0acf04685a12a660270a9c6e5ac49217f9e0329a [file] [log] [blame]
Victor Hsiehf97cc1f2021-11-30 14:43:47 -08001# odrefresh
2type odrefresh, domain, coredomain;
3type odrefresh_exec, system_file_type, exec_type, file_type;
4
5# Run dex2oat in its own sandbox.
6domain_auto_trans(odrefresh, dex2oat_exec, dex2oat)
7
8# Allow odrefresh to kill dex2oat if compilation times out.
9allow odrefresh dex2oat:process sigkill;
10
Victor Hsieh6c874fb2022-03-23 17:19:39 -070011userfaultfd_use(odrefresh)
12
13# Allow odrefresh to read /apex/apex-info-list.xml to gather information of
14# the current APEXes.
15allow odrefresh apex_info_file:file r_file_perms;
16
17# The policies above are mirrored from Android's, while the below are tailored for using in CompOS.
18
Victor Hsiehf97cc1f2021-11-30 14:43:47 -080019# Allow odrefresh to read/write/lookup files/directories on authfs.
20allow odrefresh authfs_fuse:file create_file_perms;
21allow odrefresh authfs_fuse:dir create_dir_perms;
22
23# Allow odrefresh to check the parent directory exists.
24allow odrefresh authfs_data_file:dir { search getattr };
25
Victor Hsieh1494f6b2021-12-08 14:52:06 -080026# Minijail uses pipe for the parent process to signal the child (as a fallback
27# mechanism, since Android does not support minijail's preload).
28# TODO(196109647): We can probably remove this once the minijail preload is
29# supported on Android.
30allow odrefresh compos:fifo_file read;
31
Victor Hsieha3410252021-12-15 16:48:07 -080032# Allow using FDs from the parent. It's possible that this could be avoided,
33# if we close fd 0-2 before execute. But minijial replaces them with /dev/null
34# (unless specified otherwise). Without allowing the use, the execution will
35# fail immediately. See b/210909688.
36allow odrefresh compos:fd use;
Victor Hsiehe2156d02022-02-22 23:05:06 +000037
Victor Hsieh7026c102022-05-13 15:22:16 -070038# Allow odrefresh to read all dalvik system properties. odrefresh needs to record the relevant ones
39# in the output for later verification check.
Jiakai Zhang22fb5c72023-03-30 15:50:05 +010040get_prop(odrefresh, dalvik_config_prop_type)
Victor Hsieh7026c102022-05-13 15:22:16 -070041get_prop(odrefresh, device_config_runtime_native_boot_prop)
42
43# Silently ignore the write to properties, e.g. for setting boot animation progress.
Victor Hsiehe2156d02022-02-22 23:05:06 +000044dontaudit odrefresh property_socket:sock_file write;