Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3707697pxb; Mon, 24 Jan 2022 15:58:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWFjcXVxWZGlP38LCnlsycT6khaOAjVy3eqjraAnimokxmXuum5XqfHmQmCMwTICniLRPC X-Received: by 2002:a17:90a:5913:: with SMTP id k19mr700196pji.176.1643068699807; Mon, 24 Jan 2022 15:58:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068699; cv=none; d=google.com; s=arc-20160816; b=aYjchm06mf9aWPgo7Jq+x0YFvAqLMmkw2YX46MQmCK1HYkBRIAvUWmNEZVA3T4CGPg IQNC9XkaFuIebSq9PP8989KqSxQtiG5HCRutKsUNxYpCXj3EkZoDKCkCLmuDkLLzcH/G RG6yrofE9Xbr4G9nRJ2PxO+5nD1sy6F/a58HosqPJVzGM/MFjKwdbOgkAD0AjEqsPOZo ds+teyArUII3mHPM1cQmHiIIQ8HtSXW7pi4g2YbYUG45WD/IrtXlk4ijBeYdoFAtFfzv ez17VAPErgU3djMwPUE5yTY58D9ayZeeuKFaoEg+fWawp/3/8xXbMXOEHy5/gV1yyNR0 uo8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eddcBWeq28Rm2m+PYZ8m+KKFx8YqGg3FZcKjIxJQ+wQ=; b=l1pCGDfybmIybj9aBKiTvL8NJa33PXRf8A1ljX2DS5FlwW+u3/bRWuSoDxMX+FhcDt XGtzKUoSYE3gIOGUIBhIRzUqzc+e0Ue5JVWQ/cJ5VpgvXpu57ZT6N97GQOpbfjyplSZ0 oX2f3wopYb/zniaD3Vd9zT3uUGF0ruAXXXQv0ykVWh+j18pkwYzAs3k+Akp/5XmA9ylC XOQIKXQsLJmTDFZHz/G40I9HxPeWODg7z5JiGaJN+8KoGHDsx+GBwjDwDqx9sycqOUrk oIMQ/KK7Gc5wPmxK9fJgINc/B1XRk/yEiv6CpIhhyL1uSVPzzoYmdJDH8t0QTII5DT+j IAuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FTDYZrkN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si12915018plk.173.2022.01.24.15.58.08; Mon, 24 Jan 2022 15:58:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FTDYZrkN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356421AbiAXXyR (ORCPT + 99 others); Mon, 24 Jan 2022 18:54:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1846490AbiAXXQG (ORCPT ); Mon, 24 Jan 2022 18:16:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82C24C0604DF; Mon, 24 Jan 2022 13:24:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 47FA3B81057; Mon, 24 Jan 2022 21:24:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67983C340E4; Mon, 24 Jan 2022 21:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059486; bh=sdOOB4UKo5fjVxrk5O+5GVl9Uq6JG4ZrtYrtaSgng6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FTDYZrkNpWH8h8XxGiNPQXTww6PE1AZfzNGY0YLdDayESdsjP+bg1xIajym3Csw7K yzOUv62VnlQuX/0+QKjbWr1roE96fl6yZ5mt4q6bCks1YE2gKk0xMI9DfjsCWVoYZk h5kBvVuQKUy+3yWMQHGzmc5ysdPc/rMNgTJiMsl4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Gong , Kalle Valo , Sasha Levin Subject: [PATCH 5.16 0632/1039] ath10k: drop beacon and probe response which leak from other channel Date: Mon, 24 Jan 2022 19:40:21 +0100 Message-Id: <20220124184146.591001438@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wen Gong [ Upstream commit 3bf2537ec2e33310b431b53fd84be8833736c256 ] 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 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211208061752.16564-1-quic_wgong@quicinc.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/wmi.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 7c1c2658cb5f8..4733fd7fb169e 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -2611,9 +2611,30 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) 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 +2648,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) -- 2.34.1