blob: 98fbd357c4348d891dde7c467077fc6b45a76b42 [file] [log] [blame]
Nick Kralevich929da012017-02-16 12:04:40 -08001# /proc/config.gz
Tri Vo41bf08e2018-02-15 18:07:18 -08002type config_gz, fs_type, proc_type;
Dan Cashman91d398d2017-09-26 12:58:29 -07003
Maciej Żenczykowskib13921c2022-05-21 05:03:29 -07004# /sys/fs/bpf/<dir> for mainline tethering use
5# TODO: move S+ fs_bpf_tethering here from public/file.te
6type fs_bpf_net_private, fs_type, bpffs_type;
7type fs_bpf_net_shared, fs_type, bpffs_type;
8type fs_bpf_netd_readonly, fs_type, bpffs_type;
9type fs_bpf_netd_shared, fs_type, bpffs_type;
Maciej Żenczykowskie14e69a2022-12-01 14:45:35 +000010type fs_bpf_loader, fs_type, bpffs_type;
Yu-Ting Tsengbaea6412024-01-16 14:02:59 -080011type fs_bpf_uprobestats, fs_type, bpffs_type;
Carlos Galo63880c52024-09-04 16:14:54 +000012type fs_bpf_memevents, fs_type, bpffs_type;
Maciej Żenczykowskib13921c2022-05-21 05:03:29 -070013
Dan Cashman91d398d2017-09-26 12:58:29 -070014# /data/misc/storaged
15type storaged_data_file, file_type, data_file_type, core_data_file_type;
Vishnu Nair2d6942d2017-11-17 08:23:32 -080016
17# /data/misc/wmtrace for wm traces
Hongwei Wang93720262023-01-20 12:14:31 -080018type wm_trace_data_file, file_type, data_file_type, core_data_file_type, mlstrustedobject;
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000019
Hongming Jin58f83412021-02-09 12:03:40 -080020# /data/misc/a11ytrace for accessibility traces
21type accessibility_trace_data_file, file_type, data_file_type, core_data_file_type;
22
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000023# /data/misc/perfetto-traces for perfetto traces
24type perfetto_traces_data_file, file_type, data_file_type, core_data_file_type;
Dan Austin55d90962018-11-29 10:37:18 -080025
Primiano Tucci2f998092021-01-07 17:12:21 +000026# /data/misc/perfetto-traces/bugreport for perfetto traces for bugreports.
27type perfetto_traces_bugreport_data_file, file_type, data_file_type, core_data_file_type;
28
Yisroel Fortac5cb5a22024-02-15 20:16:46 +000029# /data/misc/perfetto-traces/profiling for perfetto traces from profiling apis.
30type perfetto_traces_profiling_data_file, file_type, data_file_type, core_data_file_type;
31
Primiano Tucci512bdb92020-10-13 21:13:09 +010032# /data/misc/perfetto-configs for perfetto configs
33type perfetto_configs_data_file, file_type, data_file_type, core_data_file_type;
34
Daniele Di Proietto9a997592024-02-16 17:51:49 +000035# /system/etc/perfetto for perfetto configs
36type system_perfetto_config_file, file_type, system_file_type;
37
Yu-Ting Tseng43cae4e2023-12-15 00:48:23 +000038# /data/misc/uprobestats-configs for uprobestats configs
39type uprobestats_configs_data_file, file_type, data_file_type, core_data_file_type;
40
Yu-Ting Tseng7dea3a32024-07-10 01:48:59 +000041# /apex/com.android.art/bin/oatdump
Yu-Ting Tseng46e40492024-07-09 19:03:39 -070042# TODO (b/350628688): Remove this once it's safe to do so.
Yu-Ting Tseng7dea3a32024-07-10 01:48:59 +000043type oatdump_exec, system_file_type, exec_type, file_type;
44
Mohammad Samiul Islamd2ffd352022-05-11 21:43:54 +010045# /data/misc_{ce/de}/<user>/sdksandbox root data directory for sdk sandbox processes
46type sdk_sandbox_system_data_file, file_type, data_file_type, core_data_file_type;
Bram Bonneb93f26f2022-03-15 18:28:02 +010047# /data/misc_{ce/de}/<user>/sdksandbox/<app-name>/* subdirectory for sdk sandbox processes
48type sdk_sandbox_data_file, file_type, data_file_type, core_data_file_type, app_data_file_type;
49
Dan Austin55d90962018-11-29 10:37:18 -080050# /sys/kernel/debug/kcov for coverage guided kernel fuzzing in userdebug builds.
51type debugfs_kcov, fs_type, debugfs_type;
52
Nick Kralevichfb66c6f2019-01-11 09:37:46 -080053# App executable files in /data/data directories
54type app_exec_data_file, file_type, data_file_type, core_data_file_type;
55typealias app_exec_data_file alias rs_data_file;
Narayan Kamath2ad229c2019-01-14 15:02:12 +000056
57# /data/misc_[ce|de]/rollback : Used by installd to store snapshots
58# of application data.
59type rollback_data_file, file_type, data_file_type, core_data_file_type;
Kiyoung Kimaffa6f32019-07-08 19:02:05 +090060
Tianjieb729aa62021-10-05 22:13:20 -070061# /data/misc_ce/checkin for checkin apps.
62type checkin_data_file, file_type, data_file_type, core_data_file_type;
63
Yifan Hong07a99e12019-08-07 13:01:15 -070064# /data/gsi/ota
65type ota_image_data_file, file_type, data_file_type, core_data_file_type;
Shuo Qian9322cb02019-10-15 13:13:56 -070066
Howard Chen55665d62020-12-25 17:32:13 +080067# /data/gsi_persistent_data
68type gsi_persistent_data_file, file_type, data_file_type, core_data_file_type;
69
Shuo Qian9322cb02019-10-15 13:13:56 -070070# /data/misc/emergencynumberdb
71type emergency_data_file, file_type, data_file_type, core_data_file_type;
Yi Kong239c85d2020-06-18 12:43:23 +080072
73# /data/misc/profcollectd
74type profcollectd_data_file, file_type, data_file_type, core_data_file_type;
Orion Hodson8f75f762020-10-16 15:29:55 +010075
76# /data/misc/apexdata/com.android.art
Alan Stokesfa10a142021-07-12 14:21:48 +010077type apex_art_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
Orion Hodson8f75f762020-10-16 15:29:55 +010078
79# /data/misc/apexdata/com.android.art/staging
80type apex_art_staging_data_file, file_type, data_file_type, core_data_file_type;
Seigo Nonaka9c3707f2021-01-21 13:08:31 -080081
Alan Stokes10fbf232021-07-12 15:12:37 +010082# /data/misc/apexdata/com.android.compos
83type apex_compos_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
84
Alice Wang40519f72023-08-31 11:37:30 +000085# /data/misc/apexdata/com.android.virt
86type apex_virt_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
87
Kangping Donge21496b2024-01-02 15:10:27 +080088# /data/misc/apexdata/com.android.tethering
89type apex_tethering_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
90
Nattharat Jariyanuntanaetdd2e2ba2024-05-15 08:16:16 +000091# /data/misc/apexdata/com.android.uwb
92type apex_uwb_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
93
Alan Stokes53c76a22022-02-08 15:44:06 +000094# legacy labels for various /data/misc[_ce|_de]/*/apexdata directories - retained
95# for backward compatibility b/217581286
96type apex_appsearch_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
97type apex_permission_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
98type apex_scheduling_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
99type apex_wifi_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
100
Seigo Nonaka9c3707f2021-01-21 13:08:31 -0800101# /data/font/files
102type font_data_file, file_type, data_file_type, core_data_file_type;
Martijn Coenen6afdb722020-11-27 12:23:54 +0100103
Alexander Potapenko0a64d102022-01-28 19:48:27 +0100104# /data/misc/dmesgd
105type dmesgd_data_file, file_type, data_file_type, core_data_file_type;
106
Orion Hodson7c6b3eb2021-04-09 15:17:38 +0100107# /data/misc/odrefresh
108type odrefresh_data_file, file_type, data_file_type, core_data_file_type;
109
Martijn Coenen6afdb722020-11-27 12:23:54 +0100110# /data/misc/odsign
111type odsign_data_file, file_type, data_file_type, core_data_file_type;
satayevafc97912021-03-19 11:08:49 +0000112
Shikha Panwar36daf982022-02-24 11:50:35 +0000113# /data/misc/odsign_metrics
114type odsign_metrics_file, file_type, data_file_type, core_data_file_type;
115
Andrew Walbran654c5b02021-05-19 17:10:43 +0000116# /data/misc/virtualizationservice
David Brazdil55d808c2022-12-15 13:38:42 +0000117# The type needs to be mlstrustedobject to allow for being accessed from
118# virtualizationmanager, which runs at a more constrained MLS level.
119type virtualizationservice_data_file, file_type, data_file_type, core_data_file_type, mlstrustedobject;
Andrew Walbran654c5b02021-05-19 17:10:43 +0000120
Inseob Kim0b9625d2024-07-31 17:42:23 +0900121# /mnt/vm
122type vm_data_file, file_type, core_data_file_type;
123
satayevafc97912021-03-19 11:08:49 +0000124# /data/system/environ
125type environ_system_data_file, file_type, data_file_type, core_data_file_type;
Andrew Walbrana995e842021-03-29 17:19:12 +0000126
Lee George Thomas407e1cf2023-07-25 15:02:33 -0700127# /data/misc/bootanim
Josh Yang1d967dd2021-12-23 14:37:41 -0800128type bootanim_data_file, file_type, data_file_type, core_data_file_type;
129
Andrew Walbrana995e842021-03-29 17:19:12 +0000130# /dev/kvm
David Brazdil55d808c2022-12-15 13:38:42 +0000131# The type needs to be mlstrustedobject to allow for being accessed from
132# crosvm, which runs at a more constrained MLS level.
Elliot Bermanae5869a2023-03-22 17:31:35 -0700133type kvm_device, dev_type, mlstrustedobject, vm_manager_device_type;
Alan Stokesec4a90f2021-09-21 13:32:24 +0100134
135# /apex/com.android.virt/bin/fd_server
136type fd_server_exec, system_file_type, exec_type, file_type;
Jeff Vander Stoep5aa5e5e2021-11-17 08:51:11 +0100137
Alan Stokes766caba2022-02-14 14:33:37 +0000138# /apex/com.android.compos/bin/compsvc
139type compos_exec, exec_type, file_type, system_file_type;
140# /apex/com.android.compos/bin/compos_key_helper
141type compos_key_helper_exec, exec_type, file_type, system_file_type;
142
Pete Bentleye6da3b82022-09-16 15:31:39 +0100143# Filesystem entry for for PRNG seeder socket. Processes require
144# write permission on this to connect, and needs to be mlstrustedobject
145# in to satisfy MLS constraints for trusted domains.
146type prng_seeder_socket, file_type, coredomain_socket, mlstrustedobject;
Jaewan Kim93f57882023-02-07 01:49:24 +0900147
Jaewan Kim2141ad52024-01-31 05:56:43 +0000148# /proc/device-tree/avf and /sys/firmware/devicetree/base/avf
Jaewan Kim93f57882023-02-07 01:49:24 +0900149type sysfs_dt_avf, fs_type, sysfs_type;
Jaewan Kim2141ad52024-01-31 05:56:43 +0000150type proc_dt_avf, fs_type, proc_type;
Seigo Nonakad570a5c2023-07-21 14:29:24 +0900151
152# Type for /system/fonts/font_fallback.xm
153type system_font_fallback_file, system_file_type, file_type;
Yu-Ting Tseng3e8e8ea2023-09-25 18:42:03 +0000154
155# Type for /sys/devices/uprobe.
156type sysfs_uprobe, fs_type, sysfs_type;
Dennis Shen26592572024-02-25 15:44:51 +0000157
158# Type for aconfig daemon socket
Ted Bauerffa04932024-10-04 20:32:36 +0000159type aconfigd_socket, file_type, coredomain_socket, mlstrustedobject;
Dennis Shenf008c292024-02-28 18:08:10 +0000160
161# Type for /(system|system_ext|product)/etc/aconfig
162type system_aconfig_storage_file, system_file_type, file_type;
163
164# Type for /vendor/etc/aconfig
165type vendor_aconfig_storage_file, vendor_file_type, file_type;
Hansen Kurli0e638112023-12-14 16:30:26 +0800166
Ted Bauer86405532024-04-03 18:16:23 +0000167type aconfig_test_mission_files, file_type;
168
Hansen Kurli0e638112023-12-14 16:30:26 +0800169# /data/misc/connectivityblobdb
170type connectivityblob_data_file, file_type, data_file_type, core_data_file_type;
Jiakai Zhang4acd0732024-03-20 11:24:54 +0000171
172# Type for /mnt/pre_reboot_dexopt
173type pre_reboot_dexopt_file, file_type;
174
175# Type for /mnt/artd_tmp in the Pre-reboot Dexopt chroot
176# This type is set on the directory through the `rootcontext=` mount option.
177type pre_reboot_dexopt_artd_file, file_type;
Inseob Kim75806ef2024-03-27 17:18:41 +0900178
William Loh38b57bc2024-04-24 22:31:06 +0000179# /data/app-metadata - extracted app metadata bundles from APKs
180type apk_metadata_file, file_type, data_file_type, core_data_file_type;
181
Kalesh Singh3a4c68d2024-04-09 16:24:48 -0700182# Type for /sys/kernel/mm/pgsize_migration/enabled
183type sysfs_pgsize_migration, fs_type, sysfs_type;
184
Rob Barnes8afcd7b2024-09-18 00:59:51 +0000185# /sys/firmware/acpi/tables
186type sysfs_firmware_acpi_tables, fs_type, sysfs_type;
187
Inseob Kim75806ef2024-03-27 17:18:41 +0900188# Allow files to be created in their appropriate filesystems.
189allow fs_type self:filesystem associate;
190allow cgroup tmpfs:filesystem associate;
191allow cgroup_v2 tmpfs:filesystem associate;
192allow cgroup_rc_file tmpfs:filesystem associate;
193allow sysfs_type sysfs:filesystem associate;
194allow debugfs_type { debugfs debugfs_tracing debugfs_tracing_debug }:filesystem associate;
195allow file_type labeledfs:filesystem associate;
196allow file_type tmpfs:filesystem associate;
197allow file_type rootfs:filesystem associate;
198allow dev_type tmpfs:filesystem associate;
199allow app_fuse_file app_fusefs:filesystem associate;
200allow postinstall_file self:filesystem associate;
201allow proc_net proc:filesystem associate;
202
203# It's a bug to assign the file_type attribute and fs_type attribute
204# to any type. Do not allow it.
205#
206# For example, the following is a bug:
207# type apk_data_file, file_type, data_file_type, fs_type;
208# Should be:
209# type apk_data_file, file_type, data_file_type;
210neverallow fs_type file_type:filesystem associate;
Ellen Arteca27b515e2024-04-30 20:26:55 +0000211# app directories of storage areas: /data/storage_area/userId/pkgName -- apps cannot write to it
212type storage_area_app_dir, file_type, data_file_type, core_data_file_type, app_data_file_type;
213# app storage areas: /data/storage_area/userId/pkgName/storageAreaName
214type storage_area_dir, file_type, data_file_type, core_data_file_type, app_data_file_type;
215# contents of app storage areas: /data/storage_area/userId/pkgName/storageAreaName/*
216type storage_area_content_file, file_type, data_file_type, core_data_file_type, app_data_file_type;
217
218# /data/misc_ce/userId/storage_area_keys
Nattharat Jariyanuntanaetdd2e2ba2024-05-15 08:16:16 +0000219type storage_area_key_file, file_type, data_file_type, core_data_file_type;
Vadim Caen1d81f872024-08-19 15:08:35 +0200220
David Anderson2f31d932024-10-02 20:22:17 -0700221# /metadata/tradeinmode files
222type tradeinmode_metadata_file, file_type;
Vadim Caen1d81f872024-08-19 15:08:35 +0200223
224# Types added in 202504 in public/file.te
225until_board_api(202504, `
226 type binderfs_logs_transactions, fs_type;
227 type binderfs_logs_transaction_history, fs_type;
228')
229
230until_board_api(202504, `
231 type proc_cgroups, fs_type, proc_type;
232')
233
234until_board_api(202504, `
235 type sysfs_udc, fs_type, sysfs_type;
236')
237
238until_board_api(202504, `
239 type fs_bpf_lmkd_memevents_rb, fs_type, bpffs_type;
240 type fs_bpf_lmkd_memevents_prog, fs_type, bpffs_type;
241')
242
243until_board_api(202504, `
244 # boot otas for 16KB developer option
245 type vendor_boot_ota_file, vendor_file_type, file_type;
246')
Nikita Ioffe48966b62024-10-22 14:01:17 +0000247
248until_board_api(202504, `
249 type tee_service_contexts_file, system_file_type, file_type;
250')
251
Vadim Caen1d81f872024-08-19 15:08:35 +0200252## END Types added in 202504 in public/file.te
253