Igor Murashkin | e39f8d2 | 2020-02-12 16:28:19 -0800 | [diff] [blame] | 1 | # iorap.inode2filename -> look up file paths from an inode |
| 2 | type iorap_inode2filename, domain; |
| 3 | type iorap_inode2filename_exec, exec_type, file_type, system_file_type; |
| 4 | type iorap_inode2filename_tmpfs, file_type; |
| 5 | |
| 6 | r_dir_file(iorap_inode2filename, rootfs) |
| 7 | |
| 8 | # Allow usage of pipes (child stdout -> parent pipe). |
| 9 | allow iorap_inode2filename iorapd:fd use; |
| 10 | allow iorap_inode2filename iorapd:fifo_file { read write getattr }; |
| 11 | |
| 12 | # Allow reading most files under / ignoring usual access controls. |
| 13 | allow iorap_inode2filename self:capability dac_read_search; |
| 14 | |
| 15 | typeattribute iorap_inode2filename mlstrustedsubject; |
| 16 | |
| 17 | # Grant access to open most of the files under / |
| 18 | allow iorap_inode2filename apex_data_file:dir { getattr open read search }; |
| 19 | allow iorap_inode2filename apex_data_file:file { getattr }; |
| 20 | allow iorap_inode2filename apex_mnt_dir:dir { getattr open read search }; |
| 21 | allow iorap_inode2filename apex_mnt_dir:file { getattr }; |
| 22 | allow iorap_inode2filename apk_data_file:dir { getattr open read search }; |
| 23 | allow iorap_inode2filename apk_data_file:file { getattr }; |
Alan Stokes | f8ad339 | 2020-10-27 17:35:33 +0000 | [diff] [blame] | 24 | allow iorap_inode2filename app_data_file_type:dir { getattr open read search }; |
| 25 | allow iorap_inode2filename app_data_file_type:file { getattr }; |
Igor Murashkin | e39f8d2 | 2020-02-12 16:28:19 -0800 | [diff] [blame] | 26 | allow iorap_inode2filename backup_data_file:dir { getattr open read search }; |
| 27 | allow iorap_inode2filename backup_data_file:file { getattr }; |
Igor Murashkin | e39f8d2 | 2020-02-12 16:28:19 -0800 | [diff] [blame] | 28 | allow iorap_inode2filename bootchart_data_file:dir { getattr open read search }; |
| 29 | allow iorap_inode2filename bootchart_data_file:file { getattr }; |
| 30 | allow iorap_inode2filename metadata_file:dir { getattr open read search search }; |
| 31 | allow iorap_inode2filename metadata_file:file { getattr }; |
| 32 | allow iorap_inode2filename packages_list_file:dir { getattr open read search }; |
| 33 | allow iorap_inode2filename packages_list_file:file { getattr }; |
Igor Murashkin | e39f8d2 | 2020-02-12 16:28:19 -0800 | [diff] [blame] | 34 | allow iorap_inode2filename property_data_file:dir { getattr open read search }; |
| 35 | allow iorap_inode2filename property_data_file:file { getattr }; |
Igor Murashkin | e39f8d2 | 2020-02-12 16:28:19 -0800 | [diff] [blame] | 36 | allow iorap_inode2filename resourcecache_data_file:dir { getattr open read search }; |
| 37 | allow iorap_inode2filename resourcecache_data_file:file { getattr }; |
| 38 | allow iorap_inode2filename recovery_data_file:dir { getattr open read search }; |
| 39 | allow iorap_inode2filename ringtone_file:dir { getattr open read search }; |
| 40 | allow iorap_inode2filename ringtone_file:file { getattr }; |
| 41 | allow iorap_inode2filename same_process_hal_file:dir { getattr open read search }; |
| 42 | allow iorap_inode2filename same_process_hal_file:file { getattr }; |
| 43 | allow iorap_inode2filename sepolicy_file:file { getattr }; |
| 44 | allow iorap_inode2filename staging_data_file:dir { getattr open read search }; |
| 45 | allow iorap_inode2filename staging_data_file:file { getattr }; |
| 46 | allow iorap_inode2filename system_bootstrap_lib_file:dir { getattr open read search }; |
| 47 | allow iorap_inode2filename system_bootstrap_lib_file:file { getattr }; |
Igor Murashkin | e39f8d2 | 2020-02-12 16:28:19 -0800 | [diff] [blame] | 48 | allow iorap_inode2filename system_data_file:dir { getattr open read search }; |
| 49 | allow iorap_inode2filename system_data_file:file { getattr }; |
| 50 | allow iorap_inode2filename system_data_file:lnk_file { getattr open read }; |
| 51 | allow iorap_inode2filename system_data_root_file:dir { getattr open read search }; |
| 52 | allow iorap_inode2filename textclassifier_data_file:dir { getattr open read search }; |
| 53 | allow iorap_inode2filename textclassifier_data_file:file { getattr }; |
| 54 | allow iorap_inode2filename toolbox_exec:file getattr; |
Alan Stokes | 7aa4041 | 2020-12-04 14:07:52 +0000 | [diff] [blame] | 55 | allow iorap_inode2filename user_profile_root_file:dir { getattr open read search }; |
Igor Murashkin | e39f8d2 | 2020-02-12 16:28:19 -0800 | [diff] [blame] | 56 | allow iorap_inode2filename user_profile_data_file:dir { getattr open read search }; |
| 57 | allow iorap_inode2filename user_profile_data_file:file { getattr }; |
| 58 | allow iorap_inode2filename unencrypted_data_file:dir { getattr open read search }; |
| 59 | allow iorap_inode2filename unlabeled:file { getattr }; |
| 60 | allow iorap_inode2filename vendor_file:dir { getattr open read search }; |
| 61 | allow iorap_inode2filename vendor_file:file { getattr }; |
| 62 | allow iorap_inode2filename vendor_overlay_file:file { getattr }; |
| 63 | allow iorap_inode2filename zygote_exec:file { getattr }; |
| 64 | |
| 65 | ### |
| 66 | ### neverallow rules |
| 67 | ### |
| 68 | |
| 69 | neverallow { domain -init -iorapd } iorap_inode2filename:process { transition dyntransition }; |
| 70 | neverallow iorap_inode2filename domain:{ tcp_socket udp_socket rawip_socket } *; |