Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1638433pxb; Tue, 26 Oct 2021 12:49:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFg9vJGTHPFebWUJGcBis3JLm5Bfgjs4KfgQt6bTKL+qlRsSzcTjPrjitBIpo8TT03o5Ss X-Received: by 2002:a17:906:b06:: with SMTP id u6mr33172563ejg.330.1635277780094; Tue, 26 Oct 2021 12:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635277780; cv=none; d=google.com; s=arc-20160816; b=aED0veBHqtlNhBicDjqepeB7Lsb0UdBIYfjibecxdKSnqDekeevKIMDZd4i5hTtF4H y4ly3Y6jYWNY/gtEjkV7xzs0X49zwrErcO/39ku4ok21h6s+0GxePWa1O6c51dBko9Ff wBNIY/kVX+ZtTt0E0jyPeKl9ntT7ia7fjJ5X30FSKX0ZCh9d67WkO87ldyfQiAmF1L8f VfGtFrn71TEJJpBXk5WEMdGyC612EsOTD6fXX3mSF9QVJ5WHKq6ZWdj8VlCwjkhMwW/F /PILmZT8r8a7ql5zX+w4ZC0XrM+tqJmI2+a486UrFLthScKqxqAymMM5j2oAA8OVdp8s Lirg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=EFYjre+MfQX7mQPCg8PKk+XsrQb8WSPn2SjfK23Z5u4=; b=jUpFKazKJgopIzCjO0mJeUhdWiLb2FXzBrr+mu6sL81UTIF+hjo6CLfsx63ROxloRs X39ZNX0D7OAbwmAGPpzJCgL0eobPHOhpA6IJJa+WbNmkfk43bTHZmjJsmv6Jxn4TWXnk T5fE/KMV63cvn3Rk0QyppSt5lsCrClp1QZdwAWvWx+6hzGq8fGRxRD87Dl480tNQHM3Q jZw9sSthX7WZw8gAAaEHm0psra3jvGQC0ru1gdodGUXHxSoY1BHI7U4UGOLRqoQzq3uJ kmb4KxGPJ6G/aA00PMxRKzDk394f4mFkK4ZH06SjojDL0axgJ7BOL2vEDVrVRFXUn4KP XXHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=DcDNDAZy; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw2si8702703ejc.730.2021.10.26.12.49.15; Tue, 26 Oct 2021 12:49:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@narfation.org header.s=20121 header.b=DcDNDAZy; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237182AbhJZQGL (ORCPT + 67 others); Tue, 26 Oct 2021 12:06:11 -0400 Received: from dvalin.narfation.org ([213.160.73.56]:55086 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235747AbhJZQGK (ORCPT ); Tue, 26 Oct 2021 12:06:10 -0400 X-Greylist: delayed 521 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 Oct 2021 12:06:10 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1635263700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EFYjre+MfQX7mQPCg8PKk+XsrQb8WSPn2SjfK23Z5u4=; b=DcDNDAZyus1lmDMF387JGZzpTXHzlH/0EgyYYzfby6qUpHyfT8BtvK03wpUUvQcVfOajeH XAgiNA6eW44dWIJii/1zj18wICANlHYj0dJqclHKBWI26QZCroHuaBE7grX/g0eJFjJfKr w7kki5ZJzO7qpMADcnXJas5/sEcGsqg= From: Sven Eckelmann To: ath11k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Karthikeyan Kathirvel , Sven Eckelmann Subject: [PATCH] ath11k: clear the keys properly when DISABLE_KEY Date: Tue, 26 Oct 2021 17:54:46 +0200 Message-Id: <20211026155446.457935-1-sven@narfation.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Karthikeyan Kathirvel 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: Drop chunks which are for NSS and other parts QCA didn't upstream] Signed-off-by: Sven Eckelmann --- 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 1cc55602787b..cdee7545e876 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 5ae2ef4680d6..d97be60689be 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.30.2