* [PATCH] mac80211: Fix sta_mtx unlocking on insert STA failure path
@ 2010-03-06 16:35 Jouni Malinen
2010-03-07 19:02 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Jouni Malinen @ 2010-03-06 16:35 UTC (permalink / raw)
To: John W. Linville, Johannes Berg; +Cc: linux-wireless
Commit 34e895075e21be3e21e71d6317440d1ee7969ad0 introduced sta_mtx
locking into sta_info_insert() (now sta_info_insert_rcu), but forgot
to unlock this mutex on one of the error paths. Fix this by adding
the missing mutex_unlock() call for the case where STA insert fails
due to an entry existing already. This may happen at least in AP mode
when a STA roams between two BSSes (vifs).
Signed-off-by: Jouni Malinen <j@w1.fi>
---
net/mac80211/sta_info.c | 1 +
1 file changed, 1 insertion(+)
By the way, that roaming between two vifs did not work either, but
regardless, fixing missing mutex_unlock is of higher priority.. The STA
entry was not updated to point to the correct dev when the STA roamed
from one BSS to another one (both BSSes running on the same wiphy). To
be more exact, I think it was updated once, but not when roaming back to
the original BSS.
--- wireless-testing.orig/net/mac80211/sta_info.c 2010-03-06 17:53:12.000000000 +0200
+++ wireless-testing/net/mac80211/sta_info.c 2010-03-06 17:54:04.000000000 +0200
@@ -434,6 +434,7 @@ int sta_info_insert_rcu(struct sta_info
/* check if STA exists already */
if (sta_info_get_bss(sdata, sta->sta.addr)) {
spin_unlock_irqrestore(&local->sta_lock, flags);
+ mutex_unlock(&local->sta_mtx);
rcu_read_lock();
err = -EEXIST;
goto out_free;
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mac80211: Fix sta_mtx unlocking on insert STA failure path
2010-03-06 16:35 [PATCH] mac80211: Fix sta_mtx unlocking on insert STA failure path Jouni Malinen
@ 2010-03-07 19:02 ` Johannes Berg
2010-03-07 21:23 ` Jouni Malinen
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2010-03-07 19:02 UTC (permalink / raw)
To: Jouni Malinen; +Cc: John W. Linville, linux-wireless
On Sat, 2010-03-06 at 18:35 +0200, Jouni Malinen wrote:
> Commit 34e895075e21be3e21e71d6317440d1ee7969ad0 introduced sta_mtx
> locking into sta_info_insert() (now sta_info_insert_rcu), but forgot
> to unlock this mutex on one of the error paths. Fix this by adding
> the missing mutex_unlock() call for the case where STA insert fails
> due to an entry existing already. This may happen at least in AP mode
> when a STA roams between two BSSes (vifs).
>
> Signed-off-by: Jouni Malinen <j@w1.fi>
Thanks.
> ---
> net/mac80211/sta_info.c | 1 +
> 1 file changed, 1 insertion(+)
>
> By the way, that roaming between two vifs did not work either, but
> regardless, fixing missing mutex_unlock is of higher priority.. The STA
> entry was not updated to point to the correct dev when the STA roamed
> from one BSS to another one (both BSSes running on the same wiphy). To
> be more exact, I think it was updated once, but not when roaming back to
> the original BSS.
This must be due to the sta_find_bss thing Felix did because hostapd
wasn't using the right ifindex...
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211: Fix sta_mtx unlocking on insert STA failure path
2010-03-07 19:02 ` Johannes Berg
@ 2010-03-07 21:23 ` Jouni Malinen
0 siblings, 0 replies; 3+ messages in thread
From: Jouni Malinen @ 2010-03-07 21:23 UTC (permalink / raw)
To: Johannes Berg; +Cc: John W. Linville, linux-wireless
On Sun, Mar 07, 2010 at 08:02:47PM +0100, Johannes Berg wrote:
> > By the way, that roaming between two vifs did not work either, but
> > regardless, fixing missing mutex_unlock is of higher priority.. The STA
> > entry was not updated to point to the correct dev when the STA roamed
> > from one BSS to another one (both BSSes running on the same wiphy). To
> > be more exact, I think it was updated once, but not when roaming back to
> > the original BSS.
>
> This must be due to the sta_find_bss thing Felix did because hostapd
> wasn't using the right ifindex...
Yes, it was and I finally remembered to go through the patches from
Felix to get this fixed. Multi-BSS works now with the current hostap.git
version of hostapd and driver_nl80211.c.
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-07 21:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-06 16:35 [PATCH] mac80211: Fix sta_mtx unlocking on insert STA failure path Jouni Malinen
2010-03-07 19:02 ` Johannes Berg
2010-03-07 21:23 ` Jouni Malinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox