From 645af711aa6bc5ad940737f05cd3f585380848d3 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Mon, 16 Sep 2019 16:29:50 +0530 Subject: [PATCH] qcacld-3.0: Validate tdls sta id in del station command Currently sta id validation is not there in del station command for tdls. There could be a case where peer is there but sta id is not valid. Consider a case where there is tdls connection between 2 p2p clients and one of the client decided to connect to SAE AP, this brings up concurrency scenario on that client for p2p client and station, so tdls connection should be tear down. device tear down the tdls link and inform the supplicant regarding the same. Now in the driver scheduler, connect command is there which is queued when device tries to connect to SAE AP, this command gets a chance to execute. When SAE connection is executed, driver gets a command from supplicant to disable tdls links for the previous connection which is already teardown, this command is queued into scheduler which blocks the supplicant thread. For SAE connection to get complete driver waits for auth request from supplicant. Here supplicant waits for the tdls disable link command's response which will never come as driver waits for SAE authentication which leads to deadlock. To address above issue, add a check to validate sta id before queing tdls down link command to scheduler, if the sta id is invalid, return response to supplicant as tdls peer is already deleted. Change-Id: Ie983aa9f217c0d7b4508639bb33ad1a44b3675c7 CRs-Fixed: 2521529 --- components/tdls/core/src/wlan_tdls_cmds_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tdls/core/src/wlan_tdls_cmds_process.c b/components/tdls/core/src/wlan_tdls_cmds_process.c index a4e4fafa54d4..985be6918a2b 100644 --- a/components/tdls/core/src/wlan_tdls_cmds_process.c +++ b/components/tdls/core/src/wlan_tdls_cmds_process.c @@ -1161,7 +1161,7 @@ QDF_STATUS tdls_process_del_peer(struct tdls_oper_request *req) mac = req->peer_addr; peer = tdls_find_peer(vdev_obj, mac); - if (!peer) { + if (!peer || !(TDLS_STA_INDEX_CHECK((peer->sta_id)))) { tdls_err(QDF_MAC_ADDR_STR " not found, ignore NL80211_TDLS_ENABLE_LINK", QDF_MAC_ADDR_ARRAY(mac));