Orion Hodson | 8f75f76 | 2020-10-16 15:29:55 +0100 | [diff] [blame] | 1 | # odrefresh |
| 2 | type odrefresh, domain, coredomain; |
| 3 | type odrefresh_exec, system_file_type, exec_type, file_type; |
| 4 | |
| 5 | # Allow odrefresh to create files and directories for on device signing. |
| 6 | allow odrefresh apex_module_data_file:dir { getattr search }; |
| 7 | allow odrefresh apex_art_data_file:dir { create_dir_perms relabelfrom }; |
Orion Hodson | 46c2aad | 2021-03-01 15:03:26 +0000 | [diff] [blame] | 8 | allow odrefresh apex_art_data_file:file create_file_perms; |
Orion Hodson | 8f75f76 | 2020-10-16 15:29:55 +0100 | [diff] [blame] | 9 | |
Lokesh Gidra | 06edcd8 | 2021-03-11 11:32:47 -0800 | [diff] [blame^] | 10 | userfaultfd_use(odrefresh) |
| 11 | |
Orion Hodson | 8f75f76 | 2020-10-16 15:29:55 +0100 | [diff] [blame] | 12 | # Staging area labels (/data/misc/apexdata/com.android.art/staging). odrefresh |
| 13 | # sets up files here and passes file descriptors for dex2oat to write to. |
| 14 | allow odrefresh apex_art_staging_data_file:dir { create_dir_perms relabelto }; |
| 15 | allow odrefresh apex_art_staging_data_file:file create_file_perms; |
| 16 | |
| 17 | # Run dex2oat in its own sandbox. |
| 18 | domain_auto_trans(odrefresh, dex2oat_exec, dex2oat) |
| 19 | |
| 20 | # Run dexoptanalyzer in its own sandbox. |
| 21 | domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer) |
| 22 | |
Martijn Coenen | 6afdb72 | 2020-11-27 12:23:54 +0100 | [diff] [blame] | 23 | # Use devpts and fd from odsign (which exec()'s odrefresh) |
| 24 | allow odrefresh odsign_devpts:chr_file { read write }; |
| 25 | allow odrefresh odsign:fd use; |
| 26 | |
Orion Hodson | 8f75f76 | 2020-10-16 15:29:55 +0100 | [diff] [blame] | 27 | # Do not audit unused resources from parent processes (adb, shell, su). |
| 28 | # These appear to be unnecessary for odrefresh. |
| 29 | dontaudit odrefresh { adbd shell }:fd use; |
| 30 | dontaudit odrefresh devpts:chr_file rw_file_perms; |
| 31 | dontaudit odrefresh adbd:unix_stream_socket { getattr read write }; |
| 32 | |
| 33 | # Allow odrefresh to read /apex/apex-info-list.xml to determine |
| 34 | # whether current apex is in /system or /data. |
| 35 | allow odrefresh apex_info_file:file r_file_perms; |
| 36 | |
| 37 | # No other processes should be creating files in the staging area. |
| 38 | neverallow { domain -init -odrefresh } apex_art_staging_data_file:file open; |