Skip to content

Commit

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

Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
[reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Thomas Huehn authored and Johannes Berg committed Jul 17, 2012
1 parent 7f9f78a commit b0e40e7
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,11 +1540,6 @@ static int hwsim_tx_info_frame_received_nl(struct sk_buff *skb_2,
/* now send back TX status */
txi = IEEE80211_SKB_CB(skb);

if (txi->control.vif)
hwsim_check_magic(txi->control.vif);
if (txi->control.sta)
hwsim_check_sta_magic(txi->control.sta);

ieee80211_tx_info_clear_status(txi);

for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
Expand Down

0 comments on commit b0e40e7

Please sign in to comment.