From 89b0dce2fbefd1a96540947c020142d0d12ff71a Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Fri, 18 May 2018 12:49:43 +0530 Subject: [PATCH] qcacld-3.0: Process DO_ACS vendor command only in SAP/P2P_GO mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While processing DO_ACS vendor command session context, which is of type union holds either station's or SAP's session, is updated without checking adapter’s mode. This may lead to corrupt station's session context if DO_ACS is invoked with station adapter. Validate adapter mode and process DO_ACS vendor commands only if the mode is SAP/P2P_GO. Change-Id: Id99ba126fcfa1f06f68b89d4627c029948a201c5 CRs-Fixed: 2237661 --- core/hdd/src/wlan_hdd_cfg80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index f727e6628359..afc54ac8eedb 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2373,7 +2373,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, if (ret) return ret; - if (adapter->device_mode != QDF_SAP_MODE) { + if (!((adapter->device_mode == QDF_SAP_MODE) || + (adapter->device_mode == QDF_P2P_GO_MODE))) { hdd_err("Invalid device mode %d", adapter->device_mode); return -EINVAL; }