Skip to content

Commit

Permalink
wifi: cfg80211: Drop entries with invalid BSSIDs in RNR
Browse files Browse the repository at this point in the history
Ignore AP information for entries that include an invalid
BSSID in the TBTT information field, e.g., all zeros BSSIDs.

Fixes: c8cb5b8 ("nl80211/cfg80211: support 6 GHz scanning")
Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Gregory Greenman <[email protected]>
Link: https://lore.kernel.org/r/20230424103224.5e65d04d1448.Ic10c8577ae4a85272c407106c9d0a2ecb5372743@changeid
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
ilanpeer2 authored and jmberg-intel committed May 16, 2023
1 parent 2042944 commit 1b6b4ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright 2008 Johannes Berg <[email protected]>
* Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2016 Intel Deutschland GmbH
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*/
#include <linux/kernel.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -540,6 +540,10 @@ static int cfg80211_parse_ap_info(struct cfg80211_colocated_ap *entry,
/* skip the TBTT offset */
pos++;

/* ignore entries with invalid BSSID */
if (!is_valid_ether_addr(pos))
return -EINVAL;

memcpy(entry->bssid, pos, ETH_ALEN);
pos += ETH_ALEN;

Expand Down

0 comments on commit 1b6b4ed

Please sign in to comment.