hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/net/wireless/rockchip_wlan/rtl8723cs/core/rtw_mlme_ext.c
....@@ -2781,10 +2781,6 @@
27812781 goto authclnt_fail;
27822782 }
27832783
2784
- if (len > sizeof(pmlmeinfo->chg_txt)) {
2785
- goto authclnt_fail;
2786
- }
2787
-
27882784 _rtw_memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len);
27892785 pmlmeinfo->auth_seq = 3;
27902786 issue_auth(padapter, NULL, 0);
....@@ -4686,7 +4682,6 @@
46864682 /* Try to get the device password ID from the WPS IE of group negotiation request frame */
46874683 /* WiFi Direct test plan 5.1.15 */
46884684 rtw_get_wps_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, wpsie, &wpsielen);
4689
- wps_devicepassword_id_len = sizeof(wps_devicepassword_id);
46904685 rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_DEVICE_PWID, (u8 *) &wps_devicepassword_id, &wps_devicepassword_id_len);
46914686 wps_devicepassword_id = be16_to_cpu(wps_devicepassword_id);
46924687
....@@ -6788,11 +6783,9 @@
67886783
67896784 merged_p2p_ielen = rtw_p2p_merge_ies(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, merged_p2pie);
67906785
6791
- attr_contentlen = sizeof(invitation_flag);
67926786 rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_INVITATION_FLAGS, &invitation_flag, &attr_contentlen);
67936787 if (attr_contentlen) {
67946788
6795
- attr_contentlen = sizeof(pwdinfo->p2p_peer_interface_addr);
67966789 rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_BSSID, pwdinfo->p2p_peer_interface_addr, &attr_contentlen);
67976790 /* Commented by Albert 20120510 */
67986791 /* Copy to the pwdinfo->p2p_peer_interface_addr. */
....@@ -6811,7 +6804,6 @@
68116804 /* Re-invoke the persistent group. */
68126805
68136806 _rtw_memset(&group_id, 0x00, sizeof(struct group_id_info));
6814
- attr_contentlen = sizeof(struct group_id_info);
68156807 rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen);
68166808 if (attr_contentlen) {
68176809 if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) {
....@@ -6823,7 +6815,6 @@
68236815 /* The p2p device sending this p2p invitation request wants to be the persistent GO. */
68246816 if (is_matched_in_profilelist(pwdinfo->p2p_peer_interface_addr, &pwdinfo->profileinfo[0])) {
68256817 u8 operatingch_info[5] = { 0x00 };
6826
- attr_contentlen = sizeof(operatingch_info);
68276818 if (rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_OPERATING_CH, operatingch_info,
68286819 &attr_contentlen)) {
68296820 if (rtw_chset_search_ch(adapter_to_chset(padapter), (u32)operatingch_info[4]) >= 0) {
....@@ -6867,7 +6858,6 @@
68676858 /* Received the invitation to join a P2P group. */
68686859
68696860 _rtw_memset(&group_id, 0x00, sizeof(struct group_id_info));
6870
- attr_contentlen = sizeof(struct group_id_info);
68716861 rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen);
68726862 if (attr_contentlen) {
68736863 if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) {
....@@ -6912,7 +6902,6 @@
69126902 _cancel_timer_ex(&pwdinfo->restore_p2p_state_timer);
69136903 p2p_ie = rtw_get_p2p_ie(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen);
69146904 if (p2p_ie) {
6915
- attr_contentlen = sizeof(attr_content);
69166905 rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen);
69176906
69186907 if (attr_contentlen == 1) {
....@@ -9402,8 +9391,6 @@
94029391 #endif /* CONFIG_IOCTL_CFG80211 */
94039392
94049393 pframe = rtw_set_ie(pframe, EID_WPA2, pIE->Length, pIE->data, &(pattrib->pktlen));
9405
- /* tmp: update rsn's spp related opt. */
9406
- rtw_set_spp_amsdu_mode(padapter->registrypriv.amsdu_mode, pframe - (pIE->Length + 2), pIE->Length +2);
94079394 }
94089395 break;
94099396 #ifdef CONFIG_80211N_HT
....@@ -10331,12 +10318,6 @@
1033110318 else /* TX AMSDU disabled */
1033210319 BA_para_set &= ~BIT(0);
1033310320 #endif
10334
- psta = rtw_get_stainfo(pstapriv, raddr);
10335
- if (psta != NULL) {
10336
- if (psta->flags & WLAN_STA_AMSDU_DISABLE)
10337
- BA_para_set &= ~BIT(0);
10338
- }
10339
-
1034010321 BA_para_set = cpu_to_le16(BA_para_set);
1034110322 pframe = rtw_set_fixed_ie(pframe, 2, (unsigned char *)(&(BA_para_set)), &(pattrib->pktlen));
1034210323
....@@ -10379,11 +10360,6 @@
1037910360 BA_para_set &= ~BIT(0);
1038010361 else if (pregpriv->rx_ampdu_amsdu == 1) /* enabled */
1038110362 BA_para_set |= BIT(0);
10382
- }
10383
- psta = rtw_get_stainfo(pstapriv, raddr);
10384
- if (psta != NULL) {
10385
- if (psta->flags & WLAN_STA_AMSDU_DISABLE)
10386
- BA_para_set &= ~BIT(0);
1038710363 }
1038810364
1038910365 BA_para_set = cpu_to_le16(BA_para_set);
....@@ -11265,7 +11241,6 @@
1126511241 u32 attr_contentlen = 0;
1126611242 u8 listen_ch[5] = { 0x00 };
1126711243
11268
- attr_contentlen = sizeof(listen_ch);
1126911244 rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_LISTEN_CH, listen_ch, &attr_contentlen);
1127011245 bssid->Configuration.DSConfig = listen_ch[4];
1127111246 } else {
....@@ -11397,8 +11372,7 @@
1139711372 #ifdef CONFIG_RTW_80211K
1139811373 p = rtw_get_ie(bssid->IEs + ie_offset, _EID_RRM_EN_CAP_IE_, &len, bssid->IELength - ie_offset);
1139911374 if (p)
11400
- _rtw_memcpy(bssid->PhyInfo.rm_en_cap, (p + 2), MIN(*(p + 1),
11401
- sizeof(bssid->PhyInfo.rm_en_cap)));
11375
+ _rtw_memcpy(bssid->PhyInfo.rm_en_cap, (p + 2), *(p + 1));
1140211376
1140311377 /* save freerun counter */
1140411378 bssid->PhyInfo.free_cnt = precv_frame->u.hdr.attrib.free_cnt;
....@@ -15123,20 +15097,6 @@
1512315097 return H2C_SUCCESS;
1512415098 }
1512515099
15126
-static u8 amsdu_spp_enable(_adapter *pdapter, enum security_type type)
15127
-{
15128
- u8 ret = _FALSE;
15129
-
15130
- if (pdapter->registrypriv.amsdu_mode == RTW_AMSDU_MODE_SPP) {
15131
- if ( type == _AES_ || type == _CCMP_256_
15132
- || type == _GCMP_ || type == _GCMP_256_ )
15133
- ret = _SUCCESS;
15134
- }
15135
-
15136
- return ret;
15137
-}
15138
-
15139
-
1514015100 /*
1514115101 SEC CAM Entry format (32 bytes)
1514215102 DW0 - MAC_ADDR[15:0] | Valid[15] | MFB[14:8] | RSVD[7] | GK[6] | MIC_KEY[5] | SEC_TYPE[4:2] | KID[1:0]
....@@ -15229,8 +15189,6 @@
1522915189 RTW_INFO_DUMP("GTK : ", pparm->key, sizeof(pparm->key));
1523015190 ctrl |= BIT(9);
1523115191 }
15232
- if (amsdu_spp_enable(padapter, pparm->algorithm) == _SUCCESS)
15233
- ctrl |= BIT(7);
1523415192
1523515193 write_cam(padapter, cam_id, ctrl, addr, pparm->key);
1523615194
....@@ -15378,12 +15336,8 @@
1537815336 RTW_INFO_DUMP("PTK : ", pparm->key, sizeof(pparm->key));
1537915337 ctrl |= BIT(9);
1538015338 }
15381
- if (amsdu_spp_enable(padapter, pparm->algorithm) == _SUCCESS)
15382
- ctrl |= BIT(7);
1538315339
1538415340 write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key);
15385
- if (!(pparm->gk))
15386
- ATOMIC_INC(&psta->keytrack); /*CVE-2020-24587*/
1538715341 }
1538815342 ret = H2C_SUCCESS_RSP;
1538915343