2014-07-15 08:32:08 +02:00
|
|
|
# dex2oat
|
2016-02-01 20:28:39 +01:00
|
|
|
type dex2oat, domain, domain_deprecated;
|
2014-07-15 08:32:08 +02:00
|
|
|
type dex2oat_exec, exec_type, file_type;
|
|
|
|
|
2017-01-25 23:55:56 +01:00
|
|
|
r_dir_file(dex2oat, apk_data_file)
|
2016-09-10 01:27:17 +02:00
|
|
|
|
|
|
|
allow dex2oat tmpfs:file { read getattr };
|
|
|
|
|
|
|
|
r_dir_file(dex2oat, dalvikcache_data_file)
|
2014-07-15 08:32:08 +02:00
|
|
|
allow dex2oat dalvikcache_data_file:file write;
|
2015-12-03 06:23:30 +01:00
|
|
|
# Read symlinks in /data/dalvik-cache. This is required for PIC mode boot images, where
|
|
|
|
# the oat file is symlinked to the original file in /system.
|
2014-10-24 23:22:12 +02:00
|
|
|
allow dex2oat dalvikcache_data_file:lnk_file read;
|
2014-07-15 08:32:08 +02:00
|
|
|
allow dex2oat installd:fd use;
|
2014-07-16 18:38:06 +02:00
|
|
|
|
|
|
|
# Read already open asec_apk_file file descriptors passed by installd.
|
2014-07-17 00:34:06 +02:00
|
|
|
# Also allow reading unlabeled files, to allow for upgrading forward
|
|
|
|
# locked APKs.
|
2014-07-16 18:38:06 +02:00
|
|
|
allow dex2oat asec_apk_file:file read;
|
2014-07-17 00:34:06 +02:00
|
|
|
allow dex2oat unlabeled:file read;
|
2014-11-26 20:46:06 +01:00
|
|
|
allow dex2oat oemfs:file read;
|
2017-04-06 00:49:05 +02:00
|
|
|
allow dex2oat apk_tmp_file:dir search;
|
|
|
|
allow dex2oat apk_tmp_file:file r_file_perms;
|
2016-03-28 23:56:36 +02:00
|
|
|
allow dex2oat user_profile_data_file:file { getattr read lock };
|
2016-01-12 20:15:55 +01:00
|
|
|
|
2017-01-18 05:31:31 +01:00
|
|
|
# Allow dex2oat to compile app's secondary dex files which were reported back to
|
|
|
|
# the framework.
|
2017-03-16 02:47:06 +01:00
|
|
|
allow dex2oat app_data_file:file { getattr read write lock };
|
2017-01-18 05:31:31 +01:00
|
|
|
|
2015-12-03 06:23:30 +01:00
|
|
|
##################
|
|
|
|
# A/B OTA Dexopt #
|
|
|
|
##################
|
|
|
|
|
|
|
|
# Allow dex2oat to use file descriptors from otapreopt.
|
2016-03-30 00:08:20 +02:00
|
|
|
allow dex2oat postinstall_dexopt:fd use;
|
|
|
|
|
2016-06-06 23:51:46 +02:00
|
|
|
allow dex2oat postinstall_file:dir { getattr search };
|
2017-03-17 18:08:52 +01:00
|
|
|
allow dex2oat postinstall_file:lnk_file read;
|
2016-03-30 00:08:20 +02:00
|
|
|
|
2015-12-03 06:23:30 +01:00
|
|
|
# Allow dex2oat access to files in /data/ota.
|
|
|
|
allow dex2oat ota_data_file:dir ra_dir_perms;
|
|
|
|
allow dex2oat ota_data_file:file r_file_perms;
|
|
|
|
|
2016-02-16 19:38:38 +01:00
|
|
|
# Create and read symlinks in /data/ota/dalvik-cache. This is required for PIC mode boot images,
|
|
|
|
# where the oat file is symlinked to the original file in /system.
|
|
|
|
allow dex2oat ota_data_file:lnk_file { create read };
|
2015-12-03 06:23:30 +01:00
|
|
|
|
|
|
|
# It would be nice to tie this down, but currently, because of how images are written, we can't
|
|
|
|
# pass file descriptors for the preopted boot image to dex2oat. So dex2oat needs to be able to
|
|
|
|
# create them itself (and make them world-readable).
|
|
|
|
allow dex2oat ota_data_file:file { create w_file_perms setattr };
|
|
|
|
|
|
|
|
##############
|
|
|
|
# Neverallow #
|
|
|
|
##############
|
|
|
|
|
2016-01-12 20:15:55 +01:00
|
|
|
neverallow dex2oat app_data_file:notdevfile_class_set open;
|