blob: d30465b3689192d4beed30e2ee1496c706b1f519 [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;
Maciej Żenczykowskib13921c2022-05-21 05:03:29 -070012
Dan Cashman91d398d2017-09-26 12:58:29 -070013# /data/misc/storaged
14type storaged_data_file, file_type, data_file_type, core_data_file_type;
Vishnu Nair2d6942d2017-11-17 08:23:32 -080015
16# /data/misc/wmtrace for wm traces
Hongwei Wang93720262023-01-20 12:14:31 -080017type wm_trace_data_file, file_type, data_file_type, core_data_file_type, mlstrustedobject;
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000018
Hongming Jin58f83412021-02-09 12:03:40 -080019# /data/misc/a11ytrace for accessibility traces
20type accessibility_trace_data_file, file_type, data_file_type, core_data_file_type;
21
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000022# /data/misc/perfetto-traces for perfetto traces
23type perfetto_traces_data_file, file_type, data_file_type, core_data_file_type;
Dan Austin55d90962018-11-29 10:37:18 -080024
Primiano Tucci2f998092021-01-07 17:12:21 +000025# /data/misc/perfetto-traces/bugreport for perfetto traces for bugreports.
26type perfetto_traces_bugreport_data_file, file_type, data_file_type, core_data_file_type;
27
Yisroel Fortac5cb5a22024-02-15 20:16:46 +000028# /data/misc/perfetto-traces/profiling for perfetto traces from profiling apis.
29type perfetto_traces_profiling_data_file, file_type, data_file_type, core_data_file_type;
30
Primiano Tucci512bdb92020-10-13 21:13:09 +010031# /data/misc/perfetto-configs for perfetto configs
32type perfetto_configs_data_file, file_type, data_file_type, core_data_file_type;
33
Daniele Di Proietto9a997592024-02-16 17:51:49 +000034# /system/etc/perfetto for perfetto configs
35type system_perfetto_config_file, file_type, system_file_type;
36
Yu-Ting Tseng43cae4e2023-12-15 00:48:23 +000037# /data/misc/uprobestats-configs for uprobestats configs
38type uprobestats_configs_data_file, file_type, data_file_type, core_data_file_type;
39
Yu-Ting Tseng7dea3a32024-07-10 01:48:59 +000040# /apex/com.android.art/bin/oatdump
Yu-Ting Tseng46e40492024-07-09 19:03:39 -070041# TODO (b/350628688): Remove this once it's safe to do so.
Yu-Ting Tseng7dea3a32024-07-10 01:48:59 +000042type oatdump_exec, system_file_type, exec_type, file_type;
43
Mohammad Samiul Islamd2ffd352022-05-11 21:43:54 +010044# /data/misc_{ce/de}/<user>/sdksandbox root data directory for sdk sandbox processes
45type sdk_sandbox_system_data_file, file_type, data_file_type, core_data_file_type;
Bram Bonneb93f26f2022-03-15 18:28:02 +010046# /data/misc_{ce/de}/<user>/sdksandbox/<app-name>/* subdirectory for sdk sandbox processes
47type sdk_sandbox_data_file, file_type, data_file_type, core_data_file_type, app_data_file_type;
48
Dan Austin55d90962018-11-29 10:37:18 -080049# /sys/kernel/debug/kcov for coverage guided kernel fuzzing in userdebug builds.
50type debugfs_kcov, fs_type, debugfs_type;
51
Nick Kralevichfb66c6f2019-01-11 09:37:46 -080052# App executable files in /data/data directories
53type app_exec_data_file, file_type, data_file_type, core_data_file_type;
54typealias app_exec_data_file alias rs_data_file;
Narayan Kamath2ad229c2019-01-14 15:02:12 +000055
56# /data/misc_[ce|de]/rollback : Used by installd to store snapshots
57# of application data.
58type rollback_data_file, file_type, data_file_type, core_data_file_type;
Kiyoung Kimaffa6f32019-07-08 19:02:05 +090059
Tianjieb729aa62021-10-05 22:13:20 -070060# /data/misc_ce/checkin for checkin apps.
61type checkin_data_file, file_type, data_file_type, core_data_file_type;
62
Yifan Hong07a99e12019-08-07 13:01:15 -070063# /data/gsi/ota
64type ota_image_data_file, file_type, data_file_type, core_data_file_type;
Shuo Qian9322cb02019-10-15 13:13:56 -070065
Howard Chen55665d62020-12-25 17:32:13 +080066# /data/gsi_persistent_data
67type gsi_persistent_data_file, file_type, data_file_type, core_data_file_type;
68
Shuo Qian9322cb02019-10-15 13:13:56 -070069# /data/misc/emergencynumberdb
70type emergency_data_file, file_type, data_file_type, core_data_file_type;
Yi Kong239c85d2020-06-18 12:43:23 +080071
72# /data/misc/profcollectd
73type profcollectd_data_file, file_type, data_file_type, core_data_file_type;
Orion Hodson8f75f762020-10-16 15:29:55 +010074
75# /data/misc/apexdata/com.android.art
Alan Stokesfa10a142021-07-12 14:21:48 +010076type apex_art_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
Orion Hodson8f75f762020-10-16 15:29:55 +010077
78# /data/misc/apexdata/com.android.art/staging
79type apex_art_staging_data_file, file_type, data_file_type, core_data_file_type;
Seigo Nonaka9c3707f2021-01-21 13:08:31 -080080
Alan Stokes10fbf232021-07-12 15:12:37 +010081# /data/misc/apexdata/com.android.compos
82type apex_compos_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
83
Alice Wang40519f72023-08-31 11:37:30 +000084# /data/misc/apexdata/com.android.virt
85type apex_virt_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
86
Kangping Donge21496b2024-01-02 15:10:27 +080087# /data/misc/apexdata/com.android.tethering
88type apex_tethering_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
89
Nattharat Jariyanuntanaetdd2e2ba2024-05-15 08:16:16 +000090# /data/misc/apexdata/com.android.uwb
91type apex_uwb_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
92
Alan Stokes53c76a22022-02-08 15:44:06 +000093# legacy labels for various /data/misc[_ce|_de]/*/apexdata directories - retained
94# for backward compatibility b/217581286
95type apex_appsearch_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
96type apex_permission_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
97type apex_scheduling_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
98type apex_wifi_data_file, file_type, data_file_type, core_data_file_type, apex_data_file_type;
99
Seigo Nonaka9c3707f2021-01-21 13:08:31 -0800100# /data/font/files
101type font_data_file, file_type, data_file_type, core_data_file_type;
Martijn Coenen6afdb722020-11-27 12:23:54 +0100102
Alexander Potapenko0a64d102022-01-28 19:48:27 +0100103# /data/misc/dmesgd
104type dmesgd_data_file, file_type, data_file_type, core_data_file_type;
105
Orion Hodson7c6b3eb2021-04-09 15:17:38 +0100106# /data/misc/odrefresh
107type odrefresh_data_file, file_type, data_file_type, core_data_file_type;
108
Martijn Coenen6afdb722020-11-27 12:23:54 +0100109# /data/misc/odsign
110type odsign_data_file, file_type, data_file_type, core_data_file_type;
satayevafc97912021-03-19 11:08:49 +0000111
Shikha Panwar36daf982022-02-24 11:50:35 +0000112# /data/misc/odsign_metrics
113type odsign_metrics_file, file_type, data_file_type, core_data_file_type;
114
Andrew Walbran654c5b02021-05-19 17:10:43 +0000115# /data/misc/virtualizationservice
David Brazdil55d808c2022-12-15 13:38:42 +0000116# The type needs to be mlstrustedobject to allow for being accessed from
117# virtualizationmanager, which runs at a more constrained MLS level.
118type virtualizationservice_data_file, file_type, data_file_type, core_data_file_type, mlstrustedobject;
Andrew Walbran654c5b02021-05-19 17:10:43 +0000119
satayevafc97912021-03-19 11:08:49 +0000120# /data/system/environ
121type environ_system_data_file, file_type, data_file_type, core_data_file_type;
Andrew Walbrana995e842021-03-29 17:19:12 +0000122
Lee George Thomas407e1cf2023-07-25 15:02:33 -0700123# /data/misc/bootanim
Josh Yang1d967dd2021-12-23 14:37:41 -0800124type bootanim_data_file, file_type, data_file_type, core_data_file_type;
125
Andrew Walbrana995e842021-03-29 17:19:12 +0000126# /dev/kvm
David Brazdil55d808c2022-12-15 13:38:42 +0000127# The type needs to be mlstrustedobject to allow for being accessed from
128# crosvm, which runs at a more constrained MLS level.
Elliot Bermanae5869a2023-03-22 17:31:35 -0700129type kvm_device, dev_type, mlstrustedobject, vm_manager_device_type;
Alan Stokesec4a90f2021-09-21 13:32:24 +0100130
131# /apex/com.android.virt/bin/fd_server
132type fd_server_exec, system_file_type, exec_type, file_type;
Jeff Vander Stoep5aa5e5e2021-11-17 08:51:11 +0100133
Alan Stokes766caba2022-02-14 14:33:37 +0000134# /apex/com.android.compos/bin/compsvc
135type compos_exec, exec_type, file_type, system_file_type;
136# /apex/com.android.compos/bin/compos_key_helper
137type compos_key_helper_exec, exec_type, file_type, system_file_type;
138
Pete Bentleye6da3b82022-09-16 15:31:39 +0100139# Filesystem entry for for PRNG seeder socket. Processes require
140# write permission on this to connect, and needs to be mlstrustedobject
141# in to satisfy MLS constraints for trusted domains.
142type prng_seeder_socket, file_type, coredomain_socket, mlstrustedobject;
Jaewan Kim93f57882023-02-07 01:49:24 +0900143
Jaewan Kim2141ad52024-01-31 05:56:43 +0000144# /proc/device-tree/avf and /sys/firmware/devicetree/base/avf
Jaewan Kim93f57882023-02-07 01:49:24 +0900145type sysfs_dt_avf, fs_type, sysfs_type;
Jaewan Kim2141ad52024-01-31 05:56:43 +0000146type proc_dt_avf, fs_type, proc_type;
Seigo Nonakad570a5c2023-07-21 14:29:24 +0900147
148# Type for /system/fonts/font_fallback.xm
149type system_font_fallback_file, system_file_type, file_type;
Yu-Ting Tseng3e8e8ea2023-09-25 18:42:03 +0000150
151# Type for /sys/devices/uprobe.
152type sysfs_uprobe, fs_type, sysfs_type;
Dennis Shen26592572024-02-25 15:44:51 +0000153
154# Type for aconfig daemon socket
155type aconfigd_socket, file_type, coredomain_socket;
Dennis Shenf008c292024-02-28 18:08:10 +0000156
157# Type for /(system|system_ext|product)/etc/aconfig
158type system_aconfig_storage_file, system_file_type, file_type;
159
160# Type for /vendor/etc/aconfig
161type vendor_aconfig_storage_file, vendor_file_type, file_type;
Hansen Kurli0e638112023-12-14 16:30:26 +0800162
Ted Bauer86405532024-04-03 18:16:23 +0000163type aconfig_test_mission_files, file_type;
164
Hansen Kurli0e638112023-12-14 16:30:26 +0800165# /data/misc/connectivityblobdb
166type connectivityblob_data_file, file_type, data_file_type, core_data_file_type;
Jiakai Zhang4acd0732024-03-20 11:24:54 +0000167
168# Type for /mnt/pre_reboot_dexopt
169type pre_reboot_dexopt_file, file_type;
170
171# Type for /mnt/artd_tmp in the Pre-reboot Dexopt chroot
172# This type is set on the directory through the `rootcontext=` mount option.
173type pre_reboot_dexopt_artd_file, file_type;
Inseob Kim75806ef2024-03-27 17:18:41 +0900174
William Loh38b57bc2024-04-24 22:31:06 +0000175# /data/app-metadata - extracted app metadata bundles from APKs
176type apk_metadata_file, file_type, data_file_type, core_data_file_type;
177
Kalesh Singh3a4c68d2024-04-09 16:24:48 -0700178# Type for /sys/kernel/mm/pgsize_migration/enabled
179type sysfs_pgsize_migration, fs_type, sysfs_type;
180
Inseob Kim75806ef2024-03-27 17:18:41 +0900181# Allow files to be created in their appropriate filesystems.
182allow fs_type self:filesystem associate;
183allow cgroup tmpfs:filesystem associate;
184allow cgroup_v2 tmpfs:filesystem associate;
185allow cgroup_rc_file tmpfs:filesystem associate;
186allow sysfs_type sysfs:filesystem associate;
187allow debugfs_type { debugfs debugfs_tracing debugfs_tracing_debug }:filesystem associate;
188allow file_type labeledfs:filesystem associate;
189allow file_type tmpfs:filesystem associate;
190allow file_type rootfs:filesystem associate;
191allow dev_type tmpfs:filesystem associate;
192allow app_fuse_file app_fusefs:filesystem associate;
193allow postinstall_file self:filesystem associate;
194allow proc_net proc:filesystem associate;
195
196# It's a bug to assign the file_type attribute and fs_type attribute
197# to any type. Do not allow it.
198#
199# For example, the following is a bug:
200# type apk_data_file, file_type, data_file_type, fs_type;
201# Should be:
202# type apk_data_file, file_type, data_file_type;
203neverallow fs_type file_type:filesystem associate;
Ellen Arteca27b515e2024-04-30 20:26:55 +0000204# app directories of storage areas: /data/storage_area/userId/pkgName -- apps cannot write to it
205type storage_area_app_dir, file_type, data_file_type, core_data_file_type, app_data_file_type;
206# app storage areas: /data/storage_area/userId/pkgName/storageAreaName
207type storage_area_dir, file_type, data_file_type, core_data_file_type, app_data_file_type;
208# contents of app storage areas: /data/storage_area/userId/pkgName/storageAreaName/*
209type storage_area_content_file, file_type, data_file_type, core_data_file_type, app_data_file_type;
210
211# /data/misc_ce/userId/storage_area_keys
Nattharat Jariyanuntanaetdd2e2ba2024-05-15 08:16:16 +0000212type storage_area_key_file, file_type, data_file_type, core_data_file_type;