Skip to content

Commit 2dc4541

Browse files
Nate MyrenOhMyVenyx
authored andcommitted
RESTRICT AUTOMERGE Validate permission tree size on permission update
Bug: 242537498 Test: manual Change-Id: I15343e84c1802d6b89249106263319a6539fa73b (cherry picked from commit 1d86c8b) Merged-In: I15343e84c1802d6b89249106263319a6539fa73b
1 parent da9ce92 commit 2dc4541

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

services/core/java/com/android/server/pm/permission/PermissionManagerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ public boolean addPermission(PermissionInfo info, boolean async) {
657657
Permission bp = mRegistry.getPermission(info.name);
658658
added = bp == null;
659659
int fixedLevel = PermissionInfo.fixProtectionLevel(info.protectionLevel);
660+
enforcePermissionCapLocked(info, tree);
660661
if (added) {
661-
enforcePermissionCapLocked(info, tree);
662662
bp = new Permission(info.name, tree.getPackageName(), Permission.TYPE_DYNAMIC);
663663
} else if (!bp.isDynamic()) {
664664
throw new SecurityException("Not allowed to modify non-dynamic permission "

0 commit comments

Comments
 (0)