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:54:11 +0000 (14:54 -0800)
commit249c55ec7d100d42faf8d37292f4b9f38122386d
tree74bd1c3013aeb409ed756e312ab21a85e2d67093
parent0929eb918071c1e76fd41b677af0973412f8a098
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: Iae9c273af822b18c2e6fce04848a86f8dea6410a
Merged-In: I8a1575dedd6e3b7a8b60ee2ffd475d790aec55c4
Merged-In: I2da730feda4d7ebed1f158b073167bb3964b3e7d
(cherry picked from commit d0205a3469dc8d8122e89072c19d0e9f18e7452f)
services/core/java/com/android/server/connectivity/PermissionMonitor.java