linux-next/drivers/net/wireless
Johannes Berg 313bbd1990 mac80211-hwsim: fix late beacon hrtimer handling
Thomas explained in https://lore.kernel.org/r/87mtoeb4hb.ffs@tglx
that our handling of the hrtimer here is wrong: If the timer fires
late (e.g. due to vCPU scheduling, as reported by Dmitry/syzbot)
then it tries to actually rearm the timer at the next deadline,
which might be in the past already:

 1          2          3          N          N+1
 |          |          |   ...    |          |

 ^ intended to fire here (1)
            ^ next deadline here (2)
                                      ^ actually fired here

The next time it fires, it's later, but will still try to schedule
for the next deadline (now 3), etc. until it catches up with N,
but that might take a long time, causing stalls etc.

Now, all of this is simulation, so we just have to fix it, but
note that the behaviour is wrong even per spec, since there's no
value then in sending all those beacons unaligned - they should be
aligned to the TBTT (1, 2, 3, ... in the picture), and if we're a
bit (or a lot) late, then just resume at that point.

Therefore, change the code to use hrtimer_forward_now() which will
ensure that the next firing of the timer would be at N+1 (in the
picture), i.e. the next interval point after the current time.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reported-by: syzbot+0e964fad69a9c462bc1e@syzkaller.appspotmail.com
Fixes: 01e59e467e ("mac80211_hwsim: hrtimer beacon")
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210915112936.544f383472eb.I3f9712009027aa09244b65399bf18bf482a8c4f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2021-09-23 13:25:12 +02:00
..
admtek module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
ath ARM: SoC drivers for 5.15 2021-09-01 15:25:28 -07:00
atmel module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
broadcom brcmfmac: pcie: fix oops on failure to resume and reprobe 2021-08-29 14:45:29 +03:00
cisco airo: use ndo_siocdevprivate 2021-07-27 20:11:44 +01:00
intel Networking stragglers and fixes for 5.15-rc1, including changes from netfilter, 2021-09-07 14:02:58 -07:00
intersil Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
marvell mwifiex: pcie: add reset_d3cold quirk for Surface gen4+ devices 2021-08-29 14:46:41 +03:00
mediatek wireless-drivers fixes for v5.14 2021-08-17 15:08:14 -07:00
microchip wilc1000: Convert module-global "isinit" to device-specific variable 2021-08-29 11:33:36 +03:00
quantenna qtnfmac: switch from 'pci_' to 'dma_' API 2021-08-23 11:56:57 +01:00
ralink rt2x00: do not set timestamp for injected frames 2021-06-15 16:36:20 +03:00
realtek rtlwifi: rtl8192de: Fix initialization of place in _rtl92c_phy_get_rightchnlplace() 2021-08-29 10:28:32 +03:00
rsi rsi: make array fsm_state static const, makes object smaller 2021-08-29 11:32:01 +03:00
st cw1200: Revert unnecessary patches that fix unreal use-after-free bugs 2021-06-15 16:41:22 +03:00
ti Driver core changes for 5.14-rc1 2021-07-05 13:51:41 -07:00
zydas zd1211rw: Prefer pr_err over printk error msg 2021-06-15 16:37:01 +03:00
Kconfig wireless: remove CONFIG_WIRELESS_WDS 2020-11-10 09:39:08 +01:00
mac80211_hwsim.c mac80211-hwsim: fix late beacon hrtimer handling 2021-09-23 13:25:12 +02:00
mac80211_hwsim.h mac80211_hwsim: notify wmediumd of used MAC addresses 2020-04-24 11:45:47 +02:00
Makefile wilc1000: move wilc driver out of staging 2020-06-26 08:46:46 +03:00
ray_cs.c ray_cs: Split memcpy() to avoid bounds check warning 2021-08-21 20:15:36 +03:00
ray_cs.h
rayctl.h ray_cs: Replace zero-length array with flexible-array member 2020-03-23 19:18:27 +02:00
rndis_wlan.c rndis_wlan: simplify is_associated() 2021-06-15 16:34:19 +03:00
virt_wifi.c virt_wifi: fix error on connect 2021-07-23 10:34:31 +02:00
wl3501_cs.c wl3501_cs: Fix out-of-bounds warnings in wl3501_mgmt_join 2021-04-22 17:38:41 +03:00
wl3501.h wl3501_cs: Fix out-of-bounds warnings in wl3501_mgmt_join 2021-04-22 17:38:41 +03:00