summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-07-02 00:35:47 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-02 00:35:47 +0000
commitb6f87997cb6ea557dc84e77c18c5bb22f99411fc (patch)
tree03bac1be5fe738de92ab455d56ca0d5fed17c6f8
parent03850591954faf5280fd581dd04cd6958eda0124 (diff)
parentf54d17224bada1d852ba7c9d4bb9e2a792c0093b (diff)
downloadframeworks_base-b6f87997cb6ea557dc84e77c18c5bb22f99411fc.zip
frameworks_base-b6f87997cb6ea557dc84e77c18c5bb22f99411fc.tar.gz
frameworks_base-b6f87997cb6ea557dc84e77c18c5bb22f99411fc.tar.bz2
am f54d1722: am 52034328: am 131e6b24: Merge "Prevent system uid component from running in an app process" into lmp-mr1-dev
* commit 'f54d17224bada1d852ba7c9d4bb9e2a792c0093b': Prevent system uid component from running in an app process
-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);