OSDN Git Service

Fix security problem on PermissionMonitor#hasPermission
authorpaulhu <paulhu@google.com>
Mon, 16 Dec 2019 10:24:05 +0000 (18:24 +0800)
committerVasyl Gello <vasek.gello@gmail.com>
Tue, 3 Mar 2020 11:50:09 +0000 (11:50 +0000)
commitcaf3c62161d2a0562d54d53088cad8490782f2d7
tree44dbd38d25a161a8e5e80d8ed99e02338f70cb7f
parent2dbe94c04016199ddc9a2569b11f96862248b1c3
Fix security problem on PermissionMonitor#hasPermission

PermissionMonitor#hasPermission only checks permssions that app
requested but it doesn't check whether the permission can be
granted to this app. If requested permission doens't be granted
to app, this method still returns that app has this permission.
Then PermissionMonitor will pass this info to netd that means
this app still can use network even restricted network without
granted privileged permission like CONNECTIVITY_INTERNAL or
CONNECTIVITY_USE_RESTRICTED_NETWORKS.

Bug: 144679405
Test: Build, flash, manual test
Change-Id: I5eba4909e4c2e1d9f275f66be90ac36466b93e90
Merged-In: I8a1575dedd6e3b7a8b60ee2ffd475d790aec55c4
Merged-In: Iae9c273af822b18c2e6fce04848a86f8dea6410a
(cherry picked from commit 305946b910a9ab3974daa4277f155614a3fc27a4)
services/core/java/com/android/server/connectivity/PermissionMonitor.java