Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9422935pxu; Mon, 28 Dec 2020 16:01:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+pN2TxUjPpCeaTuBMFD6Zaqk6BwNs55MmBQvKeNMj2xXtcN9G4EDDj2+HLsT7VDRIsgvq X-Received: by 2002:a17:906:a415:: with SMTP id l21mr42802772ejz.2.1609200106666; Mon, 28 Dec 2020 16:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609200106; cv=none; d=google.com; s=arc-20160816; b=O9DfyTwfKnU10gED1CwTj8YmbXijif1L1clcYzEcExqX2SH3sotBVHhBViqlIlguDG Bc7HMmpwN6MHtqvplrdDKpzAcfdB4hlsMzRwtB4Vwyr99IXvTydwmQZwkRQgzpGom6gf 9Kkwla5NqGBuwDBNsXJ7/BKuZ68fA/ns/LyOXW7uwn773VCumybGeRUMB6lVrRzGDJmr MjtQN/F0t/roZT+f9gr7Je5cw8eJxzF1UKQa/vaG861l31VG9vok/blVopi0urhIlE6f FkgUmqmBp2RVIE1u7kRvWpUz/9kAlQrKHHR6lnQJfm06mQu/EJHYjZDcSjXTMn3v2I1P g1wA== 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=ikIHottP9NxUDSYZ9iSKQRADOLEh5/2qQTuUtKKVJt4=; b=zoJgVYBu8vo8EBTcBSCuo1lTqr4LAvEMZ93r6q5vFpSouauN5Vf+5kJOytCBnaQ7xc /IXY7r4IsQ5sJkPw1Ofo8bvycY/haQ+ycmWJx5Dlfj2yQrpBLNzStBODZlFaMr6SaIIO 1X4pr1B0d0EKof8UpMsgGjUNcQWPU9emJg0g5JvHpWpr3hK7O7DZ7LJ+/6hwSqAHIstN 3diBC7tj8IxodTufIKdgbTCtXtGicPl3RGQUVvNvwpbjNS8cXb7SL8CsfN3uUR/rP6Hy o7jFKpu8Kpm3y2kwq+sH9gbZKEbLo22Fdi67uHgWUJ9XPvKJdNlFxFFfBNylaIXA9Vwm TIoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zKqCO6fw; 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 p9si18740724ejg.481.2020.12.28.16.01.24; Mon, 28 Dec 2020 16:01:46 -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=zKqCO6fw; 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 S2505353AbgL1Ovp (ORCPT + 99 others); Mon, 28 Dec 2020 09:51:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:53122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441603AbgL1OTO (ORCPT ); Mon, 28 Dec 2020 09:19:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C2B6207B2; Mon, 28 Dec 2020 14:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165138; bh=hWySLQw4sci6BfhLpINU3VTFhfulaG8NvVAEH/4QXAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zKqCO6fwbdHcsV4TIGAMNRyVvUDvrIF2HzTwAhP2CyXudQV+yW3tRPdCAmZMCVZHi 23g6rHWqq+n0JwCeXBG4uXC/CjYEwmnYffWjx0IhejV5QAamrX65mQyBu9e93pL0R9 POdw4vbR1ypksI1jUqklwh+yVeDDcJ9psD7Ui/Fc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Carl Huang , Pradeep Kumar Chitrapu , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 426/717] ath11k: Fix incorrect tlvs in scan start command Date: Mon, 28 Dec 2020 13:47:04 +0100 Message-Id: <20201228125041.374941956@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Pradeep Kumar Chitrapu [ Upstream commit f57ad6a9885e8399897daee3249cabccf9c972f8 ] Currently 6G specific tlvs have duplicate entries which is causing scan failures. Fix this by removing the duplicate entries of the same tlv. This also fixes out-of-bound memory writes caused due to adding tlvs when num_hint_bssid and num_hint_s_ssid are ZEROs. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01386-QCAHKSWPL_SILICONZ-1 Fixes: 74601ecfef6e ("ath11k: Add support for 6g scan hint") Reported-by: Carl Huang Signed-off-by: Pradeep Kumar Chitrapu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1607609124-17250-7-git-send-email-kvalo@codeaurora.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/wmi.c | 31 --------------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 8eca92520837e..04b8b002edfe0 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -2198,37 +2198,6 @@ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar, } } - len = params->num_hint_s_ssid * sizeof(struct hint_short_ssid); - tlv = ptr; - tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | - FIELD_PREP(WMI_TLV_LEN, len); - ptr += TLV_HDR_SIZE; - if (params->num_hint_s_ssid) { - s_ssid = ptr; - for (i = 0; i < params->num_hint_s_ssid; ++i) { - s_ssid->freq_flags = params->hint_s_ssid[i].freq_flags; - s_ssid->short_ssid = params->hint_s_ssid[i].short_ssid; - s_ssid++; - } - } - ptr += len; - - len = params->num_hint_bssid * sizeof(struct hint_bssid); - tlv = ptr; - tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_FIXED_STRUCT) | - FIELD_PREP(WMI_TLV_LEN, len); - ptr += TLV_HDR_SIZE; - if (params->num_hint_bssid) { - hint_bssid = ptr; - for (i = 0; i < params->num_hint_bssid; ++i) { - hint_bssid->freq_flags = - params->hint_bssid[i].freq_flags; - ether_addr_copy(¶ms->hint_bssid[i].bssid.addr[0], - &hint_bssid->bssid.addr[0]); - hint_bssid++; - } - } - ret = ath11k_wmi_cmd_send(wmi, skb, WMI_START_SCAN_CMDID); if (ret) { -- 2.27.0