Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp178808lqq; Wed, 12 Jun 2024 22:36:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUEcKTyk+pn9Z1trlh2UcGVoIboVbUlk1GAE5JW22EMYCIikH2pvLaDJDNv3CMwq3wBAmC/8tTSpypCOMbOEO95e7B9UVt0dTS5Jldw8A== X-Google-Smtp-Source: AGHT+IHT4ZoQcdYQULizqQGbp3hBBPcsgx+LuiGm7qCMyOOzruG7ZyYQpIvVuLUfcHP0VIDZpWmh X-Received: by 2002:a05:6870:5491:b0:254:cdac:99a2 with SMTP id 586e51a60fabf-25514e75deemr4164355fac.55.1718256960794; Wed, 12 Jun 2024 22:36:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718256960; cv=pass; d=google.com; s=arc-20160816; b=hU8z1701MaTrMp9QOPCHwLxx2idx2RlOzUr3Kms7e/MRGEdSiUUiKW7YT6FY0XU5Vi rA/KbpyeTugo3kTWBa3leP+8O70uymhtOnchkGJAhAOj0VKYjNS0/HKtGfILycthQ4Lp BDu5bH/gL+NQS5Vjop6RGkhVnjpinUTwmXHGhOOGEltuS+2a6dYJLiRB45yH6VM3FLH3 hGIyM5qB11ydQJirZL/HTNFBblkrnWi013EMvIS5W6Y3tg+DzVzHWyOKIik/E5D33Rqi Gcp9PRLKIztzp8rh8OIk5ZtCYNOCH7LyKx0CEc4bW3UP2V4VqrL+b+9hPuJXqkxF7eLl QXMA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=0ARywWXlr+hi/PMlESMsXtM7Cj6u2PTVthGubEjJkGw=; fh=qsQlrNBpQ4v/Vdx7dSNnVAPnV8t1MWSPuaS7sQbhLxc=; b=Cubu59VsZnjTjDrd9LHVkSbB2ife9ICDxjMt1dkNoQ/1yCibVzZXVFTD8D9QCMDWOl 4kZybmM5w6CHFHiYwv8HAkOh2B0KOmYroAv98CmzV+0kk5rJJIK7EFkI/6/4wfJ208F3 Apl+yt9IaHRvbuKBZ9YeSE2TwS/QsnTvZewoWCkw3tGaWWGzeheYuE712nmCYzYMrQJC O8Yi7IEVsOxJdyiNA+gW/wQZr3LdpSJrHUInldI2YtjqLBzrhNdW3ccx1K3rPm7eAXBE WSGYDjH872ei244U7RtSg8Tco9iX7huj/pc5lEL8e+FgVCHDLrgzvLO2lljSOxrW+T1w S/mQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=joTdBBJa; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-8959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705ccb9c6b4si714803b3a.332.2024.06.12.22.36.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 22:36:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=joTdBBJa; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-8959-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 37BB2284848 for ; Thu, 13 Jun 2024 05:36:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2029135A72; Thu, 13 Jun 2024 05:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="joTdBBJa" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 343911304BA for ; Thu, 13 Jun 2024 05:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718256957; cv=none; b=OTIyC2A28aan5SMD2+DMx1Otk26VjaDEhUrc2EnDLkRHV5jXV2gCqQ51wPbusQ3H0rbCVW6dPeY2RTahHj+Amyvbytmr2Nef5WrKpn5UlI9hzXlFQpLKpGlQNdpl3fnFuRqmcmiadNH01tBv2ncsDNtl8SZmmpPDqQvcx+zMiEk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718256957; c=relaxed/simple; bh=dL8kPnoxMzCa//HP4ni33K0ZDgI8bV1AK0cN/wBWDdw=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NG5hMz6Rfv8MyLdZhG8axLA6mh0gcGbS9+WyiZdexLjBzcerlkZpnL4L/BSlpsTi/NtFK194QAduPaYk63bYZMTsDOGupCW7vjuMAhsxV9LmiMYP1S+iBPy1bqzvXG0doyUt1oCnOZYJJXBsil8uC5kagqIi2JhdYu+BgHpfi30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=joTdBBJa; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45CKnjnQ018001; Thu, 13 Jun 2024 05:35:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=0ARywWXlr+hi/PMlESMsXt M7Cj6u2PTVthGubEjJkGw=; b=joTdBBJaSXHU2APyB19pZ0DqX7wOdiUfsejv83 NMA/68RLMkdhccbXw98uXZvKOxO+DkxweTjwA5dhjbT3iyATF/okLnoGPGmbpoUt 1ShUVdqvBAQ07H+LT25YKV5F36sIeqKsjmDAoDPp4YrVWRTJrpnGSzDDuCptrBiF gKFHyRnXQdTABSPKuIywSizWUP2fmj/d06F+PQgRGMSl9x/plSvXXwjHImqV4LgH I46TYH3P57m76KcsMlWYfDZiEWlFTDSYC3cP35t10/NJJq+2sWWEXj9KnbezUP+U A2OwRBwNwTyT1x7dqtY88XaJpkTfVGIpqDwhcD3YJTmHNfSg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yqe93hmap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 05:35:49 +0000 (GMT) Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45D5Znc9015729 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jun 2024 05:35:49 GMT Received: from hu-ajithc-blr.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Wed, 12 Jun 2024 22:35:47 -0700 From: Ajith C To: CC: , Ajith C Subject: [PATCH] wifi: ath12k: fix firmware crash due to invalid peer nss Date: Thu, 13 Jun 2024 11:05:28 +0530 Message-ID: <20240613053528.2541645-1-quic_ajithc@quicinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: BfRG3V3qm2e-6iNOky76yamqxoOQRNU0 X-Proofpoint-ORIG-GUID: BfRG3V3qm2e-6iNOky76yamqxoOQRNU0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-12_12,2024-06-13_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 impostorscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 adultscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406130037 Currently, if the access point receives an association request containing an Extended HE Capabilities Information Element with an invalid MCS-NSS, it triggers a firmware crash. This issue arises when EHT-PHY capabilities shows support for a bandwidth and MCS-NSS set for that particular bandwidth is filled by zeros and due to this, driver obtains peer_nss as 0 and sending this value to firmware causes crash. Address this issue by implementing a validation step for the peer_nss value before passing it to the firmware. If the value is greater than zero, proceed with forwarding it to the firmware. However, if the value is invalid, reject the association request to prevent potential firmware crashes. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Ajith C --- drivers/net/wireless/ath/ath12k/mac.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 784964ae03ec..198aa5a88a6e 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4087,6 +4087,11 @@ static int ath12k_station_assoc(struct ath12k *ar, ath12k_peer_assoc_prepare(ar, vif, sta, &peer_arg, reassoc); + if (peer_arg.peer_nss < 1) { + ath12k_warn(ar->ab, + "invalid peer NSS %d\n", peer_arg.peer_nss); + return -EINVAL; + } ret = ath12k_wmi_send_peer_assoc_cmd(ar, &peer_arg); if (ret) { ath12k_warn(ar->ab, "failed to run peer assoc for STA %pM vdev %i: %d\n", -- 2.25.1