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