blob: d1ce92652d008bac7d08d54e452b8e0e31bbe34e [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
TYM Tsaie6cc2d42024-08-27 10:33:42 +08009 apk_tmp_file
Jiakai Zhangc871c1c2022-07-19 21:29:31 +010010 vendor_app_file
11}:file { getattr read map lock };
12
13# Allow profman to use file descriptors passed from privileged programs.
14allow profman { artd installd }:fd use;
Jiakai Zhang8ff6c552023-10-12 13:48:00 +000015
16# Allow profman to read from memfd created by artd.
17# profman needs to read the embedded profile that artd extracts from an APK,
18# which is passed by a memfd.
19allow profman artd_tmpfs:file { getattr read map lock };
Inseob Kim75806ef2024-03-27 17:18:41 +090020
21allow profman user_profile_data_file:file { getattr read write lock map };
22
23# Dumping profile info opens the application APK file for pretty printing.
24allow profman asec_apk_file:file { read map };
25allow profman apk_data_file:file { getattr read map };
26allow profman apk_data_file:dir { getattr read search };
TYM Tsaie6cc2d42024-08-27 10:33:42 +080027allow profman apk_tmp_file:dir { getattr read search };
Inseob Kim75806ef2024-03-27 17:18:41 +090028
29allow profman oemfs:file { read map };
30# Reading an APK opens a ZipArchive, which unpack to tmpfs.
31allow profman tmpfs:file { read map };
32allow profman profman_dump_data_file:file { write map };
33
34# Allow profman to analyze profiles for the secondary dex files. These
35# are application dex files reported back to the framework when using
36# BaseDexClassLoader.
37allow profman { privapp_data_file app_data_file }:file { getattr read write lock map };
38allow profman { privapp_data_file app_data_file }:dir { getattr read search };
39
40# Allow query ART device config properties
41get_prop(profman, device_config_runtime_native_prop)
42get_prop(profman, device_config_runtime_native_boot_prop)
43
44###
45### neverallow rules
46###
47
48neverallow profman app_data_file_type:notdevfile_class_set open;