1type sdcardd, domain; 2type sdcardd_exec, exec_type, file_type; 3 4allow sdcardd cgroup:dir create_dir_perms; 5allow sdcardd fuse_device:chr_file rw_file_perms; 6allow sdcardd rootfs:dir mounton; # TODO: deprecated in M 7allow sdcardd mnt_media_rw_file:dir r_dir_perms; 8allow sdcardd storage_file:dir search; 9allow sdcardd storage_stub_file:dir { search mounton }; 10allow sdcardd sdcard_type:filesystem { mount unmount }; 11allow sdcardd self:capability { setuid setgid dac_override sys_admin sys_resource }; 12 13allow sdcardd sdcard_type:dir create_dir_perms; 14allow sdcardd sdcard_type:file create_file_perms; 15 16type_transition sdcardd system_data_file:{ dir file } media_rw_data_file; 17allow sdcardd media_rw_data_file:dir create_dir_perms; 18allow sdcardd media_rw_data_file:file create_file_perms; 19 20# Read /data/system/packages.list. 21allow sdcardd system_data_file:file r_file_perms; 22 23# Read /data/.layout_version 24allow sdcardd install_data_file:file r_file_perms; 25 26# Allow stdin/out back to vold 27allow sdcardd vold:fd use; 28allow sdcardd vold:fifo_file { read write getattr }; 29 30# Allow running on top of expanded storage 31allow sdcardd mnt_expand_file:dir search; 32 33### 34### neverallow rules 35### 36 37# The sdcard daemon should no longer be started from init 38neverallow init sdcardd_exec:file execute; 39neverallow init sdcardd:process { transition dyntransition }; 40