diff options
author | Remi NGUYEN VAN <reminv@google.com> | 2019-05-30 16:25:13 +0900 |
---|---|---|
committer | Remi NGUYEN VAN <reminv@google.com> | 2019-05-30 17:26:03 +0900 |
commit | 3906704799e1a80275361bbaf5454130d00832f7 (patch) | |
tree | 9de541bc5ed1654d641124c2a4f09ab54ecc812d /src/com/android/server/NetworkStackService.java | |
parent | a5d9540c4407dd4f4f8942cdcdcfdda25524a8d9 (diff) |
Check system_server PID in NetworkStack calls
Add a check that callers with UID 1000 always have the same PID. This is
a proxy for checking that no system is designed to bind to the network
stack unless it is the system_server, as otherwise either the
system_server would start crashing, or that system would not have access
to binder calls.
Also remove access from PHONE_UID as it is not being used.
Test: Flashed, WiFi working, Bluetooth reverse tethering shows no
permission issue.
Bug: 133209255
Change-Id: Ib848aaaedfd599c1d4437378846c7dda74352019
Diffstat (limited to 'src/com/android/server/NetworkStackService.java')
-rw-r--r-- | src/com/android/server/NetworkStackService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/server/NetworkStackService.java b/src/com/android/server/NetworkStackService.java index 2fae0c7..9bf4457 100644 --- a/src/com/android/server/NetworkStackService.java +++ b/src/com/android/server/NetworkStackService.java @@ -195,6 +195,7 @@ public class NetworkStackService extends Service { @Override public void makeNetworkMonitor(Network network, String name, INetworkMonitorCallbacks cb) throws RemoteException { + checkNetworkStackCallingPermission(); updateSystemAidlVersion(cb.getInterfaceVersion()); final SharedLog log = addValidationLogs(network, name); final NetworkMonitor nm = new NetworkMonitor(mContext, cb, network, log); @@ -203,6 +204,7 @@ public class NetworkStackService extends Service { @Override public void makeIpClient(String ifName, IIpClientCallbacks cb) throws RemoteException { + checkNetworkStackCallingPermission(); updateSystemAidlVersion(cb.getInterfaceVersion()); final IpClient ipClient = new IpClient(mContext, ifName, cb, mObserverRegistry, this); @@ -228,6 +230,7 @@ public class NetworkStackService extends Service { @Override public void fetchIpMemoryStore(@NonNull final IIpMemoryStoreCallbacks cb) throws RemoteException { + checkNetworkStackCallingPermission(); updateSystemAidlVersion(cb.getInterfaceVersion()); cb.onIpMemoryStoreFetched(mIpMemoryStoreService); } |