xref: /aosp_15_r20/system/sepolicy/prebuilts/api/29.0/public/vold.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker# volume manager
2*e4a36f41SAndroid Build Coastguard Workertype vold, domain;
3*e4a36f41SAndroid Build Coastguard Workertype vold_exec, exec_type, file_type, system_file_type;
4*e4a36f41SAndroid Build Coastguard Worker
5*e4a36f41SAndroid Build Coastguard Worker# Read already opened /cache files.
6*e4a36f41SAndroid Build Coastguard Workerallow vold cache_file:dir r_dir_perms;
7*e4a36f41SAndroid Build Coastguard Workerallow vold cache_file:file { getattr read };
8*e4a36f41SAndroid Build Coastguard Workerallow vold cache_file:lnk_file r_file_perms;
9*e4a36f41SAndroid Build Coastguard Worker
10*e4a36f41SAndroid Build Coastguard Workerr_dir_file(vold, { sysfs_type -sysfs_batteryinfo })
11*e4a36f41SAndroid Build Coastguard Worker# XXX Label sysfs files with a specific type?
12*e4a36f41SAndroid Build Coastguard Workerallow vold {
13*e4a36f41SAndroid Build Coastguard Worker  sysfs # writing to /sys/*/uevent during coldboot.
14*e4a36f41SAndroid Build Coastguard Worker  sysfs_devices_block
15*e4a36f41SAndroid Build Coastguard Worker  sysfs_dm
16*e4a36f41SAndroid Build Coastguard Worker  sysfs_loop # writing to /sys/block/loop*/uevent during coldboot.
17*e4a36f41SAndroid Build Coastguard Worker  sysfs_usb
18*e4a36f41SAndroid Build Coastguard Worker  sysfs_zram_uevent
19*e4a36f41SAndroid Build Coastguard Worker  sysfs_fs_f2fs
20*e4a36f41SAndroid Build Coastguard Worker}:file w_file_perms;
21*e4a36f41SAndroid Build Coastguard Worker
22*e4a36f41SAndroid Build Coastguard Workerr_dir_file(vold, rootfs)
23*e4a36f41SAndroid Build Coastguard Workerr_dir_file(vold, metadata_file)
24*e4a36f41SAndroid Build Coastguard Workerallow vold {
25*e4a36f41SAndroid Build Coastguard Worker  proc # b/67049235 processes /proc/<pid>/* files are mislabeled.
26*e4a36f41SAndroid Build Coastguard Worker  proc_cmdline
27*e4a36f41SAndroid Build Coastguard Worker  proc_drop_caches
28*e4a36f41SAndroid Build Coastguard Worker  proc_filesystems
29*e4a36f41SAndroid Build Coastguard Worker  proc_meminfo
30*e4a36f41SAndroid Build Coastguard Worker  proc_mounts
31*e4a36f41SAndroid Build Coastguard Worker}:file r_file_perms;
32*e4a36f41SAndroid Build Coastguard Worker
33*e4a36f41SAndroid Build Coastguard Worker#Get file contexts
34*e4a36f41SAndroid Build Coastguard Workerallow vold file_contexts_file:file r_file_perms;
35*e4a36f41SAndroid Build Coastguard Worker
36*e4a36f41SAndroid Build Coastguard Worker# Allow us to jump into execution domains of above tools
37*e4a36f41SAndroid Build Coastguard Workerallow vold self:process setexec;
38*e4a36f41SAndroid Build Coastguard Worker
39*e4a36f41SAndroid Build Coastguard Worker# For formatting adoptable storage devices
40*e4a36f41SAndroid Build Coastguard Workerallow vold e2fs_exec:file rx_file_perms;
41*e4a36f41SAndroid Build Coastguard Worker
42*e4a36f41SAndroid Build Coastguard Worker# Run fstrim on mounted partitions
43*e4a36f41SAndroid Build Coastguard Worker# allowxperm still requires the ioctl permission for the individual type
44*e4a36f41SAndroid Build Coastguard Workerallowxperm vold { fs_type file_type }:dir ioctl FITRIM;
45*e4a36f41SAndroid Build Coastguard Worker
46*e4a36f41SAndroid Build Coastguard Worker# Get encryption policy for dirs in /data
47*e4a36f41SAndroid Build Coastguard Workerallowxperm vold data_file_type:dir ioctl {
48*e4a36f41SAndroid Build Coastguard Worker  FS_IOC_GET_ENCRYPTION_POLICY
49*e4a36f41SAndroid Build Coastguard Worker  FS_IOC_SET_ENCRYPTION_POLICY
50*e4a36f41SAndroid Build Coastguard Worker};
51*e4a36f41SAndroid Build Coastguard Worker
52*e4a36f41SAndroid Build Coastguard Worker# Find the location on the raw block device where the
53*e4a36f41SAndroid Build Coastguard Worker# crypto key is stored so it can be destroyed
54*e4a36f41SAndroid Build Coastguard Workerallowxperm vold vold_data_file:file ioctl {
55*e4a36f41SAndroid Build Coastguard Worker  FS_IOC_FIEMAP
56*e4a36f41SAndroid Build Coastguard Worker};
57*e4a36f41SAndroid Build Coastguard Worker
58*e4a36f41SAndroid Build Coastguard Workertypeattribute vold mlstrustedsubject;
59*e4a36f41SAndroid Build Coastguard Workerallow vold self:process setfscreate;
60*e4a36f41SAndroid Build Coastguard Workerallow vold system_file:file x_file_perms;
61*e4a36f41SAndroid Build Coastguard Workernot_full_treble(`allow vold vendor_file:file x_file_perms;')
62*e4a36f41SAndroid Build Coastguard Workerallow vold block_device:dir create_dir_perms;
63*e4a36f41SAndroid Build Coastguard Workerallow vold device:dir write;
64*e4a36f41SAndroid Build Coastguard Workerallow vold devpts:chr_file rw_file_perms;
65*e4a36f41SAndroid Build Coastguard Workerallow vold rootfs:dir mounton;
66*e4a36f41SAndroid Build Coastguard Workerallow vold sdcard_type:dir mounton; # TODO: deprecated in M
67*e4a36f41SAndroid Build Coastguard Workerallow vold sdcard_type:filesystem { mount remount unmount }; # TODO: deprecated in M
68*e4a36f41SAndroid Build Coastguard Workerallow vold sdcard_type:dir create_dir_perms; # TODO: deprecated in M
69*e4a36f41SAndroid Build Coastguard Workerallow vold sdcard_type:file create_file_perms; # TODO: deprecated in M
70*e4a36f41SAndroid Build Coastguard Worker
71*e4a36f41SAndroid Build Coastguard Worker# Manage locations where storage is mounted
72*e4a36f41SAndroid Build Coastguard Workerallow vold { mnt_media_rw_file storage_file sdcard_type }:dir create_dir_perms;
73*e4a36f41SAndroid Build Coastguard Workerallow vold { mnt_media_rw_file storage_file sdcard_type }:file create_file_perms;
74*e4a36f41SAndroid Build Coastguard Worker
75*e4a36f41SAndroid Build Coastguard Worker# Access to storage that backs emulated FUSE daemons for migration optimization
76*e4a36f41SAndroid Build Coastguard Workerallow vold media_rw_data_file:dir create_dir_perms;
77*e4a36f41SAndroid Build Coastguard Workerallow vold media_rw_data_file:file create_file_perms;
78*e4a36f41SAndroid Build Coastguard Worker
79*e4a36f41SAndroid Build Coastguard Worker# Allow mounting of storage devices
80*e4a36f41SAndroid Build Coastguard Workerallow vold { mnt_media_rw_stub_file storage_stub_file }:dir { mounton create rmdir getattr setattr };
81*e4a36f41SAndroid Build Coastguard Worker
82*e4a36f41SAndroid Build Coastguard Worker# Manage per-user primary symlinks
83*e4a36f41SAndroid Build Coastguard Workerallow vold mnt_user_file:dir { create_dir_perms mounton };
84*e4a36f41SAndroid Build Coastguard Workerallow vold mnt_user_file:lnk_file create_file_perms;
85*e4a36f41SAndroid Build Coastguard Workerallow vold mnt_user_file:file create_file_perms;
86*e4a36f41SAndroid Build Coastguard Worker
87*e4a36f41SAndroid Build Coastguard Worker# Allow to create and mount expanded storage
88*e4a36f41SAndroid Build Coastguard Workerallow vold mnt_expand_file:dir { create_dir_perms mounton };
89*e4a36f41SAndroid Build Coastguard Workerallow vold apk_data_file:dir { create getattr setattr };
90*e4a36f41SAndroid Build Coastguard Workerallow vold shell_data_file:dir { create getattr setattr };
91*e4a36f41SAndroid Build Coastguard Worker
92*e4a36f41SAndroid Build Coastguard Workerallow vold tmpfs:filesystem { mount unmount };
93*e4a36f41SAndroid Build Coastguard Workerallow vold tmpfs:dir create_dir_perms;
94*e4a36f41SAndroid Build Coastguard Workerallow vold tmpfs:dir mounton;
95*e4a36f41SAndroid Build Coastguard Workerallow vold self:global_capability_class_set { net_admin dac_override dac_read_search mknod sys_admin chown fowner fsetid };
96*e4a36f41SAndroid Build Coastguard Workerallow vold self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
97*e4a36f41SAndroid Build Coastguard Workerallow vold loop_control_device:chr_file rw_file_perms;
98*e4a36f41SAndroid Build Coastguard Workerallow vold loop_device:blk_file { create setattr unlink rw_file_perms };
99*e4a36f41SAndroid Build Coastguard Workerallowxperm vold loop_device:blk_file ioctl {
100*e4a36f41SAndroid Build Coastguard Worker  LOOP_CLR_FD
101*e4a36f41SAndroid Build Coastguard Worker  LOOP_CTL_GET_FREE
102*e4a36f41SAndroid Build Coastguard Worker  LOOP_GET_STATUS64
103*e4a36f41SAndroid Build Coastguard Worker  LOOP_SET_FD
104*e4a36f41SAndroid Build Coastguard Worker  LOOP_SET_STATUS64
105*e4a36f41SAndroid Build Coastguard Worker};
106*e4a36f41SAndroid Build Coastguard Workerallow vold vold_device:blk_file { create setattr unlink rw_file_perms };
107*e4a36f41SAndroid Build Coastguard Workerallowxperm vold vold_device:blk_file ioctl { BLKDISCARD BLKGETSIZE };
108*e4a36f41SAndroid Build Coastguard Workerallow vold dm_device:chr_file rw_file_perms;
109*e4a36f41SAndroid Build Coastguard Workerallow vold dm_device:blk_file rw_file_perms;
110*e4a36f41SAndroid Build Coastguard Workerallowxperm vold dm_device:blk_file ioctl BLKSECDISCARD;
111*e4a36f41SAndroid Build Coastguard Worker# For vold Process::killProcessesWithOpenFiles function.
112*e4a36f41SAndroid Build Coastguard Workerallow vold domain:dir r_dir_perms;
113*e4a36f41SAndroid Build Coastguard Workerallow vold domain:{ file lnk_file } r_file_perms;
114*e4a36f41SAndroid Build Coastguard Workerallow vold domain:process { signal sigkill };
115*e4a36f41SAndroid Build Coastguard Workerallow vold self:global_capability_class_set { sys_ptrace kill };
116*e4a36f41SAndroid Build Coastguard Worker
117*e4a36f41SAndroid Build Coastguard Workerallow vold kmsg_device:chr_file rw_file_perms;
118*e4a36f41SAndroid Build Coastguard Worker
119*e4a36f41SAndroid Build Coastguard Worker# Run fsck in the fsck domain.
120*e4a36f41SAndroid Build Coastguard Workerallow vold fsck_exec:file { r_file_perms execute };
121*e4a36f41SAndroid Build Coastguard Worker
122*e4a36f41SAndroid Build Coastguard Worker# Log fsck results
123*e4a36f41SAndroid Build Coastguard Workerallow vold fscklogs:dir rw_dir_perms;
124*e4a36f41SAndroid Build Coastguard Workerallow vold fscklogs:file create_file_perms;
125*e4a36f41SAndroid Build Coastguard Worker
126*e4a36f41SAndroid Build Coastguard Worker#
127*e4a36f41SAndroid Build Coastguard Worker# Rules to support encrypted fs support.
128*e4a36f41SAndroid Build Coastguard Worker#
129*e4a36f41SAndroid Build Coastguard Worker
130*e4a36f41SAndroid Build Coastguard Worker# Unmount and mount the fs.
131*e4a36f41SAndroid Build Coastguard Workerallow vold labeledfs:filesystem { mount unmount remount };
132*e4a36f41SAndroid Build Coastguard Worker
133*e4a36f41SAndroid Build Coastguard Worker# Access /efs/userdata_footer.
134*e4a36f41SAndroid Build Coastguard Worker# XXX Split into a separate type?
135*e4a36f41SAndroid Build Coastguard Workerallow vold efs_file:file rw_file_perms;
136*e4a36f41SAndroid Build Coastguard Worker
137*e4a36f41SAndroid Build Coastguard Worker# Create and mount on /data/tmp_mnt and management of expansion mounts
138*e4a36f41SAndroid Build Coastguard Workerallow vold system_data_file:dir { create rw_dir_perms mounton setattr rmdir };
139*e4a36f41SAndroid Build Coastguard Workerallow vold system_data_file:lnk_file getattr;
140*e4a36f41SAndroid Build Coastguard Worker
141*e4a36f41SAndroid Build Coastguard Worker# Vold create users in /data/vendor_{ce,de}/[0-9]+
142*e4a36f41SAndroid Build Coastguard Workerallow vold vendor_data_file:dir create_dir_perms;
143*e4a36f41SAndroid Build Coastguard Worker
144*e4a36f41SAndroid Build Coastguard Worker# for secdiscard
145*e4a36f41SAndroid Build Coastguard Workerallow vold system_data_file:file read;
146*e4a36f41SAndroid Build Coastguard Worker
147*e4a36f41SAndroid Build Coastguard Worker# Set scheduling policy of kernel processes
148*e4a36f41SAndroid Build Coastguard Workerallow vold kernel:process setsched;
149*e4a36f41SAndroid Build Coastguard Worker
150*e4a36f41SAndroid Build Coastguard Worker# Property Service
151*e4a36f41SAndroid Build Coastguard Workerset_prop(vold, vold_prop)
152*e4a36f41SAndroid Build Coastguard Workerset_prop(vold, exported_vold_prop)
153*e4a36f41SAndroid Build Coastguard Workerset_prop(vold, exported2_vold_prop)
154*e4a36f41SAndroid Build Coastguard Workerset_prop(vold, powerctl_prop)
155*e4a36f41SAndroid Build Coastguard Workerset_prop(vold, ctl_fuse_prop)
156*e4a36f41SAndroid Build Coastguard Workerset_prop(vold, restorecon_prop)
157*e4a36f41SAndroid Build Coastguard Worker
158*e4a36f41SAndroid Build Coastguard Worker# ASEC
159*e4a36f41SAndroid Build Coastguard Workerallow vold asec_image_file:file create_file_perms;
160*e4a36f41SAndroid Build Coastguard Workerallow vold asec_image_file:dir rw_dir_perms;
161*e4a36f41SAndroid Build Coastguard Workerallow vold asec_apk_file:dir { create_dir_perms mounton relabelfrom relabelto };
162*e4a36f41SAndroid Build Coastguard Workerallow vold asec_public_file:dir { relabelto setattr };
163*e4a36f41SAndroid Build Coastguard Workerallow vold asec_apk_file:file { r_file_perms setattr relabelfrom relabelto };
164*e4a36f41SAndroid Build Coastguard Workerallow vold asec_public_file:file { relabelto setattr };
165*e4a36f41SAndroid Build Coastguard Worker# restorecon files in asec containers created on 4.2 or earlier.
166*e4a36f41SAndroid Build Coastguard Workerallow vold unlabeled:dir { r_dir_perms setattr relabelfrom };
167*e4a36f41SAndroid Build Coastguard Workerallow vold unlabeled:file { r_file_perms setattr relabelfrom };
168*e4a36f41SAndroid Build Coastguard Worker
169*e4a36f41SAndroid Build Coastguard Worker# Handle wake locks (used for device encryption)
170*e4a36f41SAndroid Build Coastguard Workerwakelock_use(vold)
171*e4a36f41SAndroid Build Coastguard Worker
172*e4a36f41SAndroid Build Coastguard Worker# Allow vold to publish a binder service and make binder calls.
173*e4a36f41SAndroid Build Coastguard Workerbinder_use(vold)
174*e4a36f41SAndroid Build Coastguard Workeradd_service(vold, vold_service)
175*e4a36f41SAndroid Build Coastguard Worker
176*e4a36f41SAndroid Build Coastguard Worker# Allow vold to call into the system server so it can check permissions.
177*e4a36f41SAndroid Build Coastguard Workerbinder_call(vold, system_server)
178*e4a36f41SAndroid Build Coastguard Workerallow vold permission_service:service_manager find;
179*e4a36f41SAndroid Build Coastguard Worker
180*e4a36f41SAndroid Build Coastguard Worker# talk to batteryservice
181*e4a36f41SAndroid Build Coastguard Workerbinder_call(vold, healthd)
182*e4a36f41SAndroid Build Coastguard Worker
183*e4a36f41SAndroid Build Coastguard Worker# talk to keymaster
184*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(vold, hal_keymaster)
185*e4a36f41SAndroid Build Coastguard Worker
186*e4a36f41SAndroid Build Coastguard Worker# talk to health storage HAL
187*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(vold, hal_health_storage)
188*e4a36f41SAndroid Build Coastguard Worker
189*e4a36f41SAndroid Build Coastguard Worker# talk to bootloader HAL
190*e4a36f41SAndroid Build Coastguard Workerfull_treble_only(`hal_client_domain(vold, hal_bootctl)')
191*e4a36f41SAndroid Build Coastguard Worker
192*e4a36f41SAndroid Build Coastguard Worker# Access userdata block device.
193*e4a36f41SAndroid Build Coastguard Workerallow vold userdata_block_device:blk_file rw_file_perms;
194*e4a36f41SAndroid Build Coastguard Workerallowxperm vold userdata_block_device:blk_file ioctl BLKSECDISCARD;
195*e4a36f41SAndroid Build Coastguard Worker
196*e4a36f41SAndroid Build Coastguard Worker# Access metadata block device used for encryption meta-data.
197*e4a36f41SAndroid Build Coastguard Workerallow vold metadata_block_device:blk_file rw_file_perms;
198*e4a36f41SAndroid Build Coastguard Worker
199*e4a36f41SAndroid Build Coastguard Worker# Allow vold to manipulate /data/unencrypted
200*e4a36f41SAndroid Build Coastguard Workerallow vold unencrypted_data_file:{ file } create_file_perms;
201*e4a36f41SAndroid Build Coastguard Workerallow vold unencrypted_data_file:dir create_dir_perms;
202*e4a36f41SAndroid Build Coastguard Worker
203*e4a36f41SAndroid Build Coastguard Worker# Write to /proc/sys/vm/drop_caches
204*e4a36f41SAndroid Build Coastguard Workerallow vold proc_drop_caches:file w_file_perms;
205*e4a36f41SAndroid Build Coastguard Worker
206*e4a36f41SAndroid Build Coastguard Worker# Give vold a place where only vold can store files; everyone else is off limits
207*e4a36f41SAndroid Build Coastguard Workerallow vold vold_data_file:dir create_dir_perms;
208*e4a36f41SAndroid Build Coastguard Workerallow vold vold_data_file:file create_file_perms;
209*e4a36f41SAndroid Build Coastguard Worker
210*e4a36f41SAndroid Build Coastguard Worker# And a similar place in the metadata partition
211*e4a36f41SAndroid Build Coastguard Workerallow vold vold_metadata_file:dir create_dir_perms;
212*e4a36f41SAndroid Build Coastguard Workerallow vold vold_metadata_file:file create_file_perms;
213*e4a36f41SAndroid Build Coastguard Worker
214*e4a36f41SAndroid Build Coastguard Worker# linux keyring configuration
215*e4a36f41SAndroid Build Coastguard Workerallow vold init:key { write search setattr };
216*e4a36f41SAndroid Build Coastguard Workerallow vold vold:key { write search setattr };
217*e4a36f41SAndroid Build Coastguard Worker
218*e4a36f41SAndroid Build Coastguard Worker# vold temporarily changes its priority when running benchmarks
219*e4a36f41SAndroid Build Coastguard Workerallow vold self:global_capability_class_set sys_nice;
220*e4a36f41SAndroid Build Coastguard Worker
221*e4a36f41SAndroid Build Coastguard Worker# vold needs to chroot into app namespaces to remount when runtime permissions change
222*e4a36f41SAndroid Build Coastguard Workerallow vold self:global_capability_class_set sys_chroot;
223*e4a36f41SAndroid Build Coastguard Workerallow vold storage_file:dir mounton;
224*e4a36f41SAndroid Build Coastguard Worker
225*e4a36f41SAndroid Build Coastguard Worker# For AppFuse.
226*e4a36f41SAndroid Build Coastguard Workerallow vold fuse_device:chr_file rw_file_perms;
227*e4a36f41SAndroid Build Coastguard Workerallow vold fuse:filesystem { relabelfrom };
228*e4a36f41SAndroid Build Coastguard Workerallow vold app_fusefs:filesystem { relabelfrom relabelto };
229*e4a36f41SAndroid Build Coastguard Workerallow vold app_fusefs:filesystem { mount unmount };
230*e4a36f41SAndroid Build Coastguard Workerallow vold app_fuse_file:dir rw_dir_perms;
231*e4a36f41SAndroid Build Coastguard Workerallow vold app_fuse_file:file { read write open getattr append };
232*e4a36f41SAndroid Build Coastguard Worker
233*e4a36f41SAndroid Build Coastguard Worker# MoveTask.cpp executes cp and rm
234*e4a36f41SAndroid Build Coastguard Workerallow vold toolbox_exec:file rx_file_perms;
235*e4a36f41SAndroid Build Coastguard Worker
236*e4a36f41SAndroid Build Coastguard Worker# Prepare profile dir for users.
237*e4a36f41SAndroid Build Coastguard Workerallow vold user_profile_data_file:dir create_dir_perms;
238*e4a36f41SAndroid Build Coastguard Worker
239*e4a36f41SAndroid Build Coastguard Worker# Raw writes to misc block device
240*e4a36f41SAndroid Build Coastguard Workerallow vold misc_block_device:blk_file w_file_perms;
241*e4a36f41SAndroid Build Coastguard Worker
242*e4a36f41SAndroid Build Coastguard Worker# vold might need to search or mount /mnt/vendor/*
243*e4a36f41SAndroid Build Coastguard Workerallow vold mnt_vendor_file:dir search;
244*e4a36f41SAndroid Build Coastguard Worker
245*e4a36f41SAndroid Build Coastguard Workerdontaudit vold self:global_capability_class_set sys_resource;
246*e4a36f41SAndroid Build Coastguard Worker
247*e4a36f41SAndroid Build Coastguard Worker# vold needs to know whether we're running a GSI.
248*e4a36f41SAndroid Build Coastguard Workerallow vold gsi_metadata_file:dir r_dir_perms;
249*e4a36f41SAndroid Build Coastguard Workerallow vold gsi_metadata_file:file r_file_perms;
250*e4a36f41SAndroid Build Coastguard Worker
251*e4a36f41SAndroid Build Coastguard Workerneverallow {
252*e4a36f41SAndroid Build Coastguard Worker    domain
253*e4a36f41SAndroid Build Coastguard Worker    -vold
254*e4a36f41SAndroid Build Coastguard Worker    -vold_prepare_subdirs
255*e4a36f41SAndroid Build Coastguard Worker} vold_data_file:dir ~{ open create read getattr setattr search relabelfrom relabelto ioctl };
256*e4a36f41SAndroid Build Coastguard Worker
257*e4a36f41SAndroid Build Coastguard Workerneverallow {
258*e4a36f41SAndroid Build Coastguard Worker    domain
259*e4a36f41SAndroid Build Coastguard Worker    -init
260*e4a36f41SAndroid Build Coastguard Worker    -vold
261*e4a36f41SAndroid Build Coastguard Worker    -vold_prepare_subdirs
262*e4a36f41SAndroid Build Coastguard Worker} vold_data_file:dir *;
263*e4a36f41SAndroid Build Coastguard Worker
264*e4a36f41SAndroid Build Coastguard Workerneverallow {
265*e4a36f41SAndroid Build Coastguard Worker    domain
266*e4a36f41SAndroid Build Coastguard Worker    -init
267*e4a36f41SAndroid Build Coastguard Worker    -vold
268*e4a36f41SAndroid Build Coastguard Worker} vold_metadata_file:dir *;
269*e4a36f41SAndroid Build Coastguard Worker
270*e4a36f41SAndroid Build Coastguard Workerneverallow {
271*e4a36f41SAndroid Build Coastguard Worker    domain
272*e4a36f41SAndroid Build Coastguard Worker    -kernel
273*e4a36f41SAndroid Build Coastguard Worker    -vold
274*e4a36f41SAndroid Build Coastguard Worker    -vold_prepare_subdirs
275*e4a36f41SAndroid Build Coastguard Worker} vold_data_file:notdevfile_class_set ~{ relabelto getattr };
276*e4a36f41SAndroid Build Coastguard Worker
277*e4a36f41SAndroid Build Coastguard Workerneverallow {
278*e4a36f41SAndroid Build Coastguard Worker    domain
279*e4a36f41SAndroid Build Coastguard Worker    -init
280*e4a36f41SAndroid Build Coastguard Worker    -vold
281*e4a36f41SAndroid Build Coastguard Worker    -vold_prepare_subdirs
282*e4a36f41SAndroid Build Coastguard Worker} vold_metadata_file:notdevfile_class_set ~{ relabelto getattr };
283*e4a36f41SAndroid Build Coastguard Worker
284*e4a36f41SAndroid Build Coastguard Workerneverallow {
285*e4a36f41SAndroid Build Coastguard Worker    domain
286*e4a36f41SAndroid Build Coastguard Worker    -init
287*e4a36f41SAndroid Build Coastguard Worker    -kernel
288*e4a36f41SAndroid Build Coastguard Worker    -vold
289*e4a36f41SAndroid Build Coastguard Worker    -vold_prepare_subdirs
290*e4a36f41SAndroid Build Coastguard Worker} { vold_data_file vold_metadata_file }:notdevfile_class_set *;
291*e4a36f41SAndroid Build Coastguard Worker
292*e4a36f41SAndroid Build Coastguard Workerneverallow { domain -vold -init } restorecon_prop:property_service set;
293*e4a36f41SAndroid Build Coastguard Worker
294*e4a36f41SAndroid Build Coastguard Workerneverallow {
295*e4a36f41SAndroid Build Coastguard Worker    domain
296*e4a36f41SAndroid Build Coastguard Worker    -system_server
297*e4a36f41SAndroid Build Coastguard Worker    -vdc
298*e4a36f41SAndroid Build Coastguard Worker    -vold
299*e4a36f41SAndroid Build Coastguard Worker    -update_verifier
300*e4a36f41SAndroid Build Coastguard Worker    -apexd
301*e4a36f41SAndroid Build Coastguard Worker} vold_service:service_manager find;
302*e4a36f41SAndroid Build Coastguard Worker
303*e4a36f41SAndroid Build Coastguard Workerneverallow vold {
304*e4a36f41SAndroid Build Coastguard Worker  domain
305*e4a36f41SAndroid Build Coastguard Worker  -ashmemd
306*e4a36f41SAndroid Build Coastguard Worker  -hal_health_storage_server
307*e4a36f41SAndroid Build Coastguard Worker  -hal_keymaster_server
308*e4a36f41SAndroid Build Coastguard Worker  -system_suspend_server
309*e4a36f41SAndroid Build Coastguard Worker  -hal_bootctl_server
310*e4a36f41SAndroid Build Coastguard Worker  -healthd
311*e4a36f41SAndroid Build Coastguard Worker  -hwservicemanager
312*e4a36f41SAndroid Build Coastguard Worker  -iorapd_service
313*e4a36f41SAndroid Build Coastguard Worker  -servicemanager
314*e4a36f41SAndroid Build Coastguard Worker  -system_server
315*e4a36f41SAndroid Build Coastguard Worker  userdebug_or_eng(`-su')
316*e4a36f41SAndroid Build Coastguard Worker}:binder call;
317*e4a36f41SAndroid Build Coastguard Worker
318*e4a36f41SAndroid Build Coastguard Workerneverallow vold fsck_exec:file execute_no_trans;
319*e4a36f41SAndroid Build Coastguard Workerneverallow { domain -init } vold:process { transition dyntransition };
320*e4a36f41SAndroid Build Coastguard Workerneverallow vold *:process ptrace;
321*e4a36f41SAndroid Build Coastguard Workerneverallow vold *:rawip_socket *;
322