OSDN Git Service

Limit IsSeparateProfileChallengeAllowed to system callers
authorPavel Grafov <pgrafov@google.com>
Wed, 10 Apr 2019 11:47:25 +0000 (12:47 +0100)
committersyphyr <syphyr@gmail.com>
Wed, 5 Jun 2019 19:09:05 +0000 (21:09 +0200)
Fixes: 128599668
Test: build, set up separate challenge
Change-Id: I2fef9ab13614627c0f1bcca04759d0974fc6181a
(cherry picked from commit 1b6301cf2430f192c9842a05fc22984d782bade9)

services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java

index b211f91..fe0ee09 100644 (file)
@@ -3156,6 +3156,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
 
     @Override
     public boolean isSeparateProfileChallengeAllowed(int userHandle) {
+        if (!isCallerWithSystemUid()) {
+            throw new SecurityException("Caller must be system");
+        }
         ComponentName profileOwner = getProfileOwner(userHandle);
         // Profile challenge is supported on N or newer release.
         return profileOwner != null &&