diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-03-19 11:00:26 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-26 15:07:29 -0400 |
commit | d72308bff5c2fa207949a5925b020bce74495e33 (patch) | |
tree | 023e58d9a55d5439fcd1b0794b6bf095fa1115f4 /net/mac80211/agg-rx.c | |
parent | 4e808a38fdcaeeeddbc05942623279ebe7c02373 (diff) |
mac80211: fix possible tid_rx->reorder_timer use after free
Is possible that we will arm the tid_rx->reorder_timer after
del_timer_sync() in ___ieee80211_stop_rx_ba_session(). We need to stop
timer after RCU grace period finish, so move it to
ieee80211_free_tid_rx(). Timer will not be armed again, as
rcu_dereference(sta->ampdu_mlme.tid_rx[tid]) will return NULL.
Debug object detected problem with the following warning:
ODEBUG: free active (active state 0) object type: timer_list hint: sta_rx_agg_reorder_timer_expired+0x0/0xf0 [mac80211]
Bug report (with all warning messages):
https://bugzilla.redhat.com/show_bug.cgi?id=804007
Reported-by: "jan p. springer" <jsd@igroup.org>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/agg-rx.c')
-rw-r--r-- | net/mac80211/agg-rx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index 1068f668ac4e..64d3ce5ea1a0 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c | |||
@@ -49,6 +49,8 @@ static void ieee80211_free_tid_rx(struct rcu_head *h) | |||
49 | container_of(h, struct tid_ampdu_rx, rcu_head); | 49 | container_of(h, struct tid_ampdu_rx, rcu_head); |
50 | int i; | 50 | int i; |
51 | 51 | ||
52 | del_timer_sync(&tid_rx->reorder_timer); | ||
53 | |||
52 | for (i = 0; i < tid_rx->buf_size; i++) | 54 | for (i = 0; i < tid_rx->buf_size; i++) |
53 | dev_kfree_skb(tid_rx->reorder_buf[i]); | 55 | dev_kfree_skb(tid_rx->reorder_buf[i]); |
54 | kfree(tid_rx->reorder_buf); | 56 | kfree(tid_rx->reorder_buf); |
@@ -91,7 +93,6 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid, | |||
91 | tid, WLAN_BACK_RECIPIENT, reason); | 93 | tid, WLAN_BACK_RECIPIENT, reason); |
92 | 94 | ||
93 | del_timer_sync(&tid_rx->session_timer); | 95 | del_timer_sync(&tid_rx->session_timer); |
94 | del_timer_sync(&tid_rx->reorder_timer); | ||
95 | 96 | ||
96 | call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx); | 97 | call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx); |
97 | } | 98 | } |