Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51b96648 authored by Jackal Guo's avatar Jackal Guo
Browse files

Mitigate the app visibility gap

The API #packageHasActiveAdmins leaves the possibility that malicious
code could do a side channel attack. Apply the app visibility check
to mitigate this.

Bug: 204786752
Test: atest CtsAdminTestCases
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: manually using the PoC in the buganizer to ensure the symptom
      no longer exists.
Change-Id: Icb7134706f8b1a1fc6d0145a2023ca779c76eb7b
parent f2506ea5
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -3555,6 +3555,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        final CallerIdentity caller = getCallerIdentity();
        final CallerIdentity caller = getCallerIdentity();
        Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
        Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle));
        if (mInjector.getPackageManagerInternal().filterAppAccess(packageName, caller.getUid(),
                userHandle)) {
            return false;
        }
        synchronized (getLockObject()) {
        synchronized (getLockObject()) {
            DevicePolicyData policy = getUserData(userHandle);
            DevicePolicyData policy = getUserData(userHandle);
            final int N = policy.mAdminList.size();
            final int N = policy.mAdminList.size();