Inseob Kim | ff43be2 | 2021-06-07 16:56:56 +0900 | [diff] [blame] | 1 | type sdcardd, domain; |
| 2 | type sdcardd_exec, system_file_type, exec_type, file_type; |
| 3 | |
| 4 | allow sdcardd cgroup:dir create_dir_perms; |
| 5 | allow sdcardd cgroup_v2:dir create_dir_perms; |
| 6 | allow sdcardd fuse_device:chr_file rw_file_perms; |
| 7 | allow sdcardd rootfs:dir mounton; # TODO: deprecated in M |
| 8 | allow sdcardd sdcardfs:filesystem remount; |
| 9 | allow sdcardd tmpfs:dir r_dir_perms; |
| 10 | allow sdcardd mnt_media_rw_file:dir r_dir_perms; |
| 11 | allow sdcardd storage_file:dir search; |
| 12 | allow sdcardd storage_stub_file:dir { search mounton }; |
| 13 | allow sdcardd sdcard_type:filesystem { mount unmount }; |
| 14 | allow sdcardd self:global_capability_class_set { setuid setgid dac_override dac_read_search sys_admin sys_resource }; |
| 15 | |
| 16 | allow sdcardd sdcard_type:dir create_dir_perms; |
| 17 | allow sdcardd sdcard_type:file create_file_perms; |
| 18 | |
| 19 | allow sdcardd media_rw_data_file:dir create_dir_perms; |
| 20 | allow sdcardd media_rw_data_file:file create_file_perms; |
| 21 | |
| 22 | # Read /data/system/packages.list. |
| 23 | allow sdcardd system_data_file:file r_file_perms; |
| 24 | allow sdcardd packages_list_file:file r_file_perms; |
| 25 | |
| 26 | # Read /data/misc/installd/layout_version |
| 27 | allow sdcardd install_data_file:file r_file_perms; |
| 28 | allow sdcardd install_data_file:dir search; |
| 29 | |
| 30 | # Allow stdin/out back to vold |
| 31 | allow sdcardd vold:fd use; |
| 32 | allow sdcardd vold:fifo_file { read write getattr }; |
| 33 | |
| 34 | # Allow running on top of expanded storage |
| 35 | allow sdcardd mnt_expand_file:dir search; |
| 36 | |
| 37 | # access /proc/filesystems |
| 38 | allow sdcardd proc_filesystems:file r_file_perms; |
| 39 | |
| 40 | ### |
| 41 | ### neverallow rules |
| 42 | ### |
| 43 | |
| 44 | # The sdcard daemon should no longer be started from init |
| 45 | neverallow init sdcardd_exec:file execute; |
| 46 | neverallow init sdcardd:process { transition dyntransition }; |