From: Thomas Huehn Date: Fri, 13 Jul 2012 18:52:24 +0000 (+0200) Subject: mac80211_hwsim: fix race condition with sta/vif pointers X-Git-Tag: v3.6-rc1~125^2~57^2~1^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0e40e72be42153cd6473ca1fa69058a30adb2bb;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git mac80211_hwsim: fix race condition with sta/vif pointers 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 [reword commit message] Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 3f38d84..826ac7b 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -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++) {