summaryrefslogtreecommitdiff
path: root/core/jni/fd_utils.cpp
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2019-01-24 07:03:32 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-01-24 07:03:32 -0800
commit319db3e9f76ca939aba26e8059bcec119f370877 (patch)
treec1fa1a10b4719d92602b6ac104f2b70769702696 /core/jni/fd_utils.cpp
parent455d2a92dad85c86d76c44d219d8365ee80a6021 (diff)
parentb5a3c59d3a38b362e674623feb5af6bd1dce14c3 (diff)
Merge "Add jar files from the runtime APEX in the whitelist." am: 4d3a2f95c6
am: b5a3c59d3a Change-Id: Iec1e66f533063cde4529a0f4d874418b4f01e0d6
Diffstat (limited to 'core/jni/fd_utils.cpp')
-rw-r--r--core/jni/fd_utils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp
index 0ed8c0c97738..2aaf2f0a2bbe 100644
--- a/core/jni/fd_utils.cpp
+++ b/core/jni/fd_utils.cpp
@@ -71,6 +71,7 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const {
return true;
}
+ // Framework jars are allowed.
static const char* kFrameworksPrefix = "/system/framework/";
static const char* kJarSuffix = ".jar";
if (android::base::StartsWith(path, kFrameworksPrefix)
@@ -78,6 +79,13 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const {
return true;
}
+ // Jars from the runtime apex are allowed.
+ static const char* kRuntimeApexPrefix = "/apex/com.android.runtime/javalib/";
+ if (android::base::StartsWith(path, kRuntimeApexPrefix)
+ && android::base::EndsWith(path, kJarSuffix)) {
+ return true;
+ }
+
// Whitelist files needed for Runtime Resource Overlay, like these:
// /system/vendor/overlay/framework-res.apk
// /system/vendor/overlay-subdir/pg/framework-res.apk