Alan Stokes | 72cac09 | 2021-07-21 12:13:19 +0100 | [diff] [blame] | 1 | # dex2oat |
| 2 | type dex2oat, domain, coredomain; |
| 3 | type dex2oat_exec, system_file_type, exec_type, file_type; |
| 4 | |
Victor Hsieh | 2a017b6 | 2022-03-08 22:22:33 +0000 | [diff] [blame] | 5 | userfaultfd_use(dex2oat) |
| 6 | |
Alan Stokes | 72cac09 | 2021-07-21 12:13:19 +0100 | [diff] [blame] | 7 | allow dex2oat tmpfs:file { read getattr map }; |
Victor Hsieh | aa987aa | 2021-08-10 16:33:32 -0700 | [diff] [blame] | 8 | |
| 9 | # Allow dex2oat to use FDs from authfs_service via compos. |
| 10 | allow dex2oat authfs_service:fd use; |
| 11 | allow dex2oat compos:fd use; |
Victor Hsieh | f97cc1f | 2021-11-30 14:43:47 -0800 | [diff] [blame] | 12 | allow dex2oat odrefresh:fd use; |
Victor Hsieh | aa987aa | 2021-08-10 16:33:32 -0700 | [diff] [blame] | 13 | |
| 14 | # Allow dex2oat to read/write FDs on authfs_fuse filesystem. |
Victor Hsieh | dedb490 | 2021-08-19 13:59:37 -0700 | [diff] [blame] | 15 | allow dex2oat authfs_fuse:file { read write getattr map }; |
Victor Hsieh | aa987aa | 2021-08-10 16:33:32 -0700 | [diff] [blame] | 16 | |
Victor Hsieh | e2a4d0c | 2021-12-15 10:57:35 -0800 | [diff] [blame] | 17 | # Allow to search in authfs directories. |
| 18 | allow dex2oat authfs_data_file:dir { search }; |
| 19 | allow dex2oat authfs_fuse:dir { search }; |
| 20 | |
Victor Hsieh | aa987aa | 2021-08-10 16:33:32 -0700 | [diff] [blame] | 21 | # Minijail uses pipe for the parent process to signal the child (as a fallback |
| 22 | # mechanism, since Android does not support minijail's preload). |
| 23 | # TODO(196109647): We can probably remove this once the minijail preload is |
| 24 | # supported on Android. |
| 25 | allow dex2oat compos:fifo_file read; |
| 26 | |
| 27 | # Allow acquiring advisory lock on /system/framework/<arch>/* |
| 28 | allow dex2oat system_file:file lock; |
| 29 | |
| 30 | # Allow dex2oat to read /apex/apex-info-list.xml |
| 31 | allow dex2oat apex_info_file:file r_file_perms; |
Victor Hsieh | b415c73 | 2021-12-14 11:06:23 -0800 | [diff] [blame] | 32 | |
Alan Stokes | 8b40e90 | 2023-02-01 15:56:32 +0000 | [diff] [blame] | 33 | # Allow reading dalvik system properties that may affect compilation |
Jiakai Zhang | 22fb5c7 | 2023-03-30 15:50:05 +0100 | [diff] [blame] | 34 | get_prop(dex2oat, dalvik_config_prop_type) |
Alan Stokes | 8b40e90 | 2023-02-01 15:56:32 +0000 | [diff] [blame] | 35 | get_prop(dex2oat, device_config_runtime_native_boot_prop) |
| 36 | |
| 37 | # Don't audit because we don't configure the compiler through these |
| 38 | # properties in the VM. |
Victor Hsieh | b415c73 | 2021-12-14 11:06:23 -0800 | [diff] [blame] | 39 | dontaudit dex2oat device_config_runtime_native_prop:file { open read getattr map }; |