OSDN Git Service

Fix security problem on PermissionMonitor#hasPermission
authorpaulhu <paulhu@google.com>
Mon, 16 Dec 2019 10:24:05 +0000 (18:24 +0800)
committerPaul Hu <paulhu@google.com>
Wed, 18 Dec 2019 03:47:28 +0000 (03:47 +0000)
commit305946b910a9ab3974daa4277f155614a3fc27a4
tree4e33e7cf550d8f498907838e60e453fbc203d295
parent0f41dc420fe5933ac70e9b85ab4f1ead845ab7da
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
services/core/java/com/android/server/connectivity/PermissionMonitor.java