summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorRichard Kinder <richard.kinder@gmail.com>2024-03-28 11:57:25 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-06-12 11:11:22 +0200
commitea2121cdc7ab429e671e0f389c996bb4b2344bde (patch)
treebbf1ca49e439ee2487bd3c25ea0d8fe19abe4355 /net
parent0cfadb49ef908b4a27ca98cfc62422db8d81407b (diff)
downloadlinux-ea2121cdc7ab429e671e0f389c996bb4b2344bde.tar.gz
linux-ea2121cdc7ab429e671e0f389c996bb4b2344bde.tar.bz2
linux-ea2121cdc7ab429e671e0f389c996bb4b2344bde.zip
wifi: mac80211: ensure beacon is non-S1G prior to extracting the beacon timestamp field
[ Upstream commit d12b9779cc9ba29d65fbfc728eb8a037871dd331 ] Logic inside ieee80211_rx_mgmt_beacon accesses the mgmt->u.beacon.timestamp field without first checking whether the beacon received is non-S1G format. Fix the problem by checking the beacon is non-S1G format to avoid access of the mgmt->u.beacon.timestamp field. Signed-off-by: Richard Kinder <richard.kinder@gmail.com> Link: https://msgid.link/20240328005725.85355-1-richard.kinder@gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index cf01f1f298a3..42e2c84ed248 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -5979,7 +5979,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,
link->u.mgd.dtim_period = elems->dtim_period;
link->u.mgd.have_beacon = true;
ifmgd->assoc_data->need_beacon = false;
- if (ieee80211_hw_check(&local->hw, TIMING_BEACON_ONLY)) {
+ if (ieee80211_hw_check(&local->hw, TIMING_BEACON_ONLY) &&
+ !ieee80211_is_s1g_beacon(hdr->frame_control)) {
link->conf->sync_tsf =
le64_to_cpu(mgmt->u.beacon.timestamp);
link->conf->sync_device_ts =