Skip to content

Commit 33ddd81

Browse files
committed
mac80211: properly free requested-but-not-started TX agg sessions
When deleting a station or otherwise tearing down all aggregation sessions, make sure to delete requested but not yet started ones, to avoid the following scenario: * session is requested, added to tid_start_tx[] * ieee80211_ba_session_work() runs, gets past BLOCK_BA check * ieee80211_sta_tear_down_BA_sessions() runs, locks &sta->ampdu_mlme.mtx, e.g. while deleting the station - deleting all active sessions * ieee80211_ba_session_work() continues since tear down flushes it, and calls ieee80211_tx_ba_session_handle_start() for the new session, arms the timer for it * station deletion continues to __cleanup_single_sta() and frees the session struct, while the timer is armed Reported-by: Fengguang Wu <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 67bd523 commit 33ddd81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/mac80211/agg-tx.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
330330

331331
spin_lock_bh(&sta->lock);
332332

333+
/* free struct pending for start, if present */
334+
tid_tx = sta->ampdu_mlme.tid_start_tx[tid];
335+
kfree(tid_tx);
336+
sta->ampdu_mlme.tid_start_tx[tid] = NULL;
337+
333338
tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
334339
if (!tid_tx) {
335340
spin_unlock_bh(&sta->lock);

0 commit comments

Comments
 (0)