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

Commit b52f6dae authored by Alex Johnston's avatar Alex Johnston
Browse files

Fix access control checks getOwnerInstalledCaCerts

Prevent the profile owner or device owner from reading
ca certs for another user

Bug: 235822598
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Test: atest com.android.cts.devicepolicy.ProfileOwnerTest#testAdminActionBookkeeping
Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testDelegatedCertInstaller
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDelegatedCertInstaller
Change-Id: I014fa1cfb4ddbbbdb86fbb0f948464dc4f5c069e
parent 7137d916
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -18504,9 +18504,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    public StringParceledListSlice getOwnerInstalledCaCerts(@NonNull UserHandle user) {
        final int userId = user.getIdentifier();
        final CallerIdentity caller = getCallerIdentity();
        Preconditions.checkCallAuthorization((userId == caller.getUserId())
                || isProfileOwner(caller) || isDefaultDeviceOwner(caller)
                || hasFullCrossUsersPermission(caller, userId));
        Preconditions.checkCallAuthorization(
                (isProfileOwner(caller) || isDefaultDeviceOwner(caller) || canQueryAdminPolicy(
                        caller)) && hasFullCrossUsersPermission(caller, userId));
        synchronized (getLockObject()) {
            return new StringParceledListSlice(