public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jouni Malinen <j@w1.fi>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC] mac80211: Reorder debugfs calls during netdev deinit
Date: Thu, 28 Aug 2008 16:28:54 +0200	[thread overview]
Message-ID: <1219933734.25321.16.camel@johannes.berg> (raw)
In-Reply-To: <20080828135651.GE4863@jm.kir.nu> (sfid-20080828_155804_821695_2192C1D1)

[-- Attachment #1: Type: text/plain, Size: 1668 bytes --]


> It looks like someone has cleaned up the netdev uninit sequence (which
> was quite a mess at the time I looked at it last and ended up just
> delaying the fix till now..) and that seems to make it trivial to fix
> the deinit order issue.

Yeah, that was me, I mostly rewrote the junk in iface.c.

> ieee80211_free_keys() must be called before
> ieee80211_debugfs_remove_netdev() in order to make sure that the
> possible default_key symlink is removed before the netdev debugfs
> directory is removed.
> 
> This fixes an issue where a monitor interface may be left behind when
> being removed if there is a key symlink in it. This does not happen
> with the current mac80211 code, but could happen in future after IEEE
> 802.11w (management frame protection) is added with its additional
> default_mgmt_key symlink.
> 
> Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
> 
> 
> Index: wireless-testing/net/mac80211/iface.c
> ===================================================================
> --- wireless-testing.orig/net/mac80211/iface.c
> +++ wireless-testing/net/mac80211/iface.c
> @@ -31,11 +31,11 @@ static void ieee80211_teardown_sdata(str
>  	int flushed;
>  	int i;
>  
> -	ieee80211_debugfs_remove_netdev(sdata);
> -
>  	/* free extra data */
>  	ieee80211_free_keys(sdata);
>  
> +	ieee80211_debugfs_remove_netdev(sdata);
> +
>  	for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++)
>  		__skb_queue_purge(&sdata->fragments[i].skb_list);
>  	sdata->fragment_next = 0;

Seems sane to me.

Not that I like the workaround of setting keys on the monitor, in fact,
I think it shouldn't be allowed ;)

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2008-08-28 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-28 13:56 [RFC] mac80211: Reorder debugfs calls during netdev deinit Jouni Malinen
2008-08-28 14:28 ` Johannes Berg [this message]
2008-08-28 14:55   ` Jouni Malinen

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=1219933734.25321.16.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=j@w1.fi \
    --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