blob: 7071334e0ff495e13c882dde1bec972113a0d8c6 [file] [log] [blame]
Alex Klyubinf5446eb2017-03-23 14:27:32 -07001typeattribute profman coredomain;
Jiakai Zhangf7dcc532024-07-04 15:59:49 +01002typeattribute profman artd_subprocess_type;
Jiakai Zhangc871c1c2022-07-19 21:29:31 +01003
4# Allow profman to read APKs and profile files next to them by FDs passed from
5# other programs. In addition, allow profman to acquire flocks on those files.
6allow profman {
7 system_file
8 apk_data_file
9 vendor_app_file
10}:file { getattr read map lock };
11
12# Allow profman to use file descriptors passed from privileged programs.
13allow profman { artd installd }:fd use;
Jiakai Zhang8ff6c552023-10-12 13:48:00 +000014
15# Allow profman to read from memfd created by artd.
16# profman needs to read the embedded profile that artd extracts from an APK,
17# which is passed by a memfd.
18allow profman artd_tmpfs:file { getattr read map lock };
Inseob Kim75806ef2024-03-27 17:18:41 +090019
20allow profman user_profile_data_file:file { getattr read write lock map };
21
22# Dumping profile info opens the application APK file for pretty printing.
23allow profman asec_apk_file:file { read map };
24allow profman apk_data_file:file { getattr read map };
25allow profman apk_data_file:dir { getattr read search };
26
27allow profman oemfs:file { read map };
28# Reading an APK opens a ZipArchive, which unpack to tmpfs.
29allow profman tmpfs:file { read map };
30allow profman profman_dump_data_file:file { write map };
31
32# Allow profman to analyze profiles for the secondary dex files. These
33# are application dex files reported back to the framework when using
34# BaseDexClassLoader.
35allow profman { privapp_data_file app_data_file }:file { getattr read write lock map };
36allow profman { privapp_data_file app_data_file }:dir { getattr read search };
37
38# Allow query ART device config properties
39get_prop(profman, device_config_runtime_native_prop)
40get_prop(profman, device_config_runtime_native_boot_prop)
41
42###
43### neverallow rules
44###
45
46neverallow profman app_data_file_type:notdevfile_class_set open;