Skip to content

Commit

Permalink
mwl8k: fix possible race condition in info->control.sta use
Browse files Browse the repository at this point in the history
info->control.sta may only be dereferenced during the drv_tx call otherwise
could lead to use-after-free bugs

Reported-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Thomas Huehn authored and John W. Linville committed Jul 11, 2012
1 parent 7c41f31 commit 89e1180
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,9 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)

info = IEEE80211_SKB_CB(skb);
if (ieee80211_is_data(wh->frame_control)) {
sta = info->control.sta;
rcu_read_lock();
sta = ieee80211_find_sta_by_ifaddr(hw, wh->addr1,
wh->addr2);
if (sta) {
sta_info = MWL8K_STA(sta);
BUG_ON(sta_info == NULL);
Expand All @@ -1682,6 +1684,7 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
sta_info->is_ampdu_allowed = true;
}
}
rcu_read_unlock();
}

ieee80211_tx_info_clear_status(info);
Expand Down

0 comments on commit 89e1180

Please sign in to comment.