From: Johannes Berg <johannes@sipsolutions.net>
To: reinette chatre <reinette.chatre@intel.com>
Cc: juuso.oikarinen@nokia.com, linux-wireless@vger.kernel.org
Subject: Re: Locking in new ARP query filtering patch
Date: Sun, 06 Jun 2010 11:17:18 +0200 [thread overview]
Message-ID: <1275815838.3615.5.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1275802426.1835.4408.camel@rchatre-DESK>
On Sat, 2010-06-05 at 22:33 -0700, reinette chatre wrote:
> [ 92.026800] =======================================================
> [ 92.030507] [ INFO: possible circular locking dependency detected ]
> [ 92.030507] 2.6.34-04781-g2b2c009 #85
> [ 92.030507] -------------------------------------------------------
> [ 92.030507] modprobe/5225 is trying to acquire lock:
> [ 92.030507] ((wiphy_name(local->hw.wiphy))){+.+.+.}, at: [<ffffffff8105b5c0>] flush_workq
> ueue+0x0/0xb0
> [ 92.030507]
> [ 92.030507] but task is already holding lock:
> [ 92.030507] (rtnl_mutex){+.+.+.}, at: [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
> [ 92.030507]
> [ 92.030507] which lock already depends on the new lock.
> [ 92.030507] 1 lock held by modprobe/5225:
> [ 92.030507] #0: (rtnl_mutex){+.+.+.}, at: [<ffffffff812b9ce2>] rtnl_lock+0x12/0x20
Suck, I should've caught that. Yes, because we need to flush the
mac80211 workqueue under RTNL we cannot acquire the RTNL while working
from it, so the ARP filter upload after associating needs to be further
deferred to a schedule_work(), which then needs to do a bunch of sanity
checking and I think might even need to iterate the iface list because
it might not be possible to make it depend on it.
> Here is the BUG:
>
> [ 132.460013] kernel BUG at /home/wifi/iwlwifi-2.6/net/mac80211/main.c:380!
> [ 132.460013] invalid opcode: 0000 [#1] SMP
> [ 132.460013] RIP: 0010:[<ffffffffa022fac2>] [<ffffffffa022fac2>] ieee80211_alloc_hw+0x502/
> 0x520 [mac80211]
> [ 132.460013] [<ffffffffa02af53e>] iwl_alloc_all+0x1e/0x50 [iwlcore]
> The code in which the above appears is:
> (gdb) l *(ieee80211_alloc_hw+0x502)
> 0xaf2 is in ieee80211_alloc_hw (/home/wifi/iwlwifi-2.6/net/mac80211/main.c:380).
> 375
> 376 ifmgd = &sdata->u.mgd;
> 377 mutex_lock(&ifmgd->mtx);
> 378 if (ifmgd->associated)
> 379 ieee80211_set_arp_filter(sdata);
> 380 mutex_unlock(&ifmgd->mtx);
> 381
> 382 return NOTIFY_DONE;
> 383 }
> 384 #endif
Not sure why this appears as part of init? But anyway, the reason for
this is obvious -- we're not checking netif_running() in
ieee80211_ifa_changed, which we must since we only init the mutex as
part of open(). The fix would be to abort ieee80211_ifa_changed() if not
netif_running() -- before locking the mutex.
johannes
next prev parent reply other threads:[~2010-06-06 9:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-06 5:33 Locking in new ARP query filtering patch reinette chatre
2010-06-06 9:17 ` Johannes Berg [this message]
2010-06-07 5:12 ` Juuso Oikarinen
2010-06-07 13:18 ` Juuso Oikarinen
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=1275815838.3615.5.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=juuso.oikarinen@nokia.com \
--cc=linux-wireless@vger.kernel.org \
--cc=reinette.chatre@intel.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).