From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03052C3ABB6 for ; Tue, 6 May 2025 00:31:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HnX5jTCqkPQ57HDjyoyamcXHVYyfecjTqGaJat2jqDY=; b=BN5ur2JL9jipVncqJ0aTDOBgjp EMWhHNEv3O4JnhKq71XQQxBJuMQlmvUMokyRt10m6M8x5n0txzg+39NkhXatUC3JrL3ypACjwjx3U GfVH4RVqfq4F7mS6eQqmFtApHVC0EaDPN/WtmlEn9woFf+qdApKI/GCsCuwWhyxFUDuVHXIgJy3p8 1U9OWhkcBwjgYaizwZAJl/JbPz6gpcDWmCI7MfYFf26Tp+xIUBnC+ipJ29ca/ClxQkz7Nn/0N0aK4 AAjJx57vwWgD9RQjR9FA1qc//rndW4KNX1FiCbacckoaZM8ldgkhTSHKen7wsvWCX5MHHCyq7nPmI vKM5cuiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uC6Df-00000009IYZ-3AFm; Tue, 06 May 2025 00:31:35 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uC4Od-00000008nf2-3zWe for ath12k@lists.infradead.org; Mon, 05 May 2025 22:34:49 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A131AA4CE4E; Mon, 5 May 2025 22:29:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC3BFC4CEED; Mon, 5 May 2025 22:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746484487; bh=HHPlxbkjj8uKoAUKROxb6hyWNeK7YJF8UJPFP1hVd98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fknkrSOeisnTxuJQsVVmml84GP4EyxhgRbwc/pNXM9dGIe3sQc90PSEN7ftmTaAE6 b52gRXeltP/8KQhcrHdlBCO92TwwdTsDFwbNAuFPIyqFo585l77e18/DKBvvXJSmQz gxL6ARpbHbChasRXWzRDMLaFmTFkfQ//ATZNRCf8l1LU3yuqBTLrUvm5sHv0YWO5g/ pmh4A0NGqug20SQwofrYmg5p0rH8T9MNb6Y6AihBh3Wmjp0aU+52Ind6QlAEHRhx+n 7KXBIi/IKaYbQ1ZlsihxIF8+aKuephrcdBVLE/ma/IFBPdCVJWJN8ECUnBpGQ4VoWD ccuOmv86KprtA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aditya Kumar Singh , Vasanthakumar Thiagarajan , Nicolas Escande , Jeff Johnson , Sasha Levin , jjohnson@kernel.org, linux-wireless@vger.kernel.org, ath12k@lists.infradead.org Subject: [PATCH AUTOSEL 6.14 495/642] wifi: ath12k: use arvif instead of link_conf in ath12k_mac_set_key() Date: Mon, 5 May 2025 18:11:51 -0400 Message-Id: <20250505221419.2672473-495-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505221419.2672473-1-sashal@kernel.org> References: <20250505221419.2672473-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.14.5 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250505_153448_114922_4F9C0D79 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: ath12k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath12k" Errors-To: ath12k-bounces+ath12k=archiver.kernel.org@lists.infradead.org From: Aditya Kumar Singh [ Upstream commit 00e4dc11695d48322780812b503314682659e98b ] Currently, in ath12k_mac_set_key(), if sta is not present, the address is retrieved from link_conf's bssid or addr member, depending on the interface type. When operating as an ML station and during shutdown, link_conf will not be available. This can result in the following error: ath12k_pci 0004:01:00.0: unable to access bss link conf in set key for vif AA:BB:CC:DD:EE:FF link 1 The primary purpose of accessing link_conf is to obtain the address for finding the peer. However, since arvif is always valid in this call, it can be used instead. Add change to use arvif instead of link_conf. A subsequent change will expose this issue but since tear down will give error, this is included first. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1.97421.5 # Nicolas Escande Reviewed-by: Vasanthakumar Thiagarajan Signed-off-by: Aditya Kumar Singh Tested-by: Nicolas Escande Link: https://patch.msgid.link/20250204-unlink_link_arvif_from_chanctx-v2-5-764fb5973c1a@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath12k/mac.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 9123ffab55b52..95ad9fefbdfcd 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -4534,9 +4534,6 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum set_key_cmd cmd, struct ath12k_link_sta *arsta, struct ieee80211_key_conf *key) { - struct ath12k_vif *ahvif = arvif->ahvif; - struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif); - struct ieee80211_bss_conf *link_conf; struct ieee80211_sta *sta = NULL; struct ath12k_base *ab = ar->ab; struct ath12k_peer *peer; @@ -4553,19 +4550,10 @@ static int ath12k_mac_set_key(struct ath12k *ar, enum set_key_cmd cmd, if (test_bit(ATH12K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags)) return 1; - link_conf = ath12k_mac_get_link_bss_conf(arvif); - if (!link_conf) { - ath12k_warn(ab, "unable to access bss link conf in set key for vif %pM link %u\n", - vif->addr, arvif->link_id); - return -ENOLINK; - } - if (sta) peer_addr = arsta->addr; - else if (ahvif->vdev_type == WMI_VDEV_TYPE_STA) - peer_addr = link_conf->bssid; else - peer_addr = link_conf->addr; + peer_addr = arvif->bssid; key->hw_key_idx = key->keyidx; -- 2.39.5