Skip to contentSkip to conversation

patch "Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode" added to staging-testing

PATCH [email protected] 1 participant 1 message Jul 28, 2020

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-testing branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will be merged to the staging-next branch sometime soon, after it passes testing, and the merge window is open.

If you have any questions about this process, please let me know.

From 11536442a3b4e1de6890ea5e805908debb74f94a Mon Sep 17 00:00:00 2001
From: Dinghao Liu <[email protected]>
Date: Tue, 28 Jul 2020 15:21:51 +0800
Subject: Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

The variable authmode can be uninitialized. The danger would be if it equals to _WPA_IE_ID_ (0xdd) or _WPA2_IE_ID_ (0x33). We can avoid this by setting it to zero instead. This is the approach that was used in the rtl8723bs driver.

Fixes 7b464c9fa5cc ("staging: r8188eu: Add files for new driver - part 4")
Cc stable <[email protected]>
---
 drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_mlme.c +3 -1
index 5d7a749f1aac..d334dc335914 100644
@@ -1729,9 +1729,11 @@ int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
 	if ((ndisauthmode == Ndis802_11AuthModeWPA) ||
 	    (ndisauthmode == Ndis802_11AuthModeWPAPSK))
 		authmode = _WPA_IE_ID_;
-	if ((ndisauthmode == Ndis802_11AuthModeWPA2) ||
+	else if ((ndisauthmode == Ndis802_11AuthModeWPA2) ||
 	    (ndisauthmode == Ndis802_11AuthModeWPA2PSK))
 		authmode = _WPA2_IE_ID_;
+	else
+		authmode = 0x0;
 
 	if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
 		memcpy(out_ie + ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
Signature · 1 line
2.27.0