From 3056b7418bfc37b601b52c90fcdd8cb1fd97e37e Mon Sep 17 00:00:00 2001 From: paulhu Date: Tue, 30 Mar 2021 10:55:37 +0800 Subject: [PATCH] Enforce ACCESS_NETWORK_STATE to getAvailableInterfaces() getAvailableInterfaces() will return available ethernet interfaces which are the information about networks. So it should enforce ACCESS_NETWORK_STATE permission check to ensure the applications are allowed to access the information. Bug: 174573778 Test: TetheringTests Test: CtsTetheringTest Change-Id: I7aaa5225d56f2feecc51ba263489ed0ce02fd651 --- .../src/com/android/server/ethernet/EthernetServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java b/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java index 3fc6aab758..c06f61e446 100644 --- a/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java +++ b/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java @@ -87,6 +87,8 @@ public class EthernetServiceImpl extends IEthernetManager.Stub { @Override public String[] getAvailableInterfaces() throws RemoteException { + enforceAccessPermission(); + return mTracker.getInterfaces(checkUseRestrictedNetworksPermission()); }