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

Unverified Commit 53ece2ae authored by Nate Myren's avatar Nate Myren Committed by Kevin F. Haggerty
Browse files

RESTRICT AUTOMERGE Validate permission tree size on permission update

Bug: 242537498
Test: manual
Change-Id: I15343e84c1802d6b89249106263319a6539fa73b
(cherry picked from commit 1d86c8b2)
Merged-In: I15343e84c1802d6b89249106263319a6539fa73b
parent 33c13c17
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -657,8 +657,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
            Permission bp = mRegistry.getPermission(info.name);
            Permission bp = mRegistry.getPermission(info.name);
            added = bp == null;
            added = bp == null;
            int fixedLevel = PermissionInfo.fixProtectionLevel(info.protectionLevel);
            int fixedLevel = PermissionInfo.fixProtectionLevel(info.protectionLevel);
            if (added) {
            enforcePermissionCapLocked(info, tree);
            enforcePermissionCapLocked(info, tree);
            if (added) {
                bp = new Permission(info.name, tree.getPackageName(), Permission.TYPE_DYNAMIC);
                bp = new Permission(info.name, tree.getPackageName(), Permission.TYPE_DYNAMIC);
            } else if (!bp.isDynamic()) {
            } else if (!bp.isDynamic()) {
                throw new SecurityException("Not allowed to modify non-dynamic permission "
                throw new SecurityException("Not allowed to modify non-dynamic permission "