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