From ff782fbcd8d2662852d838b73f5c0e8811b55118 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Thu, 10 Oct 2019 18:37:24 +0530 Subject: [PATCH] qcacld-3.0: Clear PTK and GTK install flags in disconnect handler PTK and GTK are installed to firmware and installation status of each key is maintained in driver. Data transmission is allowed only if both the keys are installed. Currently these flags are getting cleared after installing both ptk and gtk to firmware. But if one key is installed and the other key is not installed due to some reason(e.g. connection abort), corresponding status is not cleared and being referred in the next connection attempt. This is causing the data transmission to happen from driver to firmware after installing GTK before installing PTK, as the ptk_installed from previous connection is still set. This is not allowed by firmware and issues an assertion. PTK and GTK are invalid once the station disconnects. So reset the flags as part of connection info cleanup. Reset the flags before issuing connection also to avoid usage of previous connect status or garbage values. Change-Id: I8fa7bd0a15eab2fed80f050e77df3554d0f1b73a CRs-Fixed: 2542785 --- core/hdd/src/wlan_hdd_assoc.c | 7 +++++++ core/hdd/src/wlan_hdd_cfg80211.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 2206a5244632..8f2177b59ee3 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1535,6 +1535,13 @@ static void hdd_conn_remove_connect_info(struct hdd_station_ctx *sta_ctx) sta_ctx->conn_info.proxy_arp_service = 0; qdf_mem_zero(&sta_ctx->conn_info.ssid, sizeof(tCsrSSIDInfo)); + + /* + * Reset the ptk, gtk status flags to avoid using current connection + * status in further connections. + */ + sta_ctx->conn_info.gtk_installed = false; + sta_ctx->conn_info.ptk_installed = false; } /** diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2a5234174e0b..30d551cf5b32 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -17775,6 +17775,13 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, qdf_mem_zero(&hdd_sta_ctx->conn_info.conn_flag, sizeof(hdd_sta_ctx->conn_info.conn_flag)); + /* + * Reset the ptk, gtk status flags to avoid using old/previous + * connection status. + */ + hdd_sta_ctx->conn_info.gtk_installed = false; + hdd_sta_ctx->conn_info.ptk_installed = false; + roam_profile = hdd_roam_profile(adapter); if (roam_profile) { struct hdd_station_ctx *sta_ctx;