blob: b99349edf18580d30f3ef48504a0563f87f768e8 [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
Alan Stokesf41d4d72020-09-22 15:43:17 +010014# processes.
Calin Juravlee5a1f642017-01-17 20:31:31 -080015tmpfs_domain(dexoptanalyzer)
16
Lokesh Gidra06edcd82021-03-11 11:32:47 -080017userfaultfd_use(dexoptanalyzer)
18
Orion Hodson8f75f762020-10-16 15:29:55 +010019# Allow dexoptanalyzer to read files in the dalvik cache.
Calin Juravlee5a1f642017-01-17 20:31:31 -080020allow dexoptanalyzer dalvikcache_data_file:dir { getattr search };
21allow dexoptanalyzer dalvikcache_data_file:file r_file_perms;
Orion Hodson8f75f762020-10-16 15:29:55 +010022
23# Read symlinks in /data/dalvik-cache. This is required for PIC mode boot
24# app_data_file the oat file is symlinked to the original file in /system.
Calin Juravlee5a1f642017-01-17 20:31:31 -080025allow dexoptanalyzer dalvikcache_data_file:lnk_file read;
26
Orion Hodson8f75f762020-10-16 15:29:55 +010027# Allow dexoptanalyzer to read files in the ART APEX data directory.
28allow dexoptanalyzer { apex_art_data_file apex_module_data_file }:dir { getattr search };
29allow dexoptanalyzer apex_art_data_file:file r_file_perms;
30
31# Allow dexoptanalyzer to use file descriptors from odrefresh.
32allow dexoptanalyzer odrefresh:fd use;
33
Martijn Coenen6badc7f2021-02-19 09:52:15 +010034# Use devpts and fd from odsign (which exec()'s odrefresh)
35allow dexoptanalyzer odsign:fd use;
36allow dexoptanalyzer odsign_devpts:chr_file { read write };
37
Calin Juravlee5a1f642017-01-17 20:31:31 -080038allow dexoptanalyzer installd:fd use;
David Brazdil246efa22019-03-19 13:57:26 +000039allow dexoptanalyzer installd:fifo_file { getattr write };
Calin Juravlee5a1f642017-01-17 20:31:31 -080040
Roland Levillain47c7f842019-08-06 14:51:01 +010041# Acquire advisory lock on /system/framework/arm/*
42allow dexoptanalyzer system_file:file lock;
43
Calin Juravlee5a1f642017-01-17 20:31:31 -080044# Allow reading secondary dex files that were reported by the app to the
45# package manager.
Roland Levillainc72b7d12019-08-16 19:56:03 +010046allow dexoptanalyzer { privapp_data_file app_data_file }:file { getattr read map };
Calin Juravlee5a1f642017-01-17 20:31:31 -080047
48# Allow testing /data/user/0 which symlinks to /data/data
49allow dexoptanalyzer system_data_file:lnk_file { getattr };
Calin Juravle0b2ca6c2021-05-18 15:33:08 -070050
51# Allow query ART device config properties
52get_prop(dexoptanalyzer, device_config_runtime_native_prop)
53get_prop(dexoptanalyzer, device_config_runtime_native_boot_prop)
Nicolas Geoffray5441f772021-06-21 10:24:38 +010054
55# Allow dexoptanalyzer to read /apex/apex-info-list.xml
56allow dex2oat apex_info_file:file r_file_perms;