Skip to content

Commit d12b977

Browse files
rkinder2023jmberg-intel
authored andcommitted
wifi: mac80211: ensure beacon is non-S1G prior to extracting the beacon timestamp field
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>
1 parent ab9177d commit d12b977

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/mac80211/mlme.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6193,7 +6193,8 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link,
61936193
link->u.mgd.dtim_period = elems->dtim_period;
61946194
link->u.mgd.have_beacon = true;
61956195
ifmgd->assoc_data->need_beacon = false;
6196-
if (ieee80211_hw_check(&local->hw, TIMING_BEACON_ONLY)) {
6196+
if (ieee80211_hw_check(&local->hw, TIMING_BEACON_ONLY) &&
6197+
!ieee80211_is_s1g_beacon(hdr->frame_control)) {
61976198
link->conf->sync_tsf =
61986199
le64_to_cpu(mgmt->u.beacon.timestamp);
61996200
link->conf->sync_device_ts =

0 commit comments

Comments
 (0)