* [PATCH v2] ath10k: drop beacon and probe response which leak from other channel
@ 2021-12-08 6:17 Wen Gong
2021-12-08 9:00 ` Kalle Valo
2021-12-09 8:16 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Wen Gong @ 2021-12-08 6:17 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, quic_wgong
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 <quic_wgong@quicinc.com>
---
v2: rebased to ath.git ath-202112071521
drivers/net/wireless/ath/ath10k/wmi.c | 28 ++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 7c1c2658cb5f..07764ee409fe 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2610,10 +2610,32 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
if (ieee80211_is_beacon(hdr->frame_control))
ath10k_mac_handle_beacon(ar, skb);
+
if (ieee80211_is_beacon(hdr->frame_control) ||
- ieee80211_is_probe_resp(hdr->frame_control))
+ ieee80211_is_probe_resp(hdr->frame_control)) {
+ struct ieee80211_mgmt *mgmt = (void *)skb->data;
+ u8 *ies;
+ int ies_ch;
+
status->boottime_ns = ktime_get_boottime_ns();
+ if (!ar->scan_channel)
+ goto drop;
+
+ ies = mgmt->u.beacon.variable;
+
+ ies_ch = cfg80211_get_ies_channel_number(mgmt->u.beacon.variable,
+ skb_tail_pointer(skb) - ies,
+ sband->band);
+
+ if (ies_ch > 0 && ies_ch != channel) {
+ ath10k_dbg(ar, ATH10K_DBG_MGMT,
+ "channel mismatched ds channel %d scan channel %d\n",
+ ies_ch, channel);
+ goto drop;
+ }
+ }
+
ath10k_dbg(ar, ATH10K_DBG_MGMT,
"event mgmt rx skb %pK len %d ftype %02x stype %02x\n",
skb, skb->len,
@@ -2627,6 +2649,10 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
ieee80211_rx_ni(ar->hw, skb);
return 0;
+
+drop:
+ dev_kfree_skb(skb);
+ return 0;
}
static int freq_to_idx(struct ath10k *ar, int freq)
base-commit: 4f4f8aee394b73abf5e5f98c63187fdbf1d627f0
--
2.31.1
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ath10k: drop beacon and probe response which leak from other channel
2021-12-08 6:17 [PATCH v2] ath10k: drop beacon and probe response which leak from other channel Wen Gong
@ 2021-12-08 9:00 ` Kalle Valo
2021-12-09 8:16 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-12-08 9:00 UTC (permalink / raw)
To: Wen Gong; +Cc: ath10k, linux-wireless
Wen Gong <quic_wgong@quicinc.com> writes:
> 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 <quic_wgong@quicinc.com>
> ---
> v2: rebased to ath.git ath-202112071521
>
> drivers/net/wireless/ath/ath10k/wmi.c | 28 ++++++++++++++++++++++++++-
> 1 file changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
> index 7c1c2658cb5f..07764ee409fe 100644
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2610,10 +2610,32 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
> if (ieee80211_is_beacon(hdr->frame_control))
> ath10k_mac_handle_beacon(ar, skb);
>
> +
This caused a new warning:
drivers/net/wireless/ath/ath10k/wmi.c:2613: Please don't use multiple blank lines
Fixed in the pending branch.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ath10k: drop beacon and probe response which leak from other channel
2021-12-08 6:17 [PATCH v2] ath10k: drop beacon and probe response which leak from other channel Wen Gong
2021-12-08 9:00 ` Kalle Valo
@ 2021-12-09 8:16 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-12-09 8:16 UTC (permalink / raw)
To: Wen Gong; +Cc: ath10k, linux-wireless, quic_wgong
Wen Gong <quic_wgong@quicinc.com> wrote:
> 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 <quic_wgong@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Patch applied to ath-next branch of ath.git, thanks.
3bf2537ec2e3 ath10k: drop beacon and probe response which leak from other channel
--
https://patchwork.kernel.org/project/linux-wireless/patch/20211208061752.16564-1-quic_wgong@quicinc.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-09 8:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 6:17 [PATCH v2] ath10k: drop beacon and probe response which leak from other channel Wen Gong
2021-12-08 9:00 ` Kalle Valo
2021-12-09 8:16 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).