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