linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jouni Malinen <j@w1.fi>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] mac80211: simplify key locking
Date: Fri, 23 Jul 2010 22:33:01 -0700	[thread overview]
Message-ID: <20100724053301.GA6773@jm.kir.nu> (raw)
In-Reply-To: <1275380359.3621.17.camel@jlt3.sipsolutions.net>

On Tue, Jun 01, 2010 at 10:19:19AM +0200, Johannes Berg wrote:

> net/mac80211/key.c
commit ad0e2b5a00dbec303e4682b403bb6703d11dcdb2

>  void ieee80211_key_free(struct ieee80211_key *key)

> -	if (!key->sdata) {
> -		/* The key has not been linked yet, simply free it
> -		 * and don't Oops */

It looks like this function can still be called with key->sdata == NULL
in some cases and that does indeed result in an oops below:

> +	local = key->sdata->local;


I've seen this issue pop up in FT testing and based on a quick code
review, at least ieee80211_add_key() calls ieee80211_key_free() in an
error case (sta not found) without having first called
ieee80211_key_link(). Which one is wrong - the caller or the freeing
function? Should we just restore the previous key->sdata == NULL handler
here?

I'd guess that the sta-not-found part is caused by FT trying to
configure PTK before association in the FT protocol roaming case
(wpa_supplicant tries to do this as soon as it knows the key because
that works with some drivers and is needed to avoid race condition with
encrypted frames; as a workaround, it will do this again after
association if the previous attempt failed).

-- 
Jouni Malinen                                            PGP id EFC895FA

  reply	other threads:[~2010-07-24  5:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01  8:19 [PATCH] mac80211: simplify key locking Johannes Berg
2010-07-24  5:33 ` Jouni Malinen [this message]
2010-07-24  9:06   ` Johannes Berg
2010-07-26  1:04     ` Jouni Malinen
2010-07-26  1:39     ` Jouni Malinen
2010-07-26  7:42       ` Johannes Berg
2010-07-26 14:20         ` Jouni Malinen
2010-07-26 14:27           ` Johannes Berg
2010-07-26 22:52             ` [PATCH] mac80211: Fix key freeing to handle unlinked keys Jouni Malinen
2010-07-27  6:38               ` Johannes Berg

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=20100724053301.GA6773@jm.kir.nu \
    --to=j@w1.fi \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).