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