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