From patchwork Fri Dec 4 15:20:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1411092 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cnbyr6CY3z9sWy; Sat, 5 Dec 2020 02:21:40 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1klCts-0006dV-1P; Fri, 04 Dec 2020 15:21:36 +0000 Received: from mail-pl1-f196.google.com ([209.85.214.196]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1klCtm-0006VQ-2n for kernel-team@lists.ubuntu.com; Fri, 04 Dec 2020 15:21:30 +0000 Received: by mail-pl1-f196.google.com with SMTP id 4so3265008plk.5 for ; Fri, 04 Dec 2020 07:21:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OMTfFWj4XP8jvZa1tSRzwdh/nqR0t8IRdZxv6DiP5Mg=; b=VhcxG9/RisiwXigtc2QHMPeVrDpna4qrdL9FrG8JoXo4Rum3pZaCZZ+4BJQesdlfR7 xhywybrtMZlsf18CCp+gJdbLUwSauezsJEOozAemFSiY3ZOZ9cU/gtKhpLobOC8Frxq1 v/qMl0TDQpqchZf+Ct6k0rj4I0IHA51qxb9Hj9E4RJOz2/WNDnzhXfHmapMwPs3v5Acb DX9U2vSSKQ8LvCEX+SZWShU9IfxeLzWdCsItp1PTQh5gwfHlpjI8ebqUK5lrjQ+N+tVo kumZZkmPKoc0f6tg/uYdrDgKYXGxqDLSU5ngKud2Tcp6nE8Dqq5ME4oEiayuhDfAO4v4 AxZw== X-Gm-Message-State: AOAM532boQejf8mOPU31TQo3F34yrISgXmlL/RBbC0XH1E+4zAAtDF7h K8Js81FmBrfqlUduPMBPKHdc5qIs3hRYjQ== X-Google-Smtp-Source: ABdhPJwQg/N8Wngizx3DFTPWRDpVe96fDOztmKV15XjjHnoVnFr8pwOEk60hqL2UO9/kKRdtTeuWfA== X-Received: by 2002:a17:902:a982:b029:da:82d0:9a2f with SMTP id bh2-20020a170902a982b02900da82d09a2fmr4391967plb.43.1607095284694; Fri, 04 Dec 2020 07:21:24 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id n4sm2865897pfu.150.2020.12.04.07.21.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 07:21:23 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 23/26][SRU][U/OEM-5.10] UBUNTU: SAUCE: ath11k: Fix incorrect tlvs in scan start command Date: Fri, 4 Dec 2020 23:20:09 +0800 Message-Id: <20201204152013.195139-24-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201204152013.195139-1-vicamo.yang@canonical.com> References: <20201204152013.195139-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.196; envelope-from=vicamo@gmail.com; helo=mail-pl1-f196.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Pradeep Kumar Chitrapu BugLink: https://bugs.launchpad.net/bugs/1879633 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 (cherry picked from commit bfa226b7e2e988609631e7f6cd0d4e9ede423f6b https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git) Signed-off-by: You-Sheng Yang --- 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 b5256c0bf97c..08bd2039e6d2 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) {