OSDN Git Service

Fix Externally reported security issue
authorJeff Tinker <jtinker@google.com>
Tue, 17 Jun 2014 23:45:46 +0000 (16:45 -0700)
committerJeff Tinker <jtinker@google.com>
Fri, 20 Jun 2014 17:12:12 +0000 (10:12 -0700)
bug: 12724697
Change-Id: I57f37dbb3b01c0c3d3256be67c395352dd6ada13

drm/drmserver/DrmManagerService.cpp

index 2b71904..63341e0 100644 (file)
@@ -34,7 +34,18 @@ using namespace android;
 static Vector<uid_t> trustedUids;
 
 static bool isProtectedCallAllowed() {
-    return true;
+    // TODO
+    // Following implementation is just for reference.
+    // Each OEM manufacturer should implement/replace with their own solutions.
+    IPCThreadState* ipcState = IPCThreadState::self();
+    uid_t uid = ipcState->getCallingUid();
+
+    for (unsigned int i = 0; i < trustedUids.size(); ++i) {
+        if (trustedUids[i] == uid) {
+            return true;
+        }
+    }
+    return false;
 }
 
 void DrmManagerService::instantiate() {