Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3624729pxb; Mon, 24 Jan 2022 13:47:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6AuocSAe0A/ZJE+ViPeiC2jmWluchHMrbhpLTEWKjPTzEg0XjnPlnoQHQtTMU4YSq5CL6 X-Received: by 2002:a17:902:b181:b0:149:90e2:896a with SMTP id s1-20020a170902b18100b0014990e2896amr15913057plr.149.1643060878507; Mon, 24 Jan 2022 13:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060878; cv=none; d=google.com; s=arc-20160816; b=TuiISUQDhkWSbKimdhg75Ld5m72iyMrFeLumD0lwQW1NVxcevra/5arHMt2lQlM5lc gbDbEV7yopTI3/qp3kiH7GarRA7jK+ilKO1tpWi0ZcSJ8bDirzii0vEBlh/QNYX6Jtfi tmRAsYlcx8Ujt/ezCZAu88o8Tsq8dEG+LyVwT4vBrGJEJ4gFb7/LtZ1MqIg5jntbfBA/ RoJmYvNdbIwvhrpQveSoEA1+iqiJ97tqB8t52NpJms4x119YBnUsj+eSIglg57YdjkIo 7Kl227foS3WqtzagCW2nQEuawhscHTVX9dQFoDX1MekxDJNqRKo3gnTG/fYMCluqsElA QumA== 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=Iuzcllj48UrhgrttLKEsk3flQ0B9jeWhBq0d1BJ01pQ=; b=ziwkyRN2RucmO6iSebd/u9IY0LIOd17enVYHqHgAjiDTu776X2p0+0QoWqAB8H5lIb 4kjlVZNLxndT8aVX4ZyURkSEvqpuwP/PgWT5pxh5WsRFWJFgQb2P9GheQ7JC3Gr1z6t0 2DyuDHBqfsfLhRe2AAjk7cNfOEQW+cfNBEv7YJDiBYKnFiWrQYj0gWZ21dVIZMyRTSdS vxH4q4erNZjgrEM0e6azpxLdXjAo7sAEfmBb9FgXR1A83LPVS10HeuUrQD3hoYy2iBpH FEW9ITXhYX0A5xA4Dn9tjLLUzP9uBUeQzTUW1UfB3OZu99Np9LcIUVf1AEMjBdnI+6Ts nnbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gIrKXhgs; 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 d129si1882416pgc.536.2022.01.24.13.47.46; Mon, 24 Jan 2022 13:47:58 -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=gIrKXhgs; 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 S1454864AbiAXVeA (ORCPT + 99 others); Mon, 24 Jan 2022 16:34:00 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:54632 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443989AbiAXU7p (ORCPT ); Mon, 24 Jan 2022 15:59:45 -0500 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 ams.source.kernel.org (Postfix) with ESMTPS id 91CCEB8105C; Mon, 24 Jan 2022 20:59:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0F41C340E7; Mon, 24 Jan 2022 20:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057981; bh=mhCHDlztR2xaxoVSVKhjzH4y06h0vyKSkKPd3wDz+iw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gIrKXhgsv+b9KjJk0gRvR3qM965zFBRj2u1O75EUkHuL2SZpNS2Psd8LrBWjDC2PA dTmPeY7SL4jOOxejD5ULTCiCvwcumiKlsJVWB22BgkK1jmXYYWYsYET8WlrFmT4rDN h2bASIa7M2XvsauwJ/wu6oiNGLV/9odz0ImiBUkE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sven Eckelmann , Karthikeyan Kathirvel , Kalle Valo , Sasha Levin Subject: [PATCH 5.16 0142/1039] ath11k: clear the keys properly via DISABLE_KEY Date: Mon, 24 Jan 2022 19:32:11 +0100 Message-Id: <20220124184129.951911203@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Karthikeyan Kathirvel [ Upstream commit 436a4e88659842a7cf634d7cc088c8f2cc94ebf5 ] DISABLE_KEY sets the key_len to 0, firmware will not delete the keys if key_len is 0. Changing from security mode to open mode will cause mcast to be still encrypted without vdev restart. Set the proper key_len for DISABLE_KEY cmd to clear the keys in firmware. Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Reported-by: Sven Eckelmann Signed-off-by: Karthikeyan Kathirvel [sven@narfation.org: split into separate patches, clean up commit message] Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211115100441.33771-1-sven@narfation.org Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/mac.c | 4 +--- drivers/net/wireless/ath/ath11k/wmi.c | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 1cc55602787bb..cdee7545e876a 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -3316,9 +3316,7 @@ static int ath11k_install_key(struct ath11k_vif *arvif, return 0; if (cmd == DISABLE_KEY) { - /* TODO: Check if FW expects value other than NONE for del */ - /* arg.key_cipher = WMI_CIPHER_NONE; */ - arg.key_len = 0; + arg.key_cipher = WMI_CIPHER_NONE; arg.key_data = NULL; goto install; } diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 04238c29419b5..621a63d6c8c6d 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -1689,7 +1689,8 @@ int ath11k_wmi_vdev_install_key(struct ath11k *ar, tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd)); tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) | FIELD_PREP(WMI_TLV_LEN, key_len_aligned); - memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned); + if (arg->key_data) + memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned); ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_INSTALL_KEY_CMDID); if (ret) { -- 2.34.1