Skip to content

Commit fa51add

Browse files
Karthikeyan Kathirvelgregkh
authored andcommitted
ath11k: clear the keys properly via DISABLE_KEY
[ Upstream commit 436a4e8 ] 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: d5c6515 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Reported-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Karthikeyan Kathirvel <kathirve@codeaurora.org> [sven@narfation.org: split into separate patches, clean up commit message] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211115100441.33771-1-sven@narfation.org Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent df94b37 commit fa51add

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

‎drivers/net/wireless/ath/ath11k/mac.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,9 +2395,7 @@ static int ath11k_install_key(struct ath11k_vif *arvif,
23952395
return 0;
23962396

23972397
if (cmd == DISABLE_KEY) {
2398-
/* TODO: Check if FW expects value other than NONE for del */
2399-
/* arg.key_cipher = WMI_CIPHER_NONE; */
2400-
arg.key_len = 0;
2398+
arg.key_cipher = WMI_CIPHER_NONE;
24012399
arg.key_data = NULL;
24022400
goto install;
24032401
}

‎drivers/net/wireless/ath/ath11k/wmi.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,8 @@ int ath11k_wmi_vdev_install_key(struct ath11k *ar,
16651665
tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd));
16661666
tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) |
16671667
FIELD_PREP(WMI_TLV_LEN, key_len_aligned);
1668-
memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned);
1668+
if (arg->key_data)
1669+
memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned);
16691670

16701671
ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_INSTALL_KEY_CMDID);
16711672
if (ret) {

0 commit comments

Comments
 (0)