Skip to content

Commit 2793068

Browse files
committed
wifi: ath11k: avoid bit operation on key flags
JIRA: https://issues.redhat.com/browse/RHEL-114889 commit 9c78e74 Author: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Date: Fri Oct 3 14:51:58 2025 +0530 wifi: ath11k: avoid bit operation on key flags Bitwise operations with WMI_KEY_PAIRWISE (defined as 0) are ineffective and misleading. This results in pairwise key validations added in commit 97acb02 ("wifi: ath11k: fix group data packet drops during rekey") to always evaluate false and clear key commands for pairwise keys are not honored. Since firmware supports overwriting the new key without explicitly clearing the previous one, there is no visible impact currently. However, to restore consistency with the previous behavior and improve clarity, replace bitwise operations with direct assignments and comparisons for key flags. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1 Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41 Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-wireless/aLlaetkalDvWcB7b@stanley.mountain Fixes: 97acb02 ("wifi: ath11k: fix group data packet drops during rekey") Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20251003092158.1080637-1-rameshkumar.sundaram@oss.qualcomm.com [update copyright per current guidance] Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent 3384158 commit 2793068

File tree

1 file changed

+5
-5
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BSD-3-Clause-Clear
22
/*
33
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4-
* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
4+
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
55
*/
66

77
#include <net/mac80211.h>
@@ -4417,9 +4417,9 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
44174417
}
44184418

44194419
if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
4420-
flags |= WMI_KEY_PAIRWISE;
4420+
flags = WMI_KEY_PAIRWISE;
44214421
else
4422-
flags |= WMI_KEY_GROUP;
4422+
flags = WMI_KEY_GROUP;
44234423

44244424
ath11k_dbg(ar->ab, ATH11K_DBG_MAC,
44254425
"%s for peer %pM on vdev %d flags 0x%X, type = %d, num_sta %d\n",
@@ -4456,7 +4456,7 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
44564456

44574457
is_ap_with_no_sta = (vif->type == NL80211_IFTYPE_AP &&
44584458
!arvif->num_stations);
4459-
if ((flags & WMI_KEY_PAIRWISE) || cmd == SET_KEY || is_ap_with_no_sta) {
4459+
if (flags == WMI_KEY_PAIRWISE || cmd == SET_KEY || is_ap_with_no_sta) {
44604460
ret = ath11k_install_key(arvif, key, cmd, peer_addr, flags);
44614461
if (ret) {
44624462
ath11k_warn(ab, "ath11k_install_key failed (%d)\n", ret);
@@ -4470,7 +4470,7 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
44704470
goto exit;
44714471
}
44724472

4473-
if ((flags & WMI_KEY_GROUP) && cmd == SET_KEY && is_ap_with_no_sta)
4473+
if (flags == WMI_KEY_GROUP && cmd == SET_KEY && is_ap_with_no_sta)
44744474
arvif->reinstall_group_keys = true;
44754475
}
44764476

0 commit comments

Comments
 (0)