Inseob Kim | ff43be2 | 2021-06-07 16:56:56 +0900 | [diff] [blame^] | 1 | # uncrypt |
| 2 | type uncrypt, domain, mlstrustedsubject; |
| 3 | type uncrypt_exec, system_file_type, exec_type, file_type; |
| 4 | |
| 5 | allow uncrypt self:global_capability_class_set { dac_override dac_read_search }; |
| 6 | |
| 7 | userdebug_or_eng(` |
| 8 | # For debugging, allow /data/local/tmp access |
| 9 | r_dir_file(uncrypt, shell_data_file) |
| 10 | ') |
| 11 | |
| 12 | # Read /cache/recovery/command |
| 13 | # Read /cache/recovery/uncrypt_file |
| 14 | allow uncrypt cache_file:dir search; |
| 15 | allow uncrypt cache_recovery_file:dir rw_dir_perms; |
| 16 | allow uncrypt cache_recovery_file:file create_file_perms; |
| 17 | |
| 18 | # Read and write(for f2fs_pin_file) on OTA zip file at /data/ota_package/. |
| 19 | allow uncrypt ota_package_file:dir r_dir_perms; |
| 20 | allow uncrypt ota_package_file:file rw_file_perms; |
| 21 | |
| 22 | # Write to /dev/socket/uncrypt |
| 23 | unix_socket_connect(uncrypt, uncrypt, uncrypt) |
| 24 | |
| 25 | # Raw writes to block device |
| 26 | allow uncrypt self:global_capability_class_set sys_rawio; |
| 27 | allow uncrypt misc_block_device:blk_file w_file_perms; |
| 28 | allow uncrypt block_device:dir r_dir_perms; |
| 29 | |
| 30 | # Access userdata block device. |
| 31 | allow uncrypt userdata_block_device:blk_file w_file_perms; |
| 32 | |
| 33 | r_dir_file(uncrypt, rootfs) |
| 34 | |
| 35 | # Access to bootconfig is needed when calling ReadDefaultFstab. |
| 36 | allow uncrypt { |
| 37 | proc_bootconfig |
| 38 | proc_cmdline |
| 39 | |
| 40 | }:file r_file_perms; |
| 41 | |
| 42 | # Read files in /sys |
| 43 | r_dir_file(uncrypt, sysfs_dt_firmware_android) |
| 44 | |
| 45 | # Allow ReadDefaultFstab(). |
| 46 | read_fstab(uncrypt) |