Skip to contentSkip to conversation

mac80211: remove mic_fail_no_key label

PATCH In review Stanislaw Gruszka 2 participants 2 messages Aug 2, 2017 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mac80211: remove mic_fail_no_key label

For historic reasons we have separate cases for mic_fail and mic_fail_no_key. But with current code we can merge those cases, as we already have NULL key check since commit a66b98db570a ("mac80211: fix rx->key NULL dereference during mic failure").

Patch makes the rx->key->u.tkip.mic_failures statistics increase on all cases when RX_FLAG_MMIC_ERROR is set.

---
v1 -> v2 : use preferred commit format in the changelog.

 net/mac80211/wpa.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
net/mac80211/wpa.c +1 -2
index 0d722ea..98fd9a0 100644
@@ -111,7 +111,7 @@
 	 */
 	if (status->flag & (RX_FLAG_MMIC_STRIPPED | RX_FLAG_IV_STRIPPED)) {
 		if (status->flag & RX_FLAG_MMIC_ERROR)
-			goto mic_fail_no_key;
+			goto mic_fail;
 
 		if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key &&
 		    rx->key->conf.cipher == WLAN_CIPHER_SUITE_TKIP)
@@ -170,7 +170,6 @@
 mic_fail:
 	rx->key->u.tkip.mic_failures++;
 
-mic_fail_no_key:
 	/*
 	 * In some cases the key can be unset - e.g. a multicast packet, in
 	 * a driver that supports HW encryption. Send up the key idx only if
Signature · 1 line
1.7.1
maintainer
#1 lore raw
Quoted 5 lines · Stanislaw Gruszka

For historic reasons we have separate cases for mic_fail and mic_fail_no_key. But with current code we can merge those cases, as we already have NULL key check since commit a66b98db570a ("mac80211: fix rx->key NULL dereference during mic failure").

Uh, no. rx->key->u.tkip.mic_failures will still crash.

johannes