summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrunal Soni <ksoni@codeaurora.org>2017-10-03 14:25:22 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-10-06 12:14:12 -0700
commit3e463ada0ef526bb3ead04c707d6cb20e6117174 (patch)
treeb24d81ac0df78a5b05d9277d73e09da9f0b1acd7
parent2476b361be8df6453a37ee0a2b87c8812d1a0dca (diff)
qcacld-3.0: Initialize roam id to invalid value
Current driver has roam id uninitialized in anticipation that roam id will be filled by SME APIs to correct value but in error conditions that value may not be filled at all. In those kind of cases initializing to invalid value will help to avoid any security breach. CRs-Fixed: 2119198 Change-Id: I96e55cb91ef76df63dd6ba267130e1092fdcf899
-rw-r--r--core/cds/src/cds_concurrency.c4
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c8
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c4
-rw-r--r--core/hdd/src/wlan_hdd_ioctl.c2
-rw-r--r--core/hdd/src/wlan_hdd_wext.c4
-rw-r--r--core/sap/src/sap_module.c2
-rw-r--r--core/sme/inc/sme_api.h1
7 files changed, 13 insertions, 12 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index 2e778e9d96c9..43847a1afa7a 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -7254,7 +7254,7 @@ static bool cds_sta_p2pgo_concur_handle(hdd_adapter_t *sta_adapter,
if (true == cds_is_sta_connection_pending()) {
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CLEAR_JOIN_REQ,
- sta_adapter->sessionId, *roam_id));
+ sta_adapter->sessionId, 0));
ret = sme_clear_joinreq_param(
WLAN_HDD_GET_HAL_CTX(sta_adapter),
sta_adapter->sessionId);
@@ -7267,7 +7267,7 @@ static bool cds_sta_p2pgo_concur_handle(hdd_adapter_t *sta_adapter,
}
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_STORE_JOIN_REQ,
- sta_adapter->sessionId, *roam_id));
+ sta_adapter->sessionId, 0));
/* store the scan cache here */
ret = sme_store_joinreq_param(
WLAN_HDD_GET_HAL_CTX(sta_adapter),
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 81cd8d938dd7..6ba75fa75499 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -12594,7 +12594,7 @@ void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t *pAdapter, uint8_t key_index,
tCsrRoamSetKey setKey;
bool isConnected = true;
int status = 0;
- uint32_t roamId = 0xFF;
+ uint32_t roamId = INVALID_ROAM_ID;
uint8_t *pKeyPtr = NULL;
hdd_debug("Device_mode %s(%d)",
@@ -13500,7 +13500,7 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(ndev);
tCsrRoamSetKey setKey;
int status;
- uint32_t roamId = 0xFF;
+ uint32_t roamId = INVALID_ROAM_ID;
hdd_hostapd_state_t *pHostapdState;
QDF_STATUS qdf_ret_status;
hdd_context_t *pHddCtx;
@@ -14027,7 +14027,7 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
* then update the default key index */
tCsrRoamSetKey setKey;
- uint32_t roamId = 0xFF;
+ uint32_t roamId = INVALID_ROAM_ID;
tCsrKeys *Keys = &pWextState->roamProfile.Keys;
hdd_debug("Default tx key index %d", key_index);
@@ -14912,7 +14912,7 @@ static int wlan_hdd_cfg80211_connect_start(hdd_adapter_t *pAdapter,
hdd_wext_state_t *pWextState;
hdd_context_t *pHddCtx;
hdd_station_ctx_t *hdd_sta_ctx;
- uint32_t roamId;
+ uint32_t roamId = INVALID_ROAM_ID;
tCsrRoamProfile *pRoamProfile;
eCsrAuthType RSNAuthType;
tSmeConfigParams *sme_config;
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 8c1fa6bbaa1b..3bdd08d755dd 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -730,7 +730,7 @@ static void hdd_issue_stored_joinreq(hdd_adapter_t *sta_adapter,
hdd_context_t *hdd_ctx)
{
tHalHandle hal_handle;
- uint32_t roam_id;
+ uint32_t roam_id = INVALID_ROAM_ID;
if (NULL == sta_adapter) {
hdd_err("Invalid station adapter, ignore issueing join req");
@@ -741,7 +741,7 @@ static void hdd_issue_stored_joinreq(hdd_adapter_t *sta_adapter,
if (true == cds_is_sta_connection_pending()) {
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_ISSUE_JOIN_REQ,
- sta_adapter->sessionId, roam_id));
+ sta_adapter->sessionId, 0));
if (QDF_STATUS_SUCCESS !=
sme_issue_stored_joinreq(hal_handle,
&roam_id,
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index 36ffacc5dce6..9addef2a4aac 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -4482,7 +4482,7 @@ static int drv_cmd_fast_reassoc(hdd_adapter_t *adapter,
uint8_t *value = command;
uint8_t channel = 0;
tSirMacAddr targetApBssid;
- uint32_t roamId = 0;
+ uint32_t roamId = INVALID_ROAM_ID;
tCsrRoamModifyProfileFields modProfileFields;
tCsrHandoffRequest handoffInfo;
hdd_station_ctx_t *pHddStaCtx;
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index aa5d083926c5..b82aef4b34c3 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -6780,7 +6780,7 @@ static int __iw_set_encodeext(struct net_device *dev,
int key_index;
struct iw_point *encoding = &wrqu->encoding;
tCsrRoamSetKey setKey;
- uint32_t roamId = 0xFF;
+ uint32_t roamId = INVALID_ROAM_ID;
ENTER_DEV(dev);
@@ -10380,7 +10380,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
tSirMacAddr bssid;
- uint32_t roamId = 0;
+ uint32_t roamId = INVALID_ROAM_ID;
uint8_t operating_ch =
adapter->sessionCtx.station.conn_info.operationChannel;
tCsrRoamModifyProfileFields modProfileFields;
diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c
index 8b6172e6125e..307e643964a2 100644
--- a/core/sap/src/sap_module.c
+++ b/core/sap/src/sap_module.c
@@ -1905,7 +1905,7 @@ QDF_STATUS wlansap_set_key_sta(void *pCtx, tCsrRoamSetKey *pSetKeyInfo)
ptSapContext pSapCtx = NULL;
void *hHal = NULL;
QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE;
- uint32_t roamId = 0xFF;
+ uint32_t roamId = INVALID_ROAM_ID;
pSapCtx = CDS_GET_SAP_CB(pCtx);
if (NULL == pSapCtx) {
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 0cd43f72dde9..170b81ad981b 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -79,6 +79,7 @@
#define SME_SESSION_ID_ANY 50
#define SME_INVALID_COUNTRY_CODE "XX"
+#define INVALID_ROAM_ID 0
#define SME_SET_CHANNEL_REG_POWER(reg_info_1, val) do { \
reg_info_1 &= 0xff00ffff; \