From: Johannes Berg Date: Tue, 4 Mar 2014 10:43:28 +0000 (+0100) Subject: mac80211: fix potential use-after-free X-Git-Tag: v3.12.20~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=243677b1125ce3f460e45d887127072c6d323579;p=thirdparty%2Fkernel%2Fstable.git mac80211: fix potential use-after-free commit d2722f8b87fb172ff2f31d3a2816b31d58678d40 upstream. The bss struct might be freed in ieee80211_rx_bss_put(), so we shouldn't use it afterwards. Fixes: 817cee7675237 ("mac80211: track AP's beacon rate and give it to the driver") Signed-off-by: Johannes Berg Signed-off-by: Jiri Slaby --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 8d7f4abe65ba5..2af1c38374a47 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2881,8 +2881,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems, channel); if (bss) { - ieee80211_rx_bss_put(local, bss); sdata->vif.bss_conf.beacon_rate = bss->beacon_rate; + ieee80211_rx_bss_put(local, bss); } }