busybox: backport fix for CVE-2021-28831
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / subsys / 374-mac80211-fix-time-is-after-bug-in-mlme.patch
1 From: Ben Greear <greearb@candelatech.com>
2 Date: Tue, 30 Mar 2021 16:07:49 -0700
3 Subject: [PATCH] mac80211: fix time-is-after bug in mlme
4
5 The incorrect timeout check caused probing to happen when it did
6 not need to happen. This in turn caused tx performance drop
7 for around 5 seconds in ath10k-ct driver. Possibly that tx drop
8 is due to a secondary issue, but fixing the probe to not happen
9 when traffic is running fixes the symptom.
10
11 Signed-off-by: Ben Greear <greearb@candelatech.com>
12 Fixes: 9abf4e49830d ("mac80211: optimize station connection monitor")
13 Acked-by: Felix Fietkau <nbd@nbd.name>
14 Link: https://lore.kernel.org/r/20210330230749.14097-1-greearb@candelatech.com
15 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16 ---
17
18 --- a/net/mac80211/mlme.c
19 +++ b/net/mac80211/mlme.c
20 @@ -4691,7 +4691,10 @@ static void ieee80211_sta_conn_mon_timer
21 timeout = sta->rx_stats.last_rx;
22 timeout += IEEE80211_CONNECTION_IDLE_TIME;
23
24 - if (time_is_before_jiffies(timeout)) {
25 + /* If timeout is after now, then update timer to fire at
26 + * the later date, but do not actually probe at this time.
27 + */
28 + if (time_is_after_jiffies(timeout)) {
29 mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout));
30 return;
31 }