netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Michael Wu <flamingice@sourmilk.net>
Cc: John Linville <linville@tuxdriver.com>,
	netdev@vger.kernel.org, Ulrich Kunitz <kune@deine-taler.de>,
	Jiri Benc <jbenc@suse.cz>
Subject: Re: [PATCH] d80211: Fix __ieee80211_if_del on live interfaces
Date: Wed, 10 Jan 2007 21:09:23 +0100	[thread overview]
Message-ID: <200701102109.23565.mb@bu3sch.de> (raw)
In-Reply-To: <200701100119.19523.flamingice@sourmilk.net>

On Wednesday 10 January 2007 07:19, Michael Wu wrote:
> d80211: Fix __ieee80211_if_del on live interfaces
> 
> ieee80211_if_reinit is called in __ieee80211_if_del, which clears the
> contents of sdata->u. After that, unregister_netdevice is called. If the
> interface is still up, unregister_netdevice will end up calling dev->stop,
> and dev->stop expects the contents of sdata->u to be valid. Bad things
> typically happen at this point.
> 
> This patch fixes that by setting dev->uninit to ieee80211_if_reinit and
> eliminating the call to ieee80211_if_reinit in __ieee80211_if_del. This
> allows ieee80211_if_reinit to be called at a safer time. It also allows
> the removal of the call to ieee80211_if_shutdown in ieee80211_if_reinit
> because ieee80211_if_reinit now will never be called while the interface
> is up.
> 
> Signed-off-by: Michael Wu <flamingice@sourmilk.net>

ACK, this fixes the lockup bug I recently reported.

> ---
> 
>  net/d80211/ieee80211.c       |    2 ++
>  net/d80211/ieee80211_iface.c |    4 ----
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
> index 964fe45..2f1dce5 100644
> --- a/net/d80211/ieee80211.c
> +++ b/net/d80211/ieee80211.c
> @@ -4324,6 +4324,7 @@ void ieee80211_if_setup(struct net_devic
>  	dev->open = ieee80211_open;
>  	dev->stop = ieee80211_stop;
>  	dev->tx_queue_len = 0;
> +	dev->uninit = ieee80211_if_reinit;
>  	dev->destructor = ieee80211_if_free;
>  }
>  
> @@ -4338,6 +4339,7 @@ void ieee80211_if_mgmt_setup(struct net_
>  	dev->type = ARPHRD_IEEE80211_PRISM;
>  	dev->hard_header_parse = header_parse_80211;
>  	dev->tx_queue_len = 0;
> +	dev->uninit = ieee80211_if_reinit;
>  	dev->destructor = ieee80211_if_free;
>  }
>  
> diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c
> index cac0dd5..3b2d259 100644
> --- a/net/d80211/ieee80211_iface.c
> +++ b/net/d80211/ieee80211_iface.c
> @@ -234,9 +234,6 @@ void ieee80211_if_reinit(struct net_devi
>  		sdata->keys[i] = NULL;
>  	}
>  
> -	/* Shouldn't be necessary but won't hurt */
> -	ieee80211_if_shutdown(dev);
> -
>  	switch (sdata->type) {
>  	case IEEE80211_IF_TYPE_AP: {
>  		/* Remove all virtual interfaces that use this BSS
> @@ -311,7 +308,6 @@ void __ieee80211_if_del(struct ieee80211
>  {
>  	struct net_device *dev = sdata->dev;
>  
> -	ieee80211_if_reinit(dev);
>  	list_del(&sdata->list);
>  	ieee80211_sysfs_remove_netdevice(dev);
>  	unregister_netdevice(dev);
> 

-- 
Greetings Michael.

  reply	other threads:[~2007-01-10 20:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-10  6:19 [PATCH] d80211: Fix __ieee80211_if_del on live interfaces Michael Wu
2007-01-10 20:09 ` Michael Buesch [this message]
2007-01-10 20:16 ` Jiri Benc

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=200701102109.23565.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=flamingice@sourmilk.net \
    --cc=jbenc@suse.cz \
    --cc=kune@deine-taler.de \
    --cc=linville@tuxdriver.com \
    --cc=netdev@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).