linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@adurom.com>
To: Arik Nemtsov <arik@wizery.com>
Cc: <linux-wireless@vger.kernel.org>,
	Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [PATCH] mac80211: fix rx->key NULL dereference during mic failure
Date: Sun, 19 Jun 2011 23:04:12 +0300	[thread overview]
Message-ID: <87ips11tc3.fsf@purkki.adurom.net> (raw)
In-Reply-To: <1308422749-16939-1-git-send-email-arik@wizery.com> (Arik Nemtsov's message of "Sat\, 18 Jun 2011 21\:45\:49 +0300")

Arik Nemtsov <arik@wizery.com> writes:

> Sometimes when reporting a MIC failure rx->key may be unset. This
> code path is hit when receiving a packet meant for a multicast
> address, and decryption is performed in HW.
>
> Fortunately, the failing key_idx is not used for anything up to
> (and including) usermode, so we allow ourselves to set a bogus one
> when a key cannot be retrieved.

[...]

> -	mac80211_ev_michael_mic_failure(rx->sdata, rx->key->conf.keyidx,
> +	mac80211_ev_michael_mic_failure(rx->sdata,
> +					rx->key ? rx->key->conf.keyidx : -1,
>  					(void *) skb->data, NULL, GFP_ATOMIC);

In special cases like this a comment in the code would be nice.

-- 
Kalle Valo

  parent reply	other threads:[~2011-06-19 20:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-18 18:45 [PATCH] mac80211: fix rx->key NULL dereference during mic failure Arik Nemtsov
2011-06-19  7:33 ` Johannes Berg
2011-06-19 20:04 ` Kalle Valo [this message]
2011-06-22 20:04   ` John W. Linville
2011-06-22 20:22     ` Arik Nemtsov
  -- strict thread matches above, loose matches on Subject: below --
2011-06-22 20:41 Arik Nemtsov
2011-06-22 20:52 ` Johannes Berg
2011-06-22 20:59   ` Arik Nemtsov

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=87ips11tc3.fsf@purkki.adurom.net \
    --to=kvalo@adurom.com \
    --cc=arik@wizery.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).