blob: d8b4392ea966dec262ad4648b6225c500d687023 [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
11# Allow odrefresh to read/write/lookup files/directories on authfs.
12allow odrefresh authfs_fuse:file create_file_perms;
13allow odrefresh authfs_fuse:dir create_dir_perms;
14
15# Allow odrefresh to check the parent directory exists.
16allow odrefresh authfs_data_file:dir { search getattr };
17
18# Allow odrefresh to read /apex/apex-info-list.xml to gather information of
19# the current APEXes.
20allow odrefresh apex_info_file:file r_file_perms;
21
Victor Hsieh1494f6b2021-12-08 14:52:06 -080022# Minijail uses pipe for the parent process to signal the child (as a fallback
23# mechanism, since Android does not support minijail's preload).
24# TODO(196109647): We can probably remove this once the minijail preload is
25# supported on Android.
26allow odrefresh compos:fifo_file read;
27
Victor Hsieha3410252021-12-15 16:48:07 -080028# Allow using FDs from the parent. It's possible that this could be avoided,
29# if we close fd 0-2 before execute. But minijial replaces them with /dev/null
30# (unless specified otherwise). Without allowing the use, the execution will
31# fail immediately. See b/210909688.
32allow odrefresh compos:fd use;