OSDN Git Service

Fix security problem on PermissionMonitor#hasPermission
authorpaulhu <paulhu@google.com>
Mon, 16 Dec 2019 10:24:05 +0000 (18:24 +0800)
committerGreg Wroblewski <musashi@google.com>
Fri, 10 Jan 2020 22:53:20 +0000 (14:53 -0800)
commit0eb5ec966f5af0c4d4ed68f1172d0acfd2e30bb3
tree5f0e90301c27c2db154b2c9c5cffaab2fcd50c02
parent71509777b4c16f9e42fae92a287c4287a2fd9a06
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