• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# dex2oat
2type dex2oat, domain;
3type dex2oat_exec, exec_type, file_type;
4
5r_dir_file(dex2oat, apk_data_file)
6# Access to /vendor/app
7r_dir_file(dex2oat, vendor_app_file)
8# Access /vendor/framework
9allow dex2oat vendor_framework_file:dir { getattr search };
10allow dex2oat vendor_framework_file:file { getattr open read };
11
12allow dex2oat tmpfs:file { read getattr };
13
14r_dir_file(dex2oat, dalvikcache_data_file)
15allow dex2oat dalvikcache_data_file:file write;
16# Read symlinks in /data/dalvik-cache. This is required for PIC mode boot images, where
17# the oat file is symlinked to the original file in /system.
18allow dex2oat dalvikcache_data_file:lnk_file read;
19allow dex2oat installd:fd use;
20
21# Acquire advisory lock on /system/framework/arm/*
22allow dex2oat system_file:file lock;
23
24# Read already open asec_apk_file file descriptors passed by installd.
25# Also allow reading unlabeled files, to allow for upgrading forward
26# locked APKs.
27allow dex2oat asec_apk_file:file read;
28allow dex2oat unlabeled:file read;
29allow dex2oat oemfs:file read;
30allow dex2oat apk_tmp_file:dir search;
31allow dex2oat apk_tmp_file:file r_file_perms;
32allow dex2oat user_profile_data_file:file { getattr read lock };
33
34# Allow dex2oat to compile app's secondary dex files which were reported back to
35# the framework.
36allow dex2oat app_data_file:file { getattr read write lock };
37
38##################
39# A/B OTA Dexopt #
40##################
41
42# Allow dex2oat to use file descriptors from otapreopt.
43allow dex2oat postinstall_dexopt:fd use;
44
45allow dex2oat postinstall_file:dir { getattr search };
46allow dex2oat postinstall_file:filesystem getattr;
47allow dex2oat postinstall_file:lnk_file read;
48
49# Allow dex2oat access to files in /data/ota.
50allow dex2oat ota_data_file:dir ra_dir_perms;
51allow dex2oat ota_data_file:file r_file_perms;
52
53# Create and read symlinks in /data/ota/dalvik-cache. This is required for PIC mode boot images,
54# where the oat file is symlinked to the original file in /system.
55allow dex2oat ota_data_file:lnk_file { create read };
56
57# It would be nice to tie this down, but currently, because of how images are written, we can't
58# pass file descriptors for the preopted boot image to dex2oat. So dex2oat needs to be able to
59# create them itself (and make them world-readable).
60allow dex2oat ota_data_file:file { create w_file_perms setattr };
61
62##############
63# Neverallow #
64##############
65
66neverallow dex2oat app_data_file:notdevfile_class_set open;
67