summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-06-11 12:44:47 -0700
committerWale Ogunwale <ogunwale@google.com>2015-06-24 22:02:05 +0000
commitdd673a63a6148bf19825153efd77628fe03c5099 (patch)
tree2a492a904437c5bc1d9fbd272cdc1a6cae0676d7 /services
parent5e50e00c663a5d0b11d1f41509e1fb4e56d166f1 (diff)
downloadframeworks_base-dd673a63a6148bf19825153efd77628fe03c5099.zip
frameworks_base-dd673a63a6148bf19825153efd77628fe03c5099.tar.gz
frameworks_base-dd673a63a6148bf19825153efd77628fe03c5099.tar.bz2
Prevent system uid component from running in an app process
Bug: 21669445 Change-Id: I11d0bc5301d7e2a64972221f54f3cbd611f8e404 (cherry picked from commit 44368567f840e3469b5fd2c9399ed444b6f46ebf)
Diffstat (limited to 'services')
-rwxr-xr-xservices/core/java/com/android/server/am/ActivityManagerService.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 4844aa9..e0836a1 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -2695,9 +2695,14 @@ public final class ActivityManagerService extends ActivityManagerNative
// should never happen).
SparseArray<ProcessRecord> procs = mProcessNames.getMap().get(processName);
if (procs == null) return null;
- final int N = procs.size();
- for (int i = 0; i < N; i++) {
- if (UserHandle.isSameUser(procs.keyAt(i), uid)) return procs.valueAt(i);
+ final int procCount = procs.size();
+ for (int i = 0; i < procCount; i++) {
+ final int procUid = procs.keyAt(i);
+ if (UserHandle.isApp(procUid) || !UserHandle.isSameUser(procUid, uid)) {
+ // Don't use an app process or different user process for system component.
+ continue;
+ }
+ return procs.valueAt(i);
}
}
ProcessRecord proc = mProcessNames.get(processName, uid);