blob: a2b2b018d22903b18e6011ab388718a11b5a6d32 [file] [log] [blame]
Calin Juravlee5a1f642017-01-17 20:31:31 -08001# dexoptanalyzer
Alex Klyubinf5446eb2017-03-23 14:27:32 -07002type dexoptanalyzer, domain, coredomain, mlstrustedsubject;
Nick Kralevich5e372712018-09-27 10:21:37 -07003type dexoptanalyzer_exec, system_file_type, exec_type, file_type;
Jeff Vander Stoep41a2abf2019-01-23 15:07:40 -08004type dexoptanalyzer_tmpfs, file_type;
Calin Juravlee5a1f642017-01-17 20:31:31 -08005
Calin Juravlede7244c2020-07-13 18:53:38 -07006r_dir_file(dexoptanalyzer, apk_data_file)
7# Access to /vendor/app
8r_dir_file(dexoptanalyzer, vendor_app_file)
9
Calin Juravlee5a1f642017-01-17 20:31:31 -080010# Reading an APK opens a ZipArchive, which unpack to tmpfs.
11# Use tmpfs_domain() which will give tmpfs files created by dexoptanalyzer their
12# own label, which differs from other labels created by other processes.
13# This allows to distinguish in policy files created by dexoptanalyzer vs other
14#processes.
15tmpfs_domain(dexoptanalyzer)
16
17# Read symlinks in /data/dalvik-cache. This is required for PIC mode boot
18# app_data_file the oat file is symlinked to the original file in /system.
19allow dexoptanalyzer dalvikcache_data_file:dir { getattr search };
20allow dexoptanalyzer dalvikcache_data_file:file r_file_perms;
21allow dexoptanalyzer dalvikcache_data_file:lnk_file read;
22
23allow dexoptanalyzer installd:fd use;
David Brazdil246efa22019-03-19 13:57:26 +000024allow dexoptanalyzer installd:fifo_file { getattr write };
Calin Juravlee5a1f642017-01-17 20:31:31 -080025
Roland Levillain47c7f842019-08-06 14:51:01 +010026# Acquire advisory lock on /system/framework/arm/*
27allow dexoptanalyzer system_file:file lock;
28
Calin Juravlee5a1f642017-01-17 20:31:31 -080029# Allow reading secondary dex files that were reported by the app to the
30# package manager.
Nick Kralevich23c9d912018-08-02 15:54:23 -070031allow dexoptanalyzer { privapp_data_file app_data_file }:dir { getattr search };
Roland Levillainc72b7d12019-08-16 19:56:03 +010032allow dexoptanalyzer { privapp_data_file app_data_file }:file { getattr read map };
Jeff Vander Stoep06aee352017-06-26 15:08:37 -070033# dexoptanalyzer calls access(2) with W_OK flag on app data. We can use the
34# "dontaudit...audit_access" policy line to suppress the audit access without
35# suppressing denial on actual access.
Nick Kralevich23c9d912018-08-02 15:54:23 -070036dontaudit dexoptanalyzer { privapp_data_file app_data_file }:dir audit_access;
Calin Juravlee5a1f642017-01-17 20:31:31 -080037
38# Allow testing /data/user/0 which symlinks to /data/data
39allow dexoptanalyzer system_data_file:lnk_file { getattr };