summaryrefslogtreecommitdiffstats
path: root/patchoat
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-18 20:56:04 -0700
committerAndreas Gampe <agampe@google.com>2014-09-18 23:43:07 -0700
commit3c13a794845e0cf7887e33b2ec20de7e6ba85f8f (patch)
treeab9a9a426a371de0c32e48a85fdda44a321a06a0 /patchoat
parent5cdd0734d2f79eedc530f5f1e876cd2110e29c86 (diff)
downloadart-3c13a794845e0cf7887e33b2ec20de7e6ba85f8f.zip
art-3c13a794845e0cf7887e33b2ec20de7e6ba85f8f.tar.gz
art-3c13a794845e0cf7887e33b2ec20de7e6ba85f8f.tar.bz2
ART: Only allow the zygote to create the global boot image
Do not allow arbitrary processes, even when root, to write the boot image in /data/dalvik-cache. Bug: 17478752, 17510489, 17439961 Change-Id: Iba2b74be6d0752f4221f4ff5ee295b45a34cb2e1 (cherry picked from commit 33c36d4f22ab6a5e61eb47b654deaf647c34e49c)
Diffstat (limited to 'patchoat')
-rw-r--r--patchoat/patchoat.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc
index f89a4f7..50b4ece 100644
--- a/patchoat/patchoat.cc
+++ b/patchoat/patchoat.cc
@@ -79,9 +79,10 @@ static bool LocationToFilename(const std::string& location, InstructionSet isa,
bool have_android_data = false;
bool dalvik_cache_exists = false;
+ bool is_global_cache = false;
std::string dalvik_cache;
GetDalvikCache(GetInstructionSetString(isa), false, &dalvik_cache,
- &have_android_data, &dalvik_cache_exists);
+ &have_android_data, &dalvik_cache_exists, &is_global_cache);
std::string cache_filename;
if (have_android_data && dalvik_cache_exists) {
@@ -986,9 +987,11 @@ static int patchoat(int argc, char **argv) {
std::string cache_filename;
bool has_cache = false;
bool has_android_data_unused = false;
+ bool is_global_cache = false;
if (!gc::space::ImageSpace::FindImageFilename(patched_image_location.c_str(), isa,
&system_filename, &has_system, &cache_filename,
- &has_android_data_unused, &has_cache)) {
+ &has_android_data_unused, &has_cache,
+ &is_global_cache)) {
Usage("Unable to determine image file for location %s", patched_image_location.c_str());
}
if (has_cache) {