aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLachlan Hodges <lachlan.hodges@morsemicro.com>2025-06-21 22:32:09 +1000
committerJohannes Berg <johannes.berg@intel.com>2025-06-24 09:04:55 +0200
commit7a3750ff0f2e8fee338a9c168f429f6c37f0e820 (patch)
treeab2d067767a63c8b2ff6d4302bc515c252bf8272
parentwifi: iwlegacy: work around excessive stack usage on clang/kasan (diff)
downloadwireguard-linux-7a3750ff0f2e8fee338a9c168f429f6c37f0e820.tar.xz
wireguard-linux-7a3750ff0f2e8fee338a9c168f429f6c37f0e820.zip
wifi: mac80211: fix beacon interval calculation overflow
As we are converting from TU to usecs, a beacon interval of 100*1024 usecs will lead to integer wrapping. To fix change to use a u32. Fixes: 057d5f4ba1e4 ("mac80211: sync dtim_count to TSF") Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com> Link: https://patch.msgid.link/20250621123209.511796-1-lachlan.hodges@morsemicro.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 27d414efa3fd..a125995ed252 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3884,7 +3884,7 @@ void ieee80211_recalc_dtim(struct ieee80211_local *local,
{
u64 tsf = drv_get_tsf(local, sdata);
u64 dtim_count = 0;
- u16 beacon_int = sdata->vif.bss_conf.beacon_int * 1024;
+ u32 beacon_int = sdata->vif.bss_conf.beacon_int * 1024;
u8 dtim_period = sdata->vif.bss_conf.dtim_period;
struct ps_data *ps;
u8 bcns_from_dtim;