Skip to contentSkip to conversation

wifi: cfg80211: wext: fix IGTK key ID off-by-one

PATCH New Johannes Berg 1 participant 1 message Feb 9 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH v2 1/1 wifi: cfg80211: wext: fix IGTK key ID off-by-one

From: Johannes Berg <[email protected]>

The IGTK key ID must be 4 or 5, but the code checks against key ID + 1, so must check against 5/6 rather than 4/5. Fix that.

Fixes 08645126dd24 ("cfg80211: implement wext key handling")
---
 net/wireless/wext-compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/wext-compat.c +1 -1
index 1241fda78a68..680500fa57cf 100644
@@ -684,7 +684,7 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev,
 
 	idx = erq->flags & IW_ENCODE_INDEX;
 	if (cipher == WLAN_CIPHER_SUITE_AES_CMAC) {
-		if (idx < 4 || idx > 5) {
+		if (idx < 5 || idx > 6) {
 			idx = wdev->wext.default_mgmt_key;
 			if (idx < 0)
 				return -EINVAL;
Signature · 1 line
2.53.0