Skip to content

Commit eb3e554

Browse files
Felix Fietkaulinvjw
authored andcommitted
mac80211: fix a crash in ieee80211_beacon_get_tim on change_interface
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>
1 parent bdc4bf6 commit eb3e554

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/mac80211/tx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
22302230

22312231
sdata = vif_to_sdata(vif);
22322232

2233+
if (!ieee80211_sdata_running(sdata))
2234+
goto out;
2235+
22332236
if (tim_offset)
22342237
*tim_offset = 0;
22352238
if (tim_length)

0 commit comments

Comments
 (0)