DivestOS/Patches/Linux_CVEs/CVE-2016-2472/ANY/0001.patch
2017-11-07 17:32:46 -05:00

399 lines
15 KiB
Diff

From 464c9c8a984c3a36f63b1625d7ab2a1c9eec9697 Mon Sep 17 00:00:00 2001
From: Girish Gowli <c_ggowli@qti.qualcomm.com>
Date: Mon, 9 Jun 2014 19:47:53 +0530
Subject: wlan: Deprecate all WAPI ioctls
ALL WAPI ioctls WLAN_PRIV_SET_WAPI_MODE, WLAN_PRIV_GET_WAPI_MODE
WLAN_PRIV_SET_WAPI_ASSOC_INFO, WLAN_PRIV_SET_WAPI_KEY,
WLAN_PRIV_SET_WAPI_BKID, WLAN_PRIV_GET_WAPI_BKID are not being
used, hence removing the source code related to all these ioctls
Change-Id: I204cd579b4e29df7e995f30cc0aa8612bc7965ee
CRs-Fixed: 677410
---
CORE/HDD/src/wlan_hdd_wext.c | 347 +------------------------------------------
1 file changed, 6 insertions(+), 341 deletions(-)
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 4af981f..8949474 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -244,17 +244,12 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2},
#define WLAN_PRIV_DEL_TSPEC (SIOCIWFIRSTPRIV + 11)
#define WLAN_PRIV_GET_TSPEC (SIOCIWFIRSTPRIV + 13)
-#ifdef FEATURE_WLAN_WAPI
-/* Private ioctls EVEN NO: SET, ODD NO:GET */
-#define WLAN_PRIV_SET_WAPI_MODE (SIOCIWFIRSTPRIV + 8)
-#define WLAN_PRIV_GET_WAPI_MODE (SIOCIWFIRSTPRIV + 16)
-#define WLAN_PRIV_SET_WAPI_ASSOC_INFO (SIOCIWFIRSTPRIV + 10)
-#define WLAN_PRIV_SET_WAPI_KEY (SIOCIWFIRSTPRIV + 12)
-#define WLAN_PRIV_SET_WAPI_BKID (SIOCIWFIRSTPRIV + 14)
-#define WLAN_PRIV_GET_WAPI_BKID (SIOCIWFIRSTPRIV + 15)
-#define WAPI_PSK_AKM_SUITE 0x02721400
-#define WAPI_CERT_AKM_SUITE 0x01721400
-#endif
+/* (SIOCIWFIRSTPRIV + 8) is currently unused */
+/* (SIOCIWFIRSTPRIV + 16) is currently unused */
+/* (SIOCIWFIRSTPRIV + 10) is currently unused */
+/* (SIOCIWFIRSTPRIV + 12) is currently unused */
+/* (SIOCIWFIRSTPRIV + 14) is currently unused */
+/* (SIOCIWFIRSTPRIV + 15) is currently unused */
#ifdef FEATURE_OEM_DATA_SUPPORT
/* Private ioctls for setting the measurement configuration */
@@ -5797,290 +5792,6 @@ static int iw_get_tspec(struct net_device *dev, struct iw_request_info *info,
return 0;
}
-
-#ifdef FEATURE_WLAN_WAPI
-static int iw_qcom_set_wapi_mode(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
- hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter);
- hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- tCsrRoamProfile *pRoamProfile = &pWextState->roamProfile;
-
- WAPI_FUNCTION_MODE *pWapiMode = (WAPI_FUNCTION_MODE *)extra;
-
- hddLog(LOG1, "The function iw_qcom_set_wapi_mode called");
- hddLog(LOG1, "%s: Received data %s", __func__, extra);
- hddLog(LOG1, "%s: Received length %d", __func__, wrqu->data.length);
- hddLog(LOG1, "%s: Input Data (wreq) WAPI Mode:%02d", __func__, pWapiMode->wapiMode);
-
- if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
- "%s:LOGP in Progress. Ignore!!!", __func__);
- return -EBUSY;
- }
-
- if(WZC_ORIGINAL == pWapiMode->wapiMode) {
- hddLog(LOG1, "%s: WAPI Mode Set to OFF", __func__);
- /* Set Encryption mode to defualt , this allows next successfull non-WAPI Association */
- pRoamProfile->EncryptionType.numEntries = 1;
- pRoamProfile->EncryptionType.encryptionType[0] = eCSR_ENCRYPT_TYPE_NONE;
- pRoamProfile->mcEncryptionType.numEntries = 1;
- pRoamProfile->mcEncryptionType.encryptionType[0] = eCSR_ENCRYPT_TYPE_NONE;
-
- pRoamProfile->AuthType.numEntries = 1;
- pHddStaCtx->conn_info.authType = eCSR_AUTH_TYPE_OPEN_SYSTEM;
- pRoamProfile->AuthType.authType[0] = pHddStaCtx->conn_info.authType;
- }
- else if(WAPI_EXTENTION == pWapiMode->wapiMode) {
- hddLog(LOG1, "%s: WAPI Mode Set to ON", __func__);
- }
- else
- return -EINVAL;
-
- pAdapter->wapi_info.nWapiMode = pWapiMode->wapiMode;
-
- return 0;
-}
-
-static int iw_qcom_get_wapi_mode(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
- WAPI_FUNCTION_MODE *pWapiMode = (WAPI_FUNCTION_MODE *)(extra);
-
- if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
- "%s:LOGP in Progress. Ignore!!!", __func__);
- return -EBUSY;
- }
- hddLog(LOG1, "The function iw_qcom_get_wapi_mode called");
-
- pWapiMode->wapiMode = pAdapter->wapi_info.nWapiMode;
- hddLog(LOG1, "%s: GET WAPI Mode Value:%02d", __func__, pWapiMode->wapiMode);
- return 0;
-}
-
-static int iw_qcom_set_wapi_assoc_info(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-// WAPI_AssocInfo *pWapiAssocInfo = (WAPI_AssocInfo *)(wrqu->data.pointer);
- WAPI_AssocInfo *pWapiAssocInfo = (WAPI_AssocInfo *)(extra);
- int i = 0, j = 0;
- hddLog(LOG1, "The function iw_qcom_set_wapi_assoc_info called");
- hddLog(LOG1, "%s: Received length %d", __func__, wrqu->data.length);
- hddLog(LOG1, "%s: Received data %s", __func__, (char*)extra);
-
- if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
- "%s:LOGP in Progress. Ignore!!!", __func__);
- return -EBUSY;
- }
-
- if (NULL == pWapiAssocInfo)
- {
- VOS_TRACE(VOS_MODULE_ID_SYS, VOS_TRACE_LEVEL_ERROR,
- "%s: WDA NULL context", __func__);
- VOS_ASSERT(0);
- return VOS_STATUS_E_FAILURE;
- }
-
- hddLog(LOG1, "%s: INPUT DATA:\nElement ID:0x%02x Length:0x%02x Version:0x%04x",__func__,pWapiAssocInfo->elementID,pWapiAssocInfo->length,pWapiAssocInfo->version);
- hddLog(LOG1,"%s: akm Suite Cnt:0x%04x",__func__,pWapiAssocInfo->akmSuiteCount);
- for(i =0 ; i < 16 ; i++)
- hddLog(LOG1,"akm suite[%02d]:0x%08x",i,pWapiAssocInfo->akmSuite[i]);
-
- hddLog(LOG1,"%s: Unicast Suite Cnt:0x%04x",__func__,pWapiAssocInfo->unicastSuiteCount);
- for(i =0 ; i < 16 ; i++)
- hddLog(LOG1, "Unicast suite[%02d]:0x%08x",i,pWapiAssocInfo->unicastSuite[i]);
-
- hddLog(LOG1,"%s: Multicast suite:0x%08x Wapi capa:0x%04x",__func__,pWapiAssocInfo->multicastSuite,pWapiAssocInfo->wapiCability);
- hddLog(LOG1, "%s: BKID Cnt:0x%04x",__func__,pWapiAssocInfo->bkidCount);
- for(i = 0 ; i < 16 ; i++) {
- hddLog(LOG1, "BKID List[%02d].bkid:0x",i);
- for(j = 0 ; j < 16 ; j++)
- hddLog(LOG1,"%02x",pWapiAssocInfo->bkidList[i].bkid[j]);
- }
-
- /* We are not using the entire IE as provided by the supplicant.
- * This is being calculated by SME. This is the same as in the
- * case of WPA. Only the auth mode information needs to be
- * extracted here*/
- if ( pWapiAssocInfo->akmSuite[0] == WAPI_PSK_AKM_SUITE ) {
- hddLog(LOG1, "%s: WAPI AUTH MODE SET TO PSK",__func__);
- pAdapter->wapi_info.wapiAuthMode = WAPI_AUTH_MODE_PSK;
- }
-
- if ( pWapiAssocInfo->akmSuite[0] == WAPI_CERT_AKM_SUITE) {
- hddLog(LOG1, "%s: WAPI AUTH MODE SET TO CERTIFICATE",__func__);
- pAdapter->wapi_info.wapiAuthMode = WAPI_AUTH_MODE_CERT;
- }
- return 0;
-}
-
-static int iw_qcom_set_wapi_key(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
- hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
- eHalStatus halStatus = eHAL_STATUS_SUCCESS;
- tANI_U32 roamId = 0xFF;
- tANI_U8 *pKeyPtr = NULL;
- v_BOOL_t isConnected = TRUE;
- tCsrRoamSetKey setKey;
- int i = 0;
- WLAN_WAPI_KEY *pWapiKey = (WLAN_WAPI_KEY *)(extra);
-
- if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
- "%s:LOGP in Progress. Ignore!!!", __func__);
- return -EBUSY;
- }
-
- hddLog(LOG1, "The function iw_qcom_set_wapi_key called ");
- hddLog(LOG1, "%s: Received length %d", __func__, wrqu->data.length);
- hddLog(LOG1, "%s: Received data %s", __func__, (char*)extra);
-
- hddLog(LOG1,":%s: INPUT DATA:\nKey Type:0x%02x Key Direction:0x%02x KEY ID:0x%02x", __func__, pWapiKey->keyType, pWapiKey->keyDirection, pWapiKey->keyId);
- hddLog(LOG1,"Add Index:0x");
- for(i =0 ; i < 12 ; i++)
- hddLog(LOG1,"%02x",pWapiKey->addrIndex[i]);
-
- hddLog(LOG1,"%s: WAPI ENCRYPTION KEY LENGTH:0x%04x", __func__,pWapiKey->wpiekLen);
- hddLog(LOG1, "WAPI ENCRYPTION KEY:0x");
- for(i =0 ; i < 16 ; i++)
- hddLog(LOG1,"%02x",pWapiKey->wpiek[i]);
-
- hddLog(LOG1,"%s: WAPI INTEGRITY CHECK KEY LENGTH:0x%04x", __func__,pWapiKey->wpickLen);
- hddLog(LOG1,"WAPI INTEGRITY CHECK KEY:0x");
- for(i =0 ; i < 16 ; i++)
- hddLog(LOG1,"%02x",pWapiKey->wpick[i]);
-
- hddLog(LOG1,"WAPI PN NUMBER:0x");
- for(i = 0 ; i < 16 ; i++)
- hddLog(LOG1,"%02x",pWapiKey->pn[i]);
-
- // Clear the setkey memory
- vos_mem_zero(&setKey,sizeof(tCsrRoamSetKey));
- // Store Key ID
- setKey.keyId = (unsigned char)( pWapiKey->keyId );
- // SET WAPI Encryption
- setKey.encType = eCSR_ENCRYPT_TYPE_WPI;
- // Key Directionn both TX and RX
- setKey.keyDirection = eSIR_TX_RX; // Do WE NEED to update this based on Key Type as GRP/UNICAST??
- // the PAE role
- setKey.paeRole = 0 ;
-
- switch ( pWapiKey->keyType )
- {
- case PAIRWISE_KEY:
- {
- isConnected = hdd_connIsConnected(pHddStaCtx);
- vos_mem_copy(setKey.peerMac,&pHddStaCtx->conn_info.bssId,WNI_CFG_BSSID_LEN);
- break;
- }
- case GROUP_KEY:
- {
- vos_set_macaddr_broadcast( (v_MACADDR_t *)setKey.peerMac );
- break;
- }
- default:
- {
- //Any other option is invalid.
- VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
- "[%4d] %s() failed to Set Key. Invalid key type %d", __LINE__,__func__ , -1 );
-
- hddLog(LOGE," %s: Error WAPI Key Add Type",__func__);
- halStatus = !eHAL_STATUS_SUCCESS; // NEED TO UPDATE THIS WITH CORRECT VALUE
- break; // NEED RETURN FROM HERE ????
- }
- }
-
- // Concatenating the Encryption Key (EK) and the MIC key (CK): EK followed by CK
- setKey.keyLength = (v_U16_t)((pWapiKey->wpiekLen)+(pWapiKey->wpickLen));
- pKeyPtr = setKey.Key;
- memcpy( pKeyPtr, pWapiKey->wpiek, pWapiKey->wpiekLen );
- pKeyPtr += pWapiKey->wpiekLen;
- memcpy( pKeyPtr, pWapiKey->wpick, pWapiKey->wpickLen );
-
- // Set the new key with SME.
- pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_SETTING_KEY;
-
- if ( isConnected ) {
- halStatus = sme_RoamSetKey( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, &setKey, &roamId );
- if ( halStatus != eHAL_STATUS_SUCCESS )
- {
- VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
- "[%4d] sme_RoamSetKey returned ERROR status= %d", __LINE__, halStatus );
-
- pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE;
- }
- }
-#if 0 /// NEED TO CHECK ON THIS
- else
- {
- // Store the keys in the adapter to be moved to the profile & passed to
- // SME in the ConnectRequest if we are not yet in connected state.
- memcpy( &pAdapter->setKey[ setKey.keyId ], &setKey, sizeof( setKey ) );
- pAdapter->fKeySet[ setKey.keyId ] = TRUE;
-
- VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED,
- " Saving key [idx= %d] to apply when moving to connected state ",
- setKey.keyId );
-
- }
-#endif
- return halStatus;
-}
-
-static int iw_qcom_set_wapi_bkid(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-#ifdef WLAN_DEBUG
- int i = 0;
- WLAN_BKID_LIST *pBkid = ( WLAN_BKID_LIST *) extra;
-#endif
-
- hddLog(LOG1, "The function iw_qcom_set_wapi_bkid called");
- hddLog(LOG1, "%s: Received length %d", __func__, wrqu->data.length);
- hddLog(LOG1, "%s: Received data %s", __func__, (char*)extra);
-
- hddLog(LOG1,"%s: INPUT DATA:\n BKID Length:0x%08x", __func__,pBkid->length);
- hddLog(LOG1,"%s: BKID Cnt:0x%04x", __func__, pBkid->BKIDCount);
-
- hddLog(LOG1,"BKID KEY LIST[0]:0x");
-
- if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress)
- {
- VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
- "%s:LOGP in Progress. Ignore!!!", __func__);
- return -EBUSY;
- }
-
-#ifdef WLAN_DEBUG
- for(i =0 ; i < 16 ; i++)
- hddLog(LOG1,"%02x",pBkid->BKID[0].bkid[i]);
-#endif
-
- return 0;
-}
-
-static int iw_qcom_get_wapi_bkid(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- /* Yet to implement this function, 19th April 2010 */
- hddLog(LOG1, "The function iw_qcom_get_wapi_bkid called ");
-
- return 0;
-}
-#endif /* FEATURE_WLAN_WAPI */
-
#ifdef WLAN_FEATURE_VOWIFI_11R
//
//
@@ -7801,14 +7512,6 @@ static const iw_handler we_private[] = {
[WLAN_PRIV_GET_OEM_DATA_RSP - SIOCIWFIRSTPRIV] = iw_get_oem_data_rsp, //oem data req Specifc
#endif
-#ifdef FEATURE_WLAN_WAPI
- [WLAN_PRIV_SET_WAPI_MODE - SIOCIWFIRSTPRIV] = iw_qcom_set_wapi_mode,
- [WLAN_PRIV_GET_WAPI_MODE - SIOCIWFIRSTPRIV] = iw_qcom_get_wapi_mode,
- [WLAN_PRIV_SET_WAPI_ASSOC_INFO - SIOCIWFIRSTPRIV] = iw_qcom_set_wapi_assoc_info,
- [WLAN_PRIV_SET_WAPI_KEY - SIOCIWFIRSTPRIV] = iw_qcom_set_wapi_key,
- [WLAN_PRIV_SET_WAPI_BKID - SIOCIWFIRSTPRIV] = iw_qcom_set_wapi_bkid,
- [WLAN_PRIV_GET_WAPI_BKID - SIOCIWFIRSTPRIV] = iw_qcom_get_wapi_bkid,
-#endif /* FEATURE_WLAN_WAPI */
#ifdef WLAN_FEATURE_VOWIFI_11R
[WLAN_PRIV_SET_FTIES - SIOCIWFIRSTPRIV] = iw_set_fties,
#endif
@@ -8214,44 +7917,6 @@ static const struct iw_priv_args we_private_args[] = {
"get_oem_data_rsp" },
#endif
-#ifdef FEATURE_WLAN_WAPI
- /* handlers for main ioctl SET_WAPI_MODE */
- { WLAN_PRIV_SET_WAPI_MODE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- 0,
- "SET_WAPI_MODE" },
-
- /* handlers for main ioctl GET_WAPI_MODE */
- { WLAN_PRIV_GET_WAPI_MODE,
- 0,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "GET_WAPI_MODE" },
-
- /* handlers for main ioctl SET_ASSOC_INFO */
- { WLAN_PRIV_SET_WAPI_ASSOC_INFO,
- IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 400,
- 0,
- "SET_WAPI_ASSOC" },
-
- /* handlers for main ioctl SET_WAPI_KEY */
- { WLAN_PRIV_SET_WAPI_KEY,
- IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 71,
- 0,
- "SET_WAPI_KEY" },
-
- /* handlers for main ioctl SET_WAPI_BKID */
- { WLAN_PRIV_SET_WAPI_BKID,
- IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 24,
- 0,
- "SET_WAPI_BKID" },
-
- /* handlers for main ioctl GET_WAPI_BKID */
- { WLAN_PRIV_GET_WAPI_BKID,
- 0,
- IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 24,
- "GET_WAPI_BKID" },
-#endif /* FEATURE_WLAN_WAPI */
-
/* handlers for main ioctl - host offload */
{
WLAN_PRIV_SET_HOST_OFFLOAD,
--
cgit v1.1