diff options
author | Etan Cohen <etancohen@google.com> | 2017-04-25 13:46:50 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-04-25 13:46:50 +0000 |
commit | fc927dffb22be14b003e3343646982cd2dab2d4e (patch) | |
tree | f0dd8c82aeb9440f1ce3c7f5857ed38c17af0f9a /service | |
parent | 3fe2643aff2fda817167e3274252ae183ecbbd85 (diff) | |
parent | d4965bdcb7c0ac8c443b058ea8eec9f232ea69e5 (diff) |
Merge "[AWARE] Add UID checking to WifiAware network specifier" am: 960b599df6 am: 7a8a570d36 am: d1d46404fe
am: d4965bdcb7
Change-Id: I0be89376ebf13f55a87f6e6a495641be59fe67e2
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/aware/WifiAwareDataPathStateManager.java | 9 |
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) |