All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: linux-wireless@vger.kernel.org
Cc: Michael Skeffington <mike@astro.ai>
Subject: [PATCH] mac80211: remove mic_fail_no_key label
Date: Wed, 2 Aug 2017 11:04:31 +0200	[thread overview]
Message-ID: <20170802090431.GB2790@redhat.com> (raw)

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 a66b98db570a638afd909459e1e6bfa272344bd3
Author: Arik Nemtsov <arik@wizery.com>
Date:   Thu Jun 23 00:00:24 2011 +0300

    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.

Reported-by: Michael Skeffington <mike@astro.ai>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 net/mac80211/wpa.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 0d722ea..98fd9a0 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -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
-- 
1.7.1

             reply	other threads:[~2017-08-02  9:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02  9:04 Stanislaw Gruszka [this message]
2017-08-02  9:10 ` [PATCH] mac80211: remove mic_fail_no_key label Arend van Spriel
2017-08-02  9:35   ` Stanislaw Gruszka
2017-08-02 10:07     ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170802090431.GB2790@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mike@astro.ai \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.