From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org,
Ron Rindjunsky <ron.rindjunsky@intel.com>
Subject: [PATCH 2/8] mac80211: safely free beacon in ieee80211_if_reinit
Date: Fri, 22 Feb 2008 12:16:46 +0100 [thread overview]
Message-ID: <20080222111748.540603000@sipsolutions.net> (raw)
In-Reply-To: 20080222111644.183587000@sipsolutions.net
If ieee80211_if_reinit() is called from ieee80211_unregister_hw()
then it is possible that the driver will still request a beacon
(it is allowed to until ieee80211_unregister_hw() has returned.)
This means we need to use an RCU-protected write to the beacon
information even in this function.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/ieee80211_iface.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- everything.orig/net/mac80211/ieee80211_iface.c 2008-02-21 14:35:24.000000000 +0100
+++ everything/net/mac80211/ieee80211_iface.c 2008-02-21 15:13:17.000000000 +0100
@@ -193,6 +193,7 @@ void ieee80211_if_reinit(struct net_devi
/* Remove all virtual interfaces that use this BSS
* as their sdata->bss */
struct ieee80211_sub_if_data *tsdata, *n;
+ struct beacon_data *beacon;
list_for_each_entry_safe(tsdata, n, &local->interfaces, list) {
if (tsdata != sdata && tsdata->bss == &sdata->u.ap) {
@@ -210,7 +211,10 @@ void ieee80211_if_reinit(struct net_devi
}
}
- kfree(sdata->u.ap.beacon);
+ beacon = sdata->u.ap.beacon;
+ rcu_assign_pointer(sdata->u.ap.beacon, NULL);
+ synchronize_rcu();
+ kfree(beacon);
while ((skb = skb_dequeue(&sdata->u.ap.ps_bc_buf))) {
local->total_ps_buffered--;
--
next prev parent reply other threads:[~2008-02-22 14:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-22 11:16 [PATCH 0/8] mac80211 sta info and related changes Johannes Berg
2008-02-22 11:16 ` [PATCH 1/8] mac80211: clarify use of TX status/RX callbacks Johannes Berg
2008-02-22 11:16 ` Johannes Berg [this message]
2008-02-22 11:16 ` [PATCH 3/8] mac80211: split ieee80211_key_alloc Johannes Berg
2008-02-22 11:16 ` [PATCH 4/8] mac80211: RCU-ify STA info structure access Johannes Berg
2008-03-05 1:57 ` Chatre, Reinette
2008-03-05 9:23 ` Johannes Berg
2008-03-05 19:25 ` Chatre, Reinette
2008-02-22 11:16 ` [PATCH 5/8] mac80211: split ieee80211_txrx_data Johannes Berg
2008-02-22 11:16 ` [PATCH 6/8] mac80211: split sta_info_add Johannes Berg
2008-02-22 11:16 ` [PATCH 7/8] mac80211: remove STA infos last_ack stuff Johannes Berg
2008-02-22 11:16 ` [PATCH 8/8] mac80211: clean up sta_info and document locking Johannes Berg
2008-02-22 21:41 ` [PATCH 0/8] mac80211 sta info and related changes Johannes Berg
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=20080222111748.540603000@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=ron.rindjunsky@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.