xref: /aosp_15_r20/system/sepolicy/prebuilts/api/29.0/private/dexoptanalyzer.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1*e4a36f41SAndroid Build Coastguard Worker# dexoptanalyzer
2*e4a36f41SAndroid Build Coastguard Workertype dexoptanalyzer, domain, coredomain, mlstrustedsubject;
3*e4a36f41SAndroid Build Coastguard Workertype dexoptanalyzer_exec, system_file_type, exec_type, file_type;
4*e4a36f41SAndroid Build Coastguard Workertype dexoptanalyzer_tmpfs, file_type;
5*e4a36f41SAndroid Build Coastguard Worker
6*e4a36f41SAndroid Build Coastguard Worker# Reading an APK opens a ZipArchive, which unpack to tmpfs.
7*e4a36f41SAndroid Build Coastguard Worker# Use tmpfs_domain() which will give tmpfs files created by dexoptanalyzer their
8*e4a36f41SAndroid Build Coastguard Worker# own label, which differs from other labels created by other processes.
9*e4a36f41SAndroid Build Coastguard Worker# This allows to distinguish in policy files created by dexoptanalyzer vs other
10*e4a36f41SAndroid Build Coastguard Worker#processes.
11*e4a36f41SAndroid Build Coastguard Workertmpfs_domain(dexoptanalyzer)
12*e4a36f41SAndroid Build Coastguard Worker
13*e4a36f41SAndroid Build Coastguard Worker# Read symlinks in /data/dalvik-cache. This is required for PIC mode boot
14*e4a36f41SAndroid Build Coastguard Worker# app_data_file the oat file is symlinked to the original file in /system.
15*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer dalvikcache_data_file:dir { getattr search };
16*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer dalvikcache_data_file:file r_file_perms;
17*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer dalvikcache_data_file:lnk_file read;
18*e4a36f41SAndroid Build Coastguard Worker
19*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer installd:fd use;
20*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer installd:fifo_file { getattr write };
21*e4a36f41SAndroid Build Coastguard Worker
22*e4a36f41SAndroid Build Coastguard Worker# Allow reading secondary dex files that were reported by the app to the
23*e4a36f41SAndroid Build Coastguard Worker# package manager.
24*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer { privapp_data_file app_data_file }:dir { getattr search };
25*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer { privapp_data_file app_data_file }:file { getattr read map };
26*e4a36f41SAndroid Build Coastguard Worker# dexoptanalyzer calls access(2) with W_OK flag on app data. We can use the
27*e4a36f41SAndroid Build Coastguard Worker# "dontaudit...audit_access" policy line to suppress the audit access without
28*e4a36f41SAndroid Build Coastguard Worker# suppressing denial on actual access.
29*e4a36f41SAndroid Build Coastguard Workerdontaudit dexoptanalyzer { privapp_data_file app_data_file }:dir audit_access;
30*e4a36f41SAndroid Build Coastguard Worker
31*e4a36f41SAndroid Build Coastguard Worker# Allow testing /data/user/0 which symlinks to /data/data
32*e4a36f41SAndroid Build Coastguard Workerallow dexoptanalyzer system_data_file:lnk_file { getattr };
33