Skip to content

Commit

Permalink
mac80211: fix a crash in ieee80211_beacon_get_tim on change_interface
Browse files Browse the repository at this point in the history
Some drivers (e.g. ath9k) do not always disable beacons when they're
supposed to. When an interface is changed using the change_interface op,
the mode specific sdata part is in an undefined state and trying to
get a beacon at this point can produce weird crashes.

To fix this, add a check for ieee80211_sdata_running before using
anything from the sdata.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Jan 25, 2011
1 parent bdc4bf6 commit eb3e554
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2230,6 +2230,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,

sdata = vif_to_sdata(vif);

if (!ieee80211_sdata_running(sdata))
goto out;

if (tim_offset)
*tim_offset = 0;
if (tim_length)
Expand Down

0 comments on commit eb3e554

Please sign in to comment.