summaryrefslogtreecommitdiff
path: root/src/com/android/server/NetworkStackService.java
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2019-06-04 16:23:23 +0900
committerRemi NGUYEN VAN <reminv@google.com>2019-06-04 16:26:00 +0900
commit8eb2a9143f31f0c2875438e00808f9aefe4753ab (patch)
tree3fb4f50e0b2a0eb815c43aed05a7c1be945e55e8 /src/com/android/server/NetworkStackService.java
parent6ae25aa680a3d9d198f98c3a1ba7862037af7c4c (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 (patched automatically from Ib848aaaedfd599c1d4437378846c7dda74352019) (command: git -C [qt repo] show -p 4895c5 | patch -p3) Merged-In: I1205ae4b1062fe78f1e2283d6c308caa58651e86 Change-Id: I42215bd8b14d66d0150e7dac04fbb28feef991a6
Diffstat (limited to 'src/com/android/server/NetworkStackService.java')
-rw-r--r--src/com/android/server/NetworkStackService.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/server/NetworkStackService.java b/src/com/android/server/NetworkStackService.java
index c394d4c..91cc8c3 100644
--- a/src/com/android/server/NetworkStackService.java
+++ b/src/com/android/server/NetworkStackService.java
@@ -189,6 +189,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);
@@ -197,6 +198,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);
@@ -222,6 +224,7 @@ public class NetworkStackService extends Service {
@Override
public void fetchIpMemoryStore(@NonNull final IIpMemoryStoreCallbacks cb)
throws RemoteException {
+ checkNetworkStackCallingPermission();
updateSystemAidlVersion(cb.getInterfaceVersion());
cb.onIpMemoryStoreFetched(mIpMemoryStoreService);
}