Skip to content

Commit 3bf2537

Browse files
Wen Gongkvalo
authored andcommitted
ath10k: drop beacon and probe response which leak from other channel
When scan request on channel 1, it also receive beacon from other channels, and the beacon also indicate to mac80211 and wpa_supplicant, and then the bss info appears in radio measurement report of radio measurement sent from wpa_supplicant, thus lead RRM case fail. This is to drop the beacon and probe response which is not the same channel of scanning. Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049 Signed-off-by: Wen Gong <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d3d358e commit 3bf2537

File tree

1 file changed

+26
-1
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+26
-1
lines changed

drivers/net/wireless/ath/ath10k/wmi.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,9 +2611,30 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
26112611
ath10k_mac_handle_beacon(ar, skb);
26122612

26132613
if (ieee80211_is_beacon(hdr->frame_control) ||
2614-
ieee80211_is_probe_resp(hdr->frame_control))
2614+
ieee80211_is_probe_resp(hdr->frame_control)) {
2615+
struct ieee80211_mgmt *mgmt = (void *)skb->data;
2616+
u8 *ies;
2617+
int ies_ch;
2618+
26152619
status->boottime_ns = ktime_get_boottime_ns();
26162620

2621+
if (!ar->scan_channel)
2622+
goto drop;
2623+
2624+
ies = mgmt->u.beacon.variable;
2625+
2626+
ies_ch = cfg80211_get_ies_channel_number(mgmt->u.beacon.variable,
2627+
skb_tail_pointer(skb) - ies,
2628+
sband->band);
2629+
2630+
if (ies_ch > 0 && ies_ch != channel) {
2631+
ath10k_dbg(ar, ATH10K_DBG_MGMT,
2632+
"channel mismatched ds channel %d scan channel %d\n",
2633+
ies_ch, channel);
2634+
goto drop;
2635+
}
2636+
}
2637+
26172638
ath10k_dbg(ar, ATH10K_DBG_MGMT,
26182639
"event mgmt rx skb %pK len %d ftype %02x stype %02x\n",
26192640
skb, skb->len,
@@ -2627,6 +2648,10 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
26272648
ieee80211_rx_ni(ar->hw, skb);
26282649

26292650
return 0;
2651+
2652+
drop:
2653+
dev_kfree_skb(skb);
2654+
return 0;
26302655
}
26312656

26322657
static int freq_to_idx(struct ath10k *ar, int freq)

0 commit comments

Comments
 (0)