1type sdcardd, domain; 2type sdcardd_exec, system_file_type, exec_type, file_type; 3 4allow sdcardd cgroup:dir create_dir_perms; 5allow sdcardd cgroup_v2:dir create_dir_perms; 6allow sdcardd fuse_device:chr_file rw_file_perms; 7allow sdcardd rootfs:dir mounton; # TODO: deprecated in M 8allow sdcardd sdcardfs:filesystem remount; 9allow sdcardd tmpfs:dir r_dir_perms; 10allow sdcardd mnt_media_rw_file:dir r_dir_perms; 11allow sdcardd storage_file:dir search; 12allow sdcardd storage_stub_file:dir { search mounton }; 13allow sdcardd { sdcard_type fuse }:filesystem { mount unmount }; 14allow sdcardd self:global_capability_class_set { setuid setgid dac_override dac_read_search sys_admin sys_resource }; 15 16allow sdcardd { sdcard_type fuse }:dir create_dir_perms; 17allow sdcardd { sdcard_type fuse }:file create_file_perms; 18 19allow sdcardd media_rw_data_file:dir create_dir_perms; 20allow sdcardd media_rw_data_file:file create_file_perms; 21 22# Read /data/system/packages.list. 23allow sdcardd system_data_file:file r_file_perms; 24allow sdcardd packages_list_file:file r_file_perms; 25 26# Read /data/misc/installd/layout_version 27allow sdcardd install_data_file:file r_file_perms; 28allow sdcardd install_data_file:dir search; 29 30# Allow stdin/out back to vold 31allow sdcardd vold:fd use; 32allow sdcardd vold:fifo_file { read write getattr }; 33 34# Allow running on top of expanded storage 35allow sdcardd mnt_expand_file:dir search; 36 37# access /proc/filesystems 38allow 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 45neverallow init sdcardd_exec:file execute; 46neverallow init sdcardd:process { transition dyntransition }; 47