From eb96b00382f7d339479c27baafd7cfb973ada3e9 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Tue, 10 May 2016 10:51:40 -0700 Subject: [PATCH] Simplify permitted-path construction The white list of permitted directories is applied for every classloader namespace by libnativeloader. LoadedApk no longer needs to do that. Add mDataDir to permitted paths in the case if for any reason it is outside of the whitelisted dirs. Bug: http://b/28639227 Change-Id: I5b61ac64e281ecee3e3e9b1fe56cf04dc6ee7b25 --- core/java/android/app/LoadedApk.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java index e60712aaf359a..752dc1e88e152 100644 --- a/core/java/android/app/LoadedApk.java +++ b/core/java/android/app/LoadedApk.java @@ -466,11 +466,7 @@ public final class LoadedApk { final boolean isBundledApp = mApplicationInfo.isSystemApp() && !mApplicationInfo.isUpdatedSystemApp(); - // Apps are allowed to open any native library under /data - // TODO (dimitry):This is something which could be limited to apps own directory - // later on but currently there are number of apps relying on this. - // (see http://b/27588281 and http://b/26954419 for examples) - String libraryPermittedPath = "/data"; + String libraryPermittedPath = mDataDir; if (isBundledApp) { // This is necessary to grant bundled apps access to // libraries located in subdirectories of /system/lib