Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2101563iof; Tue, 7 Jun 2022 19:47:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjpZp+Asga2EgLUmP8FPNiuWLRI6x5ld63tBggDeYPbwpNf2rBfaaNGQr0auRa4Wj0K7Qx X-Received: by 2002:a05:6a00:1385:b0:50a:9768:9eca with SMTP id t5-20020a056a00138500b0050a97689ecamr32309358pfg.43.1654656472081; Tue, 07 Jun 2022 19:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654656472; cv=none; d=google.com; s=arc-20160816; b=ASxQx7xOpnBecs1Q7eOeL8SK2w3kqiJWgjQJlCLjxlozdj/tnQtV3n0CuaxIEXS+oi GH3wffSjGndGBnXrqtT8mjkUbChcaQwpdYFYxum3ft8K5nosbSAW+PUUX0NBsXpVG7uA 6o93XtoxJKo78K+mfeKUcWGCvjPXwQqoM/4G9zrgIaqErPHPgE5foDCbn7sApCHGxUiz IkffaIZwvI+CQAqizDGowk0FWErXerVdMvXc8dvaSbCg1nTFhNSNWJoyo87UJwDsj3eB NbR3eVxM6f0U71jRvjuvssmJ1hw//+VjuJQGjWkVaqSsNnVaIiWlhtC21NHSShpd8RMX fZcA== 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=1m5o0FlToiTBEFxpyV19pVp+YoSlY8bAVWW/YL3uhf8=; b=MEATwb1cM6ZzBADwRml//HAymOeMB5HXzdyrOpwIkpEa5kYcyapC48vLzQod77AnFf LnytBztB6RDfHEQBUP+p05lZnkYktE1fe0eC1uvQlMi1cY4Sq68+UQ5NAqNrGFdDRUMg Kr7eJoxPVsR8OL3jG/VofLE+GxkGEDp+zLguL/yQIT3/NHX5RHHF5JtQx0Zjv7TXli4I 746EYGn8KfeubkOPQ/xS/h8Gy38Nwubo+OIm8dahTildiqdscfw96fmokZIcbMWHKIH8 FVk65rN7I2uNCySi4WS0oQmv4c3gj9EtV7fH1/aM3AuOi4O3mBGZfQnWVKw1AxTYY5Hl C1PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oQOZtwgO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id iz6-20020a170902ef8600b0015d04e10579si26570841plb.352.2022.06.07.19.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 19:47:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oQOZtwgO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 68EB0274133; Tue, 7 Jun 2022 18:18:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383083AbiFGWA4 (ORCPT + 99 others); Tue, 7 Jun 2022 18:00:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377589AbiFGVCs (ORCPT ); Tue, 7 Jun 2022 17:02:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CA0E5714E; Tue, 7 Jun 2022 11:48:27 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 7222D6156D; Tue, 7 Jun 2022 18:48:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8199EC385A5; Tue, 7 Jun 2022 18:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627704; bh=2nJqjbrkEXx+zlta2BV0O1ePumXPRWHtyr5AtREfBTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQOZtwgOR4XjkqTIKB5+AaZVsJOoxJABhVmmnT+01ML6lg23ee5x/b8AsMQAQNOpv V6ioNvKeWAxXMXXguXKPAhCAFtpfi7a1t4dGBKSRiax9qhydc8aCxKXfAfg4zVMkUi 69RQpY02mOXgB2IAfgEbG0c6ewWPFioe4yNNQ3SM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Karthikeyan Kathirvel , Kalle Valo , Sasha Levin Subject: [PATCH 5.18 061/879] ath11k: Change max no of active probe SSID and BSSID to fw capability Date: Tue, 7 Jun 2022 18:52:59 +0200 Message-Id: <20220607165004.463095644@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Karthikeyan Kathirvel [ Upstream commit 50dc9ce9f80554a88e33b73c30851acf2be36ed3 ] The maximum number of SSIDs in a for active probe requests is currently reported as 16 (WLAN_SCAN_PARAMS_MAX_SSID) when registering the driver. The scan_req_params structure only has the capacity to hold 10 SSIDs. This leads to a buffer overflow which can be triggered from wpa_supplicant in userspace. When copying the SSIDs into the scan_req_params structure in the ath11k_mac_op_hw_scan route, it can overwrite the extraie pointer. Firmware supports 16 ssid * 4 bssid, for each ssid 4 bssid combo probe request will be sent, so totally 64 probe requests supported. So set both max ssid and bssid to 16 and 4 respectively. Remove the redundant macros of ssid and bssid. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01300-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Kathirvel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220329150221.21907-1-quic_kathirve@quicinc.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/wmi.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h index 587f42307250..b5b72483477d 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.h +++ b/drivers/net/wireless/ath/ath11k/wmi.h @@ -3088,9 +3088,6 @@ enum scan_dwelltime_adaptive_mode { SCAN_DWELL_MODE_STATIC = 4 }; -#define WLAN_SCAN_MAX_NUM_SSID 10 -#define WLAN_SCAN_MAX_NUM_BSSID 10 - #define WLAN_SSID_MAX_LEN 32 struct element_info { @@ -3105,7 +3102,6 @@ struct wlan_ssid { #define WMI_IE_BITMAP_SIZE 8 -#define WMI_SCAN_MAX_NUM_SSID 0x0A /* prefix used by scan requestor ids on the host */ #define WMI_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000 @@ -3113,10 +3109,6 @@ struct wlan_ssid { /* host cycles through the lower 12 bits to generate ids */ #define WMI_HOST_SCAN_REQ_ID_PREFIX 0xA000 -#define WLAN_SCAN_PARAMS_MAX_SSID 16 -#define WLAN_SCAN_PARAMS_MAX_BSSID 4 -#define WLAN_SCAN_PARAMS_MAX_IE_LEN 256 - /* Values lower than this may be refused by some firmware revisions with a scan * completion with a timedout reason. */ @@ -3312,8 +3304,8 @@ struct scan_req_params { u32 n_probes; u32 *chan_list; u32 notify_scan_events; - struct wlan_ssid ssid[WLAN_SCAN_MAX_NUM_SSID]; - struct wmi_mac_addr bssid_list[WLAN_SCAN_MAX_NUM_BSSID]; + struct wlan_ssid ssid[WLAN_SCAN_PARAMS_MAX_SSID]; + struct wmi_mac_addr bssid_list[WLAN_SCAN_PARAMS_MAX_BSSID]; struct element_info extraie; struct element_info htcap; struct element_info vhtcap; -- 2.35.1