blob: e6a23705defbf5e5c9f5449b5d360d00287ef042 [file] [log] [blame]
Paul Crowley5b962cf2017-10-13 14:54:32 -07001domain_auto_trans(vold, vold_prepare_subdirs_exec, vold_prepare_subdirs)
Jin Qianc0125332017-10-19 14:41:37 -07002
Alan Stokesfc0cab82020-02-11 14:43:05 +00003typeattribute vold_prepare_subdirs mlstrustedsubject;
4
Paul Crowley5850a2a2017-10-25 13:03:24 -07005allow vold_prepare_subdirs system_file:file execute_no_trans;
6allow vold_prepare_subdirs shell_exec:file rx_file_perms;
7allow vold_prepare_subdirs toolbox_exec:file rx_file_perms;
8allow vold_prepare_subdirs devpts:chr_file rw_file_perms;
9allow vold_prepare_subdirs vold:fd use;
10allow vold_prepare_subdirs vold:fifo_file { read write };
11allow vold_prepare_subdirs file_contexts_file:file r_file_perms;
Benjamin Gordon342362a2018-09-06 16:19:40 -060012allow vold_prepare_subdirs self:global_capability_class_set { chown dac_override dac_read_search fowner };
Paul Crowley5850a2a2017-10-25 13:03:24 -070013allow vold_prepare_subdirs self:process setfscreate;
Jeff Vander Stoepd25ccab2018-02-07 16:29:06 -080014allow vold_prepare_subdirs {
15 system_data_file
16 vendor_data_file
Joel Galenson254a8722018-04-16 14:50:38 -070017}:dir { open read write add_name remove_name rmdir relabelfrom };
Paul Crowley80966392018-04-26 13:41:13 -070018allow vold_prepare_subdirs {
Alan Stokesfa10a142021-07-12 14:21:48 +010019 apex_data_file_type
Oli Lan79b4e1a2019-11-19 18:10:16 +000020 apex_module_data_file
Oli Lan91ce5b92019-12-02 18:29:48 +000021 apex_rollback_data_file
Annie Meng4c3d11c2019-01-15 21:20:13 +000022 backup_data_file
Tianjieb729aa62021-10-05 22:13:20 -070023 checkin_data_file
Kevin Chyn91c25802018-11-15 15:28:07 -080024 face_vendor_data_file
Nick Kralevich83f25e22018-11-19 18:42:11 +000025 fingerprint_vendor_data_file
Kevin Chyn91c25802018-11-15 15:28:07 -080026 iris_vendor_data_file
Narayan Kamath2ad229c2019-01-14 15:02:12 +000027 rollback_data_file
Paul Crowley80966392018-04-26 13:41:13 -070028 storaged_data_file
Samiul Islam6a6ab832022-02-18 10:34:27 +000029 supplemental_app_data_file
Alan Stokesfc0cab82020-02-11 14:43:05 +000030 system_data_file
Paul Crowley80966392018-04-26 13:41:13 -070031 vold_data_file
32}:dir { create_dir_perms relabelto };
33allow vold_prepare_subdirs {
Alan Stokesfa10a142021-07-12 14:21:48 +010034 apex_data_file_type
Orion Hodson8f75f762020-10-16 15:29:55 +010035 apex_art_staging_data_file
Oli Lan79b4e1a2019-11-19 18:10:16 +000036 apex_module_data_file
Oli Lan91ce5b92019-12-02 18:29:48 +000037 apex_rollback_data_file
Annie Meng4c3d11c2019-01-15 21:20:13 +000038 backup_data_file
Tianjieb729aa62021-10-05 22:13:20 -070039 checkin_data_file
Kevin Chyn91c25802018-11-15 15:28:07 -080040 face_vendor_data_file
Nick Kralevich83f25e22018-11-19 18:42:11 +000041 fingerprint_vendor_data_file
Kevin Chyn91c25802018-11-15 15:28:07 -080042 iris_vendor_data_file
Narayan Kamath2ad229c2019-01-14 15:02:12 +000043 rollback_data_file
Paul Crowley80966392018-04-26 13:41:13 -070044 storaged_data_file
Samiul Islam6a6ab832022-02-18 10:34:27 +000045 supplemental_app_data_file
Paul Crowley80966392018-04-26 13:41:13 -070046 system_data_file
47 vold_data_file
48}:file { getattr unlink };
Oli Lan79b4e1a2019-11-19 18:10:16 +000049allow vold_prepare_subdirs apex_mnt_dir:dir { open read };
Alan Stokesfc0cab82020-02-11 14:43:05 +000050allow vold_prepare_subdirs mnt_expand_file:dir search;
Alan Stokes7aa40412020-12-04 14:07:52 +000051allow vold_prepare_subdirs user_profile_data_file:dir { search getattr relabelfrom };
52allow vold_prepare_subdirs user_profile_root_file:dir { search getattr relabelfrom relabelto };
Alan Stokes53c76a22022-02-08 15:44:06 +000053
54# Migrate legacy labels to apex_system_server_data_file (b/217581286)
55allow vold_prepare_subdirs {
56 apex_appsearch_data_file
57 apex_permission_data_file
58 apex_scheduling_data_file
59 apex_wifi_data_file
60}:dir relabelfrom;
61
Alan Stokesfc0cab82020-02-11 14:43:05 +000062# /data/misc is unlabeled during early boot.
63allow vold_prepare_subdirs unlabeled:dir search;
Joel Galenson5d5ac9a2019-05-09 10:43:59 -070064
65dontaudit vold_prepare_subdirs { proc unlabeled }:file r_file_perms;