From: Johannes Berg <johannes@sipsolutions.net>
To: Ben Greear <greearb@candelatech.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: Crash in cfg80211_unlink_bss
Date: Wed, 06 Oct 2010 20:11:37 +0200 [thread overview]
Message-ID: <1286388697.3655.393.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1286388245.3655.392.camel@jlt3.sipsolutions.net>
On Wed, 2010-10-06 at 20:04 +0200, Johannes Berg wrote:
> But anyway, now that I look at it in more detail, it seems fairly
> obvious. You should be able to trigger it with two stations, but it's
> probably harder ...
>
> I need to analyse the refcounting here again and in more detail, but in
> the meantime can you try below patch?
Ok, I did that, and it's because the BSS list owns a reference, so
this'll just crash somewhere else for you now ... Below should fix it
completely.
johannes
---
net/wireless/scan.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- wireless-testing.orig/net/wireless/scan.c 2010-10-06 19:59:41.000000000 +0200
+++ wireless-testing/net/wireless/scan.c 2010-10-06 20:10:41.000000000 +0200
@@ -668,14 +668,14 @@ void cfg80211_unlink_bss(struct wiphy *w
bss = container_of(pub, struct cfg80211_internal_bss, pub);
spin_lock_bh(&dev->bss_lock);
+ if (!list_empty(&bss->list)) {
+ list_del_init(&bss->list);
+ dev->bss_generation++;
+ rb_erase(&bss->rbn, &dev->bss_tree);
- list_del(&bss->list);
- dev->bss_generation++;
- rb_erase(&bss->rbn, &dev->bss_tree);
-
+ kref_put(&bss->ref, bss_release);
+ }
spin_unlock_bh(&dev->bss_lock);
-
- kref_put(&bss->ref, bss_release);
}
EXPORT_SYMBOL(cfg80211_unlink_bss);
prev parent reply other threads:[~2010-10-06 18:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-06 17:28 Crash in cfg80211_unlink_bss Ben Greear
2010-10-06 18:04 ` Johannes Berg
2010-10-06 18:08 ` Ben Greear
2010-10-06 18:16 ` Johannes Berg
2010-10-06 18:20 ` Ben Greear
2010-10-06 19:14 ` Ben Greear
2010-10-06 19:19 ` Johannes Berg
2010-10-06 18:11 ` Johannes Berg [this message]
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=1286388697.3655.393.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=greearb@candelatech.com \
--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).