mac80211: add a fix to prevent unsafe queue wake calls during restart
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 399-mac80211-do-not-call-driver-wake_tx_queue-op-during-.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 1 Mar 2019 14:42:56 +0100
3 Subject: [PATCH] mac80211: do not call driver wake_tx_queue op during reconfig
4
5 There are several scenarios in which mac80211 can call drv_wake_tx_queue
6 after ieee80211_restart_hw has been called and has not yet completed.
7 Driver private structs are considered uninitialized until mac80211 has
8 uploaded the vifs, stations and keys again, so using private tx queue
9 data during that time is not safe.
10
11 The driver can also not rely on drv_reconfig_complete to figure out when
12 it is safe to accept drv_wake_tx_queue calls again, because it is only
13 called after all tx queues are woken again.
14
15 To fix this, bail out early in drv_wake_tx_queue if local->in_reconfig
16 is set.
17
18 Cc: stable@vger.kernel.org
19 Signed-off-by: Felix Fietkau <nbd@nbd.name>
20 ---
21
22 --- a/net/mac80211/driver-ops.h
23 +++ b/net/mac80211/driver-ops.h
24 @@ -1162,6 +1162,9 @@ static inline void drv_wake_tx_queue(str
25 {
26 struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif);
27
28 + if (local->in_reconfig)
29 + return;
30 +
31 if (!check_sdata_in_driver(sdata))
32 return;
33