Skip to content

Commit

Permalink
Prevent system uid component from running in an app process
Browse files Browse the repository at this point in the history
Bug: 21669445
Change-Id: I792c6e676d4b6d54a51228d264130b8125075d98
  • Loading branch information
ogunwale authored and LordNerevar committed Aug 20, 2015
1 parent 5ac63d6 commit 1a8d780
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions services/java/com/android/server/am/ActivityManagerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2597,9 +2597,14 @@ final ProcessRecord getProcessRecordLocked(String processName, int uid, boolean
// 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);
Expand Down

0 comments on commit 1a8d780

Please sign in to comment.