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 }; |
| 8 | allow odrefresh apex_art_data_file:file { open create write read getattr unlink }; |
| 9 | |
| 10 | # Staging area labels (/data/misc/apexdata/com.android.art/staging). odrefresh |
| 11 | # sets up files here and passes file descriptors for dex2oat to write to. |
| 12 | allow odrefresh apex_art_staging_data_file:dir { create_dir_perms relabelto }; |
| 13 | allow odrefresh apex_art_staging_data_file:file create_file_perms; |
| 14 | |
| 15 | # Run dex2oat in its own sandbox. |
| 16 | domain_auto_trans(odrefresh, dex2oat_exec, dex2oat) |
| 17 | |
| 18 | # Run dexoptanalyzer in its own sandbox. |
| 19 | domain_auto_trans(odrefresh, dexoptanalyzer_exec, dexoptanalyzer) |
| 20 | |
| 21 | # Do not audit unused resources from parent processes (adb, shell, su). |
| 22 | # These appear to be unnecessary for odrefresh. |
| 23 | dontaudit odrefresh { adbd shell }:fd use; |
| 24 | dontaudit odrefresh devpts:chr_file rw_file_perms; |
| 25 | dontaudit odrefresh adbd:unix_stream_socket { getattr read write }; |
| 26 | |
| 27 | # Allow odrefresh to read /apex/apex-info-list.xml to determine |
| 28 | # whether current apex is in /system or /data. |
| 29 | allow odrefresh apex_info_file:file r_file_perms; |
| 30 | |
| 31 | # No other processes should be creating files in the staging area. |
| 32 | neverallow { domain -init -odrefresh } apex_art_staging_data_file:file open; |