summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2017-04-25 13:40:49 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-25 13:40:49 +0000
commitd4965bdcb7c0ac8c443b058ea8eec9f232ea69e5 (patch)
treefc37bdf775222380834210cda65d89527eea2c6c /service
parent5896b01cb26e71c1102d17a0fa7baacd6e4d963a (diff)
parentd1d46404fec4dfb8d2de6b3a0e13a9f87e15bc8f (diff)
Merge "[AWARE] Add UID checking to WifiAware network specifier" am: 960b599df6 am: 7a8a570d36
am: d1d46404fe Change-Id: Ic02cb3057bb85a05cc82607c5f6d86406ac7d8b9
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java b/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java
index 14d855e00..723828d7f 100644
--- a/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java
+++ b/service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java
@@ -592,8 +592,6 @@ public class WifiAwareDataPathStateManager {
return true;
}
- // TODO: validate that the client ID actually comes from the correct process and is
- // not faked?
nnri = AwareNetworkRequestInformation.processNetworkSpecifier(networkSpecifier, mMgr);
if (nnri == null) {
Log.e(TAG, "WifiAwareNetworkFactory.acceptRequest: request=" + request
@@ -903,6 +901,13 @@ public class WifiAwareDataPathStateManager {
}
}
+ // validate UID
+ if (ns.requestorUid != uid) {
+ Log.e(TAG, "processNetworkSpecifier: networkSpecifier=" + ns.toString()
+ + " -- UID mismatch to clientId's uid=" + uid);
+ return null;
+ }
+
// create container and populate
AwareNetworkRequestInformation nnri = new AwareNetworkRequestInformation();
nnri.state = (ns.role == WifiAwareManager.WIFI_AWARE_DATA_PATH_ROLE_INITIATOR)