| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/01 20:02 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"MAC80211",
"CFG80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_new_key",
"nl80211_del_key",
"nl80211_get_key",
"nl80211_set_station",
"nl80211_new_station",
"nl80211_associate",
"ieee80211_key_link",
"ieee80211_gtk_rekey_add",
"ieee80211_put_cip_cap",
"cfg80211_cigtk_supported",
"cfg80211_valid_key_idx",
"cfg80211_validate_key_settings"
],
"Reasoning": "The patch introduces support for the Control Integrity Protocol (CIP) in cfg80211 and mac80211, including a new key type `NL80211_KEYTYPE_CIGTK` and new netlink attributes. It modifies key handling logic across the wireless stack and updates `mac80211_hwsim` to advertise CIP support, making it testable in virtualized environments. The changes are functional and reachable via standard nl80211 netlink commands.",
"WorthFuzzing": true
} |
| 1/1 | 2026/08/01 20:02 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit f9b4d9d352c7022539c302dd0518e22603759d20\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sat Aug 1 20:02:25 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c\nindex ecde91159b546..d4e9423fc5e4d 100644\n--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c\n+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c\n@@ -1125,13 +1125,15 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,\n }\n \n static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t\t int link_id, u8 key_index,\n+\t\t\t\t enum nl80211_key_type type,\n \t\t\t\t const u8 *mac_addr,\n \t\t\t\t struct key_params *params)\n {\n \tstruct ath6kl *ar = ath6kl_priv(wdev-\u003enetdev);\n \tstruct ath6kl_vif *vif = netdev_priv(wdev-\u003enetdev);\n \tstruct ath6kl_key *key = NULL;\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \tint seq_len;\n \tu8 key_usage;\n \tu8 key_type;\n@@ -1250,7 +1252,8 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wde\n }\n \n static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t\t int link_id, u8 key_index,\n+\t\t\t\t enum nl80211_key_type type,\n \t\t\t\t const u8 *mac_addr)\n {\n \tstruct ath6kl *ar = ath6kl_priv(wdev-\u003enetdev);\n@@ -1280,7 +1283,8 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wde\n }\n \n static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t\t int link_id, u8 key_index,\n+\t\t\t\t enum nl80211_key_type type,\n \t\t\t\t const u8 *mac_addr, void *cookie,\n \t\t\t\t void (*callback) (void *cookie,\n \t\t\t\t\t\t struct key_params *))\ndiff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c\nindex 5f2bd9a31faf6..c097831b7faf3 100644\n--- a/drivers/net/wireless/ath/wil6210/cfg80211.c\n+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c\n@@ -1621,11 +1621,13 @@ static void wil_del_rx_key(u8 key_index, enum wmi_key_usage key_usage,\n \n static int wil_cfg80211_add_key(struct wiphy *wiphy,\n \t\t\t\tstruct wireless_dev *wdev, int link_id,\n-\t\t\t\tu8 key_index, bool pairwise,\n+\t\t\t\tu8 key_index,\n+\t\t\t\tenum nl80211_key_type type,\n \t\t\t\tconst u8 *mac_addr,\n \t\t\t\tstruct key_params *params)\n {\n \tint rc;\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \tstruct wil6210_priv *wil = wiphy_to_wil(wiphy);\n \tstruct wil6210_vif *vif = wdev_to_vif(wil, wdev);\n \tenum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise);\n@@ -1696,12 +1698,14 @@ static int wil_cfg80211_add_key(struct wiphy *wiphy,\n \n static int wil_cfg80211_del_key(struct wiphy *wiphy,\n \t\t\t\tstruct wireless_dev *wdev, int link_id,\n-\t\t\t\tu8 key_index, bool pairwise,\n+\t\t\t\tu8 key_index,\n+\t\t\t\tenum nl80211_key_type type,\n \t\t\t\tconst u8 *mac_addr)\n {\n \tstruct wil6210_priv *wil = wiphy_to_wil(wiphy);\n \tstruct wil6210_vif *vif = wdev_to_vif(wil, wdev);\n-\tenum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise);\n+\tenum wmi_key_usage key_usage =\n+\t\twil_detect_key_usage(wdev, type == NL80211_KEYTYPE_PAIRWISE);\n \tstruct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif-\u003emid,\n \t\t\t\t\t\t\t key_usage,\n \t\t\t\t\t\t\t mac_addr);\n@@ -2072,7 +2076,8 @@ void wil_cfg80211_ap_recovery(struct wil6210_priv *wil)\n \t\tkey_params.seq_len = IEEE80211_GCMP_PN_LEN;\n \t\trc = wil_cfg80211_add_key(wiphy, vif_to_wdev(vif), -1,\n \t\t\t\t\t vif-\u003egtk_index,\n-\t\t\t\t\t false, NULL, \u0026key_params);\n+\t\t\t\t\t NL80211_KEYTYPE_PAIRWISE,\n+\t\t\t\t\t NULL, \u0026key_params);\n \t\tif (rc)\n \t\t\twil_err(wil, \"vif %d recovery add key failed (%d)\\n\",\n \t\t\t\ti, rc);\ndiff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c\nindex 6b2c34e3a796c..785fd57d7c6cc 100644\n--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c\n+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c\n@@ -2770,7 +2770,8 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev,\n \n static s32\n brcmf_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t int link_id, u8 key_idx, bool pairwise,\n+\t\t int link_id, u8 key_idx,\n+\t\t enum nl80211_key_type type,\n \t\t const u8 *mac_addr)\n {\n \tstruct brcmf_if *ifp = netdev_priv(wdev-\u003enetdev);\n@@ -2808,7 +2809,8 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \n static s32\n brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t int link_id, u8 key_idx, bool pairwise,\n+\t\t int link_id, u8 key_idx,\n+\t\t enum nl80211_key_type type,\n \t\t const u8 *mac_addr, struct key_params *params)\n {\n \tstruct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);\n@@ -2834,7 +2836,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \n \tif (params-\u003ekey_len == 0)\n \t\treturn brcmf_cfg80211_del_key(wiphy, wdev, -1, key_idx,\n-\t\t\t\t\t pairwise, mac_addr);\n+\t\t\t\t\t type, mac_addr);\n \n \tif (params-\u003ekey_len \u003e sizeof(key-\u003edata)) {\n \t\tbphy_err(drvr, \"Too long key length (%u)\\n\", params-\u003ekey_len);\n@@ -2930,7 +2932,8 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \n static s32\n brcmf_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t int link_id, u8 key_idx, bool pairwise,\n+\t\t int link_id, u8 key_idx,\n+\t\t enum nl80211_key_type type,\n \t\t const u8 *mac_addr, void *cookie,\n \t\t void (*callback)(void *cookie,\n \t\t\t\t\tstruct key_params *params))\ndiff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c\nindex 55f9b809e764d..6d8ede336d59b 100644\n--- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c\n+++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c\n@@ -1138,7 +1138,8 @@ iwl_mld_add_mcast_rekey(struct ieee80211_vif *vif,\n \t\treturn;\n \n \tkey_config = ieee80211_gtk_rekey_add(vif, key_data-\u003eid, key_data-\u003ekey,\n-\t\t\t\t\t sizeof(key_data-\u003ekey), link_id);\n+\t\t\t\t\t sizeof(key_data-\u003ekey), link_id,\n+\t\t\t\t\t false);\n \tif (IS_ERR(key_config))\n \t\treturn;\n \n@@ -1220,7 +1221,8 @@ static void iwl_mld_mlo_rekey(struct iwl_mld *mld,\n \t\t\t\t mlo_key-\u003eidx, link_id);\n \n \t\tkey = ieee80211_gtk_rekey_add(vif, mlo_key-\u003eidx, mlo_key-\u003ekey,\n-\t\t\t\t\t sizeof(mlo_key-\u003ekey), link_id);\n+\t\t\t\t\t sizeof(mlo_key-\u003ekey), link_id,\n+\t\t\t\t\t false);\n \n \t\tif (IS_ERR(key))\n \t\t\tcontinue;\ndiff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c\nindex 6b11fa32ea5c6..bd52f2ebd3ba1 100644\n--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c\n+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c\n@@ -1887,7 +1887,8 @@ static bool iwl_mvm_gtk_rekey(struct iwl_wowlan_status_data *status,\n \n \t\tkey = ieee80211_gtk_rekey_add(vif, status-\u003egtk[i].id,\n \t\t\t\t\t status-\u003egtk[i].key,\n-\t\t\t\t\t sizeof(status-\u003egtk[i].key), -1);\n+\t\t\t\t\t sizeof(status-\u003egtk[i].key), -1,\n+\t\t\t\t\t false);\n \t\tif (IS_ERR(key)) {\n \t\t\t/* FW may send also the old keys */\n \t\t\tif (PTR_ERR(key) == -EALREADY)\n@@ -1922,7 +1923,8 @@ iwl_mvm_d3_igtk_bigtk_rekey_add(struct iwl_wowlan_status_data *status,\n \t\treturn true;\n \n \tkey_config = ieee80211_gtk_rekey_add(vif, keyidx, key_data-\u003ekey,\n-\t\t\t\t\t sizeof(key_data-\u003ekey), -1);\n+\t\t\t\t\t sizeof(key_data-\u003ekey), -1,\n+\t\t\t\t\t false);\n \tif (IS_ERR(key_config)) {\n \t\t/* FW may send also the old keys */\n \t\treturn PTR_ERR(key_config) == -EALREADY;\ndiff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c\nindex 72c92f72469de..e015cfa1950c1 100644\n--- a/drivers/net/wireless/marvell/libertas/cfg.c\n+++ b/drivers/net/wireless/marvell/libertas/cfg.c\n@@ -1508,7 +1508,8 @@ static int lbs_cfg_set_default_key(struct wiphy *wiphy,\n \n \n static int lbs_cfg_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 idx, bool pairwise,\n+\t\t\t int link_id, u8 idx,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr, struct key_params *params)\n {\n \tstruct lbs_private *priv = wiphy_priv(wiphy);\n@@ -1569,7 +1570,8 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \n \n static int lbs_cfg_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr)\n {\n \ndiff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c\nindex 8ec2d22a8c33a..060c351cecc06 100644\n--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c\n+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c\n@@ -142,12 +142,14 @@ static void *mwifiex_cfg80211_get_adapter(struct wiphy *wiphy)\n */\n static int\n mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\tenum nl80211_key_type type,\n \t\t\t const u8 *mac_addr)\n {\n \tstruct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev-\u003enetdev);\n \tstatic const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};\n-\tconst u8 *peer_mac = pairwise ? mac_addr : bc_mac;\n+\tconst u8 *peer_mac =\n+\t\t(type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;\n \n \tif (mwifiex_set_encode(priv, NULL, NULL, 0, key_index, peer_mac, 1)) {\n \t\tmwifiex_dbg(priv-\u003eadapter, ERROR, \"deleting the crypto keys\\n\");\n@@ -482,13 +484,15 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,\n */\n static int\n mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr, struct key_params *params)\n {\n \tstruct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev-\u003enetdev);\n \tstruct mwifiex_wep_key *wep_key;\n \tstatic const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};\n-\tconst u8 *peer_mac = pairwise ? mac_addr : bc_mac;\n+\tconst u8 *peer_mac =\n+\t\t(type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;\n \n \tif (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP \u0026\u0026\n \t (params-\u003ecipher == WLAN_CIPHER_SUITE_WEP40 ||\ndiff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c\nindex 6654fce4ded84..7850e0a483907 100644\n--- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c\n+++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c\n@@ -535,10 +535,13 @@ static int wilc_wfi_cfg_copy_wpa_info(struct wilc_wfi_key *key_info,\n }\n \n static int add_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n-\t\t u8 key_index, bool pairwise, const u8 *mac_addr,\n+\t\t u8 key_index,\n+\t\t enum nl80211_key_type type,\n+\t\t const u8 *mac_addr,\n \t\t struct key_params *params)\n \n {\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \tint ret = 0, keylen = params-\u003ekey_len;\n \tconst u8 *rx_mic = NULL;\n \tconst u8 *tx_mic = NULL;\n@@ -641,9 +644,10 @@ static int add_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n \n static int del_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n \t\t u8 key_index,\n-\t\t bool pairwise,\n+\t\t enum nl80211_key_type type,\n \t\t const u8 *mac_addr)\n {\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \tstruct wilc_vif *vif = netdev_priv(wdev-\u003enetdev);\n \tstruct wilc_priv *priv = \u0026vif-\u003epriv;\n \n@@ -681,10 +685,11 @@ static int del_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n }\n \n static int get_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n-\t\t u8 key_index, bool pairwise, const u8 *mac_addr,\n-\t\t void *cookie,\n+\t\t u8 key_index, enum nl80211_key_type type,\n+\t\t const u8 *mac_addr, void *cookie,\n \t\t void (*callback)(void *cookie, struct key_params *))\n {\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \tstruct wilc_vif *vif = netdev_priv(wdev-\u003enetdev);\n \tstruct wilc_priv *priv = \u0026vif-\u003epriv;\n \tstruct key_params key_params;\ndiff --git a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c\nindex 4f9e20f728114..08b6db147452c 100644\n--- a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c\n+++ b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c\n@@ -99,12 +99,14 @@ static void *nxpwifi_cfg80211_get_adapter(struct wiphy *wiphy)\n /* cfg80211 operation handler to delete a network key. */\n static int\n nxpwifi_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr)\n {\n \tstruct nxpwifi_private *priv = nxpwifi_netdev_get_priv(wdev-\u003enetdev);\n \tstatic const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};\n-\tconst u8 *peer_mac = pairwise ? mac_addr : bc_mac;\n+\tconst u8 *peer_mac =\n+\t\t(type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;\n \tint ret;\n \n \tret = nxpwifi_set_encode(priv, NULL, NULL, 0, key_index, peer_mac, 1);\n@@ -428,7 +430,8 @@ nxpwifi_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,\n /* cfg80211 handler for adding an 802.11 encryption key. */\n static int\n nxpwifi_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr, struct key_params *params)\n {\n \tstruct nxpwifi_private *priv = nxpwifi_netdev_get_priv(wdev-\u003enetdev);\n@@ -438,7 +441,7 @@ nxpwifi_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \tint ret;\n \n \teth_broadcast_addr(bc_mac);\n-\tpeer_mac = pairwise ? mac_addr : bc_mac;\n+\tpeer_mac = (type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;\n \n \tif (GET_BSS_ROLE(priv) == NXPWIFI_BSS_ROLE_UAP \u0026\u0026\n \t (params-\u003ecipher == WLAN_CIPHER_SUITE_WEP40 ||\ndiff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c\nindex 9e44c85d2051c..38625342169ff 100644\n--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c\n+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c\n@@ -533,10 +533,12 @@ qtnf_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev,\n }\n \n static int qtnf_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\tint link_id, u8 key_index, bool pairwise,\n+\t\t\tint link_id, u8 key_index,\n+\t\t\tenum nl80211_key_type type,\n \t\t\tconst u8 *mac_addr, struct key_params *params)\n {\n \tstruct qtnf_vif *vif = qtnf_netdev_get_priv(wdev-\u003enetdev);\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \tint ret;\n \n \tret = qtnf_cmd_send_add_key(vif, key_index, pairwise, mac_addr, params);\n@@ -549,10 +551,12 @@ static int qtnf_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n }\n \n static int qtnf_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\tint link_id, u8 key_index, bool pairwise,\n+\t\t\tint link_id, u8 key_index,\n+\t\t\tenum nl80211_key_type type,\n \t\t\tconst u8 *mac_addr)\n {\n \tstruct qtnf_vif *vif = qtnf_netdev_get_priv(wdev-\u003enetdev);\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \tint ret;\n \n \tret = qtnf_cmd_send_del_key(vif, key_index, pairwise, mac_addr);\ndiff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c\nindex 8dadd8df4fc65..c8e002238ecb2 100644\n--- a/drivers/net/wireless/realtek/rtw89/wow.c\n+++ b/drivers/net/wireless/realtek/rtw89/wow.c\n@@ -669,10 +669,12 @@ static struct ieee80211_key_conf *rtw89_wow_gtk_rekey(struct rtw89_dev *rtwdev,\n \tif (ieee80211_vif_is_mld(wow_vif))\n \t\tkey = ieee80211_gtk_rekey_add(wow_vif, keyidx, gtk,\n \t\t\t\t\t cipher_info-\u003elen,\n-\t\t\t\t\t rtwvif_link-\u003elink_id);\n+\t\t\t\t\t rtwvif_link-\u003elink_id,\n+\t\t\t\t\t false);\n \telse\n \t\tkey = ieee80211_gtk_rekey_add(wow_vif, keyidx, gtk,\n-\t\t\t\t\t cipher_info-\u003elen, -1);\n+\t\t\t\t\t cipher_info-\u003elen, -1,\n+\t\t\t\t\t false);\n \n \tkfree(rekey_conf);\n \tif (IS_ERR(key)) {\ndiff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c\nindex 02b6d81cccd11..1cc322aa898dd 100644\n--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c\n+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c\n@@ -5668,6 +5668,9 @@ static const struct wiphy_iftype_ext_capab mac80211_hwsim_iftypes_ext_capa[] = {\n \t\t.eml_capabilities = IEEE80211_EML_CAP_EMLSR_SUPP |\n \t\t\t\t IEEE80211_EML_CAP_EMLMR_SUPPORT,\n \t\t.mld_capa_and_ops = MAC80211_HWSIM_MLD_CAPA_OPS,\n+\t\t/* CIP works as hwsim does not have control frames */\n+\t\t.cip_supported = true,\n+\t\t.cip_capabilities = 0,\n \t},\n };\n \ndiff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h\nindex 26e6740388654..16d78fd61c223 100644\n--- a/include/linux/ieee80211.h\n+++ b/include/linux/ieee80211.h\n@@ -1828,6 +1828,7 @@ enum ieee80211_eid_ext {\n \tWLAN_EID_EXT_BANDWIDTH_INDICATION = 135,\n \tWLAN_EID_EXT_KNOWN_STA_IDENTIFCATION = 136,\n \tWLAN_EID_EXT_NON_AP_STA_REG_CON = 137,\n+\tWLAN_EID_EXT_CIP_CAPA = 150,\n \tWLAN_EID_EXT_UHR_OPER = 151,\n \tWLAN_EID_EXT_UHR_CAPA = 152,\n \tWLAN_EID_EXT_MACP = 153,\n@@ -2900,4 +2901,16 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,\n \t\t __ieee80211_check_tim(tim, tim_len, aid);\n }\n \n+/* The MIC padding subfield in the CIP capabilities */\n+#define WLAN_CIP_CAPA_MIC_PADDING\t0x0F\n+\n+/**\n+ * struct ieee80211_cip_cap - CIP Capabilities element\n+ *\n+ * @v: The value of the Control Integrity Protocol Capability element\n+ */\n+struct ieee80211_cip_cap {\n+\tu8 v;\n+} __packed;\n+\n #endif /* LINUX_IEEE80211_H */\ndiff --git a/include/net/cfg80211.h b/include/net/cfg80211.h\nindex dcbb0e55c32ec..b5d98ba07239b 100644\n--- a/include/net/cfg80211.h\n+++ b/include/net/cfg80211.h\n@@ -1821,6 +1821,8 @@ struct sta_txpwr {\n * @s1g_capa: S1G capabilities of station\n * @uhr_capa: UHR capabilities of the station\n * @uhr_capa_len: the length of the UHR capabilities\n+ * @cip_cap_set: If CIP capabilities are present, required for CIP stations\n+ * @cip_cap: CIP capabilities of station\n */\n struct link_station_parameters {\n \tconst u8 *mld_mac;\n@@ -1842,6 +1844,8 @@ struct link_station_parameters {\n \tconst struct ieee80211_s1g_cap *s1g_capa;\n \tconst struct ieee80211_uhr_cap *uhr_capa;\n \tu8 uhr_capa_len;\n+\tbool cip_cap_set;\n+\tu8 cip_cap;\n };\n \n /**\n@@ -3402,6 +3406,7 @@ struct cfg80211_ml_reconf_req {\n *\tflag is not set.\n * @ASSOC_REQ_SPP_AMSDU: SPP A-MSDUs will be used on this connection (if any)\n * @ASSOC_REQ_DISABLE_UHR: Disable UHR\n+ * @ASSOC_REQ_CIP: Enable Control Integrity Protocol\n */\n enum cfg80211_assoc_req_flags {\n \tASSOC_REQ_DISABLE_HT\t\t\t= BIT(0),\n@@ -3413,6 +3418,7 @@ enum cfg80211_assoc_req_flags {\n \tCONNECT_REQ_MLO_SUPPORT\t\t\t= BIT(6),\n \tASSOC_REQ_SPP_AMSDU\t\t\t= BIT(7),\n \tASSOC_REQ_DISABLE_UHR\t\t\t= BIT(8),\n+\tASSOC_REQ_CIP\t\t\t\t= BIT(9),\n };\n \n /**\n@@ -5300,14 +5306,17 @@ struct cfg80211_ops {\n \t\t\t\t unsigned int link_id);\n \n \tint\t(*add_key)(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr, struct key_params *params);\n \tint\t(*get_key)(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr, void *cookie,\n \t\t\t void (*callback)(void *cookie, struct key_params*));\n \tint\t(*del_key)(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_index, bool pairwise,\n+\t\t\t int link_id, u8 key_index,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr);\n \tint\t(*set_default_key)(struct wiphy *wiphy,\n \t\t\t\t struct net_device *netdev, int link_id,\n@@ -6041,6 +6050,8 @@ struct wiphy_vendor_command {\n * @eml_capabilities: EML capabilities (for MLO)\n * @mld_capa_and_ops: MLD capabilities and operations (for MLO)\n * @ext_mld_capa_and_ops: Extended MLD capabilities and operations (for MLO)\n+ * @cip_supported: CIP is supported and the capabilities are valid\n+ * @cip_capabilities: CIP Capabilities element containing the MIC padding delay\n */\n struct wiphy_iftype_ext_capab {\n \tenum nl80211_iftype iftype;\n@@ -6050,6 +6061,8 @@ struct wiphy_iftype_ext_capab {\n \tu16 eml_capabilities;\n \tu16 mld_capa_and_ops;\n \tu16 ext_mld_capa_and_ops;\n+\tbool cip_supported;\n+\tu8 cip_capabilities;\n };\n \n /**\ndiff --git a/include/net/mac80211.h b/include/net/mac80211.h\nindex 9d1fac6e80829..aae140fdc2bb1 100644\n--- a/include/net/mac80211.h\n+++ b/include/net/mac80211.h\n@@ -2396,6 +2396,8 @@ static inline bool lockdep_vif_wiphy_mutex_held(struct ieee80211_vif *vif)\n *\tnumber generation only\n * @IEEE80211_KEY_FLAG_SPP_AMSDU: SPP A-MSDUs can be used with this key\n *\t(set by mac80211 from the sta-\u003espp_amsdu flag)\n+ * @IEEE80211_KEY_FLAG_CIP: This key is used for the Control Integrity\n+ *\tProtocol, and is either a pairwise key or a CIGTK.\n */\n enum ieee80211_key_flags {\n \tIEEE80211_KEY_FLAG_GENERATE_IV_MGMT\t= BIT(0),\n@@ -2410,6 +2412,7 @@ enum ieee80211_key_flags {\n \tIEEE80211_KEY_FLAG_NO_AUTO_TX\t\t= BIT(9),\n \tIEEE80211_KEY_FLAG_GENERATE_MMIE\t= BIT(10),\n \tIEEE80211_KEY_FLAG_SPP_AMSDU\t\t= BIT(11),\n+\tIEEE80211_KEY_FLAG_CIP\t\t\t= BIT(12),\n };\n \n /**\n@@ -2630,6 +2633,8 @@ struct ieee80211_sta_aggregates {\n * @eht_cap: EHT capabilities of this STA\n * @uhr_cap: UHR capabilities of this STA\n * @s1g_cap: S1G capabilities of this STA\n+ * @cip_mic_padding: the MIC padding required by the STA as defined in its\n+ *\tCIP Capabilities element\n * @agg: per-link data for multi-link aggregation\n * @bandwidth: current bandwidth the station can receive with.\n *\tThis is the minimum between the peer's capabilities and our own\n@@ -2658,6 +2663,7 @@ struct ieee80211_link_sta {\n \tstruct ieee80211_sta_eht_cap eht_cap;\n \tstruct ieee80211_sta_uhr_cap uhr_cap;\n \tstruct ieee80211_sta_s1g_cap s1g_cap;\n+\tu8 cip_mic_padding;\n \n \tstruct ieee80211_sta_aggregates agg;\n \n@@ -2721,6 +2727,7 @@ struct ieee80211_link_sta {\n * @valid_links: bitmap of valid links, or 0 for non-MLO\n * @spp_amsdu: indicates whether the STA uses SPP A-MSDU or not.\n * @epp_peer: indicates that the peer is an EPP peer.\n+ * @cip: indicates whether the STA uses control frame protection or not.\n * @nmi: For NDI stations, pointer to the NMI station of the peer.\n * @nan_sched: NAN peer schedule for this station. Valid only for NMI stations.\n * @ext_mld_capa_ops: the MLD's extended MLD capabilities and operations\n@@ -2742,6 +2749,8 @@ struct ieee80211_sta {\n \tu8 max_amsdu_subframes;\n \tu16 eml_cap;\n \n+\tbool cip;\n+\n \tstruct ieee80211_sta_aggregates *cur;\n \n \tbool support_p2p_ps;\n@@ -6279,6 +6288,7 @@ void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,\n * @key_len: the key data. Might be bigger than the actual key length,\n *\tbut not smaller (for the driver convinence)\n * @link_id: the link id of the key or -1 for non-MLO\n+ * @cigtk: whether this is a CIGTK\n *\n * When GTK rekeying was done while the system was suspended, (a) new\n * key(s) will be available. These will be needed by mac80211 for proper\n@@ -6305,7 +6315,7 @@ void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,\n struct ieee80211_key_conf *\n ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,\n \t\t\tu8 idx, u8 *key_data, u8 key_len,\n-\t\t\tint link_id);\n+\t\t\tint link_id, bool cigtk);\n \n /**\n * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying\ndiff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h\nindex 020387d764122..3e6e59fb8e17f 100644\n--- a/include/uapi/linux/nl80211.h\n+++ b/include/uapi/linux/nl80211.h\n@@ -3185,6 +3185,11 @@ enum nl80211_commands {\n *\tThe aggregated message always precedes the per-link messages for the\n *\tsame station within a dump sequence.\n *\n+ * @NL80211_ATTR_ASSOC_CIP: Enable Control Integrity Protocol for the\n+ *\tassociation\n+ * @NL80211_ATTR_CIP_CAPABILITIES: The Control Integrity Protocol for the\n+ *\tstation.\n+ *\n * @NUM_NL80211_ATTR: total number of nl80211_attrs available\n * @NL80211_ATTR_MAX: highest attribute number currently defined\n * @__NL80211_ATTR_AFTER_LAST: internal use\n@@ -3280,6 +3285,8 @@ enum nl80211_attrs {\n \n \tNL80211_ATTR_FREQ_FIXED,\n \n+\tNL80211_ATTR_ASSOC_CIP,\n+\tNL80211_ATTR_CIP_CAPABILITIES,\n \n \tNL80211_ATTR_WIPHY_RETRY_SHORT,\n \tNL80211_ATTR_WIPHY_RETRY_LONG,\n@@ -3934,6 +3941,7 @@ enum nl80211_iftype {\n *\tthat support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a\n *\tpreviously added station into associated state\n * @NL80211_STA_FLAG_SPP_AMSDU: station supports SPP A-MSDUs\n+ * @NL80211_STA_FLAG_CIP: station has Control Integrity Protocol (CIP) enabled\n * @NL80211_STA_FLAG_MAX: highest station flag number currently defined\n * @__NL80211_STA_FLAG_AFTER_LAST: internal use\n */\n@@ -3947,6 +3955,7 @@ enum nl80211_sta_flags {\n \tNL80211_STA_FLAG_TDLS_PEER,\n \tNL80211_STA_FLAG_ASSOCIATED,\n \tNL80211_STA_FLAG_SPP_AMSDU,\n+\tNL80211_STA_FLAG_CIP,\n \n \t/* keep last */\n \t__NL80211_STA_FLAG_AFTER_LAST,\n@@ -5778,12 +5787,16 @@ enum nl80211_auth_type {\n * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key\n * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key\n * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)\n+ * @NL80211_KEYTYPE_CIGTK: Control Integrity Group Temporal Key\n+ *\tThe cipher is GMAC-256 but passed as GCMP-256,\n+ *\tsame as the pairwise key when used for CIP.\n * @NUM_NL80211_KEYTYPES: number of defined key types\n */\n enum nl80211_key_type {\n \tNL80211_KEYTYPE_GROUP,\n \tNL80211_KEYTYPE_PAIRWISE,\n \tNL80211_KEYTYPE_PEERKEY,\n+\tNL80211_KEYTYPE_CIGTK,\n \n \tNUM_NL80211_KEYTYPES\n };\ndiff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c\nindex 0a9247be26afa..3bf81629cde34 100644\n--- a/net/mac80211/cfg.c\n+++ b/net/mac80211/cfg.c\n@@ -611,12 +611,15 @@ static int ieee80211_set_tx(struct ieee80211_sub_if_data *sdata,\n }\n \n static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_idx, bool pairwise,\n+\t\t\t int link_id, u8 key_idx,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr, struct key_params *params)\n {\n \tstruct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);\n \tstruct ieee80211_link_data *link =\n \t\tieee80211_link_or_deflink(sdata, link_id, false);\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n+\tbool cigtk = type == NL80211_KEYTYPE_CIGTK;\n \tstruct ieee80211_local *local = sdata-\u003elocal;\n \tstruct sta_info *sta = NULL;\n \tstruct ieee80211_key *key;\n@@ -660,6 +663,9 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \t\tkey-\u003econf.link_id = -1;\n \t} else {\n \t\tkey-\u003econf.link_id = link-\u003elink_id;\n+\n+\t\tif (cigtk)\n+\t\t\tkey-\u003econf.flags |= IEEE80211_KEY_FLAG_CIP;\n \t}\n \n \tif (params-\u003emode == NL80211_KEY_NO_TX)\n@@ -737,10 +743,13 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \n static struct ieee80211_key *\n ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,\n-\t\t u8 key_idx, bool pairwise, const u8 *mac_addr)\n+\t\t u8 key_idx, enum nl80211_key_type type,\n+\t\t const u8 *mac_addr)\n {\n \tstruct ieee80211_local *local __maybe_unused = sdata-\u003elocal;\n \tstruct ieee80211_link_data *link = \u0026sdata-\u003edeflink;\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n+\tbool cigtk = type == NL80211_KEYTYPE_CIGTK;\n \tstruct ieee80211_key *key;\n \n \tif (link_id \u003e= 0) {\n@@ -770,7 +779,11 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,\n \t\t\treturn wiphy_dereference(local-\u003ehw.wiphy,\n \t\t\t\t\t\t sta-\u003eptk[key_idx]);\n \n-\t\tif (!pairwise \u0026\u0026\n+\t\tif (cigtk \u0026\u0026 key_idx \u003c NUM_CTRL_KEYS)\n+\t\t\treturn wiphy_dereference(local-\u003ehw.wiphy,\n+\t\t\t\t\t\t link_sta-\u003ecigtk[key_idx]);\n+\n+\t\tif (!pairwise \u0026\u0026 !cigtk \u0026\u0026\n \t\t key_idx \u003c NUM_DEFAULT_KEYS +\n \t\t\t NUM_DEFAULT_MGMT_KEYS +\n \t\t\t NUM_DEFAULT_BEACON_KEYS)\n@@ -783,6 +796,9 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,\n \tif (pairwise \u0026\u0026 key_idx \u003c NUM_DEFAULT_KEYS)\n \t\treturn wiphy_dereference(local-\u003ehw.wiphy, sdata-\u003ekeys[key_idx]);\n \n+\tif (cigtk)\n+\t\treturn wiphy_dereference(local-\u003ehw.wiphy, link-\u003ecigtk[key_idx]);\n+\n \tkey = wiphy_dereference(local-\u003ehw.wiphy, link-\u003egtk[key_idx]);\n \tif (key)\n \t\treturn key;\n@@ -795,8 +811,8 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,\n }\n \n static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_idx, bool pairwise,\n-\t\t\t const u8 *mac_addr)\n+\t\t\t int link_id, u8 key_idx,\n+\t\t\t enum nl80211_key_type type, const u8 *mac_addr)\n {\n \tstruct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);\n \tstruct ieee80211_local *local = sdata-\u003elocal;\n@@ -804,7 +820,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \n \tlockdep_assert_wiphy(local-\u003ehw.wiphy);\n \n-\tkey = ieee80211_lookup_key(sdata, link_id, key_idx, pairwise, mac_addr);\n+\tkey = ieee80211_lookup_key(sdata, link_id, key_idx, type, mac_addr);\n \tif (!key)\n \t\treturn -ENOENT;\n \n@@ -814,7 +830,8 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n }\n \n static int ieee80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n-\t\t\t int link_id, u8 key_idx, bool pairwise,\n+\t\t\t int link_id, u8 key_idx,\n+\t\t\t enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr, void *cookie,\n \t\t\t void (*callback)(void *cookie,\n \t\t\t\t\t struct key_params *params))\n@@ -833,7 +850,7 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,\n \n \trcu_read_lock();\n \n-\tkey = ieee80211_lookup_key(sdata, link_id, key_idx, pairwise, mac_addr);\n+\tkey = ieee80211_lookup_key(sdata, link_id, key_idx, type, mac_addr);\n \tif (!key)\n \t\tgoto out;\n \n@@ -2289,6 +2306,8 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,\n \tcase STA_LINK_MODE_NEW:\n \t\tif (!params-\u003elink_mac)\n \t\t\treturn -EINVAL;\n+\t\tif (sta-\u003esta.cip \u0026\u0026 !params-\u003ecip_cap_set)\n+\t\t\treturn -EINVAL;\n \t\tbreak;\n \tcase STA_LINK_MODE_LINK_MODIFY:\n \t\tbreak;\n@@ -2411,6 +2430,9 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,\n \t\tieee80211_s1g_cap_to_sta_s1g_cap(sdata, params-\u003es1g_capa,\n \t\t\t\t\t\t link_sta);\n \n+\tif (params-\u003ecip_cap_set)\n+\t\tlink_sta-\u003epub-\u003ecip_mic_padding = params-\u003ecip_cap;\n+\n \tswitch (sdata-\u003evif.type) {\n \tcase NL80211_IFTYPE_NAN:\n \tcase NL80211_IFTYPE_NAN_DATA:\n@@ -2573,6 +2595,9 @@ static int sta_apply_parameters(struct ieee80211_local *local,\n \tif (params-\u003eeml_cap_present)\n \t\tsta-\u003esta.eml_cap = params-\u003eeml_cap;\n \n+\tif (params-\u003esta_flags_set \u0026 BIT(NL80211_STA_FLAG_CIP))\n+\t\tsta-\u003esta.cip = true;\n+\n \tret = sta_link_apply_parameters(local, sta, STA_LINK_MODE_STA_MODIFY,\n \t\t\t\t\t\u0026params-\u003elink_sta_params);\n \tif (ret)\ndiff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h\nindex a1ef88fe846dd..fc85f8bf96e3a 100644\n--- a/net/mac80211/ieee80211_i.h\n+++ b/net/mac80211/ieee80211_i.h\n@@ -477,6 +477,7 @@ struct ieee80211_mgd_assoc_data {\n \tbool comeback; /* whether the AP has requested association comeback */\n \tbool s1g;\n \tbool spp_amsdu;\n+\tbool cip;\n \n \ts8 assoc_link_id;\n \n@@ -1104,6 +1105,7 @@ struct ieee80211_link_data {\n \tstruct ieee80211_key __rcu *gtk[NUM_DEFAULT_KEYS +\n \t\t\t\t\tNUM_DEFAULT_MGMT_KEYS +\n \t\t\t\t\tNUM_DEFAULT_BEACON_KEYS];\n+\tstruct ieee80211_key __rcu *cigtk[NUM_CTRL_KEYS];\n \tstruct ieee80211_key __rcu *default_multicast_key;\n \tstruct ieee80211_key __rcu *default_mgmt_key;\n \tstruct ieee80211_key __rcu *default_beacon_key;\n@@ -1870,6 +1872,7 @@ struct ieee802_11_elems {\n \tconst struct ieee80211_ttlm_elem *ttlm[IEEE80211_TTLM_MAX_CNT];\n \tconst struct ieee80211_uhr_cap *uhr_cap;\n \tconst struct ieee80211_uhr_operation *uhr_operation;\n+\tconst struct ieee80211_cip_cap *cip_cap;\n \n \t/* not the order in the psd values is per element, not per chandef */\n \tstruct ieee80211_parsed_tpe tpe;\n@@ -2775,6 +2778,8 @@ int ieee80211_put_uhr_cap(struct sk_buff *skb,\n \t\t\t const struct ieee80211_supported_band *sband);\n void ieee80211_put_reg_conn(struct ieee80211_sub_if_data *sdata,\n \t\t\t struct sk_buff *skb);\n+int ieee80211_put_cip_cap(struct sk_buff *skb,\n+\t\t\t struct ieee80211_sub_if_data *sdata);\n \n /* channel management */\n bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,\ndiff --git a/net/mac80211/key.c b/net/mac80211/key.c\nindex f45e792abede5..4c9788ec0b74f 100644\n--- a/net/mac80211/key.c\n+++ b/net/mac80211/key.c\n@@ -205,6 +205,10 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)\n \t\t\t sta ? sta-\u003esta.addr : bcast_addr, ret);\n \n out_unsupported:\n+\t/* Control Integrity Protocol can only be done in hardware */\n+\tif (key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_CIP)\n+\t\treturn -EINVAL;\n+\n \tswitch (key-\u003econf.cipher) {\n \tcase WLAN_CIPHER_SUITE_WEP40:\n \tcase WLAN_CIPHER_SUITE_WEP104:\n@@ -440,11 +444,13 @@ void ieee80211_set_default_beacon_key(struct ieee80211_link_data *link,\n static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,\n \t\t\t\t struct ieee80211_link_data *link,\n \t\t\t\t struct sta_info *sta,\n-\t\t\t\t bool pairwise,\n+\t\t\t\t enum ieee80211_key_flags flags,\n \t\t\t\t struct ieee80211_key *old,\n \t\t\t\t struct ieee80211_key *new)\n {\n \tstruct link_sta_info *link_sta = sta ? \u0026sta-\u003edeflink : NULL;\n+\tbool pairwise = flags \u0026 IEEE80211_KEY_FLAG_PAIRWISE;\n+\tbool cip = flags \u0026 IEEE80211_KEY_FLAG_CIP;\n \tint link_id;\n \tint idx;\n \tint ret = 0;\n@@ -535,6 +541,8 @@ static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,\n \t\t\tif (new \u0026\u0026\n \t\t\t !(new-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_NO_AUTO_TX))\n \t\t\t\t_ieee80211_set_tx_key(new, true);\n+\t\t} else if (cip) {\n+\t\t\trcu_assign_pointer(link_sta-\u003ecigtk[idx], new);\n \t\t} else {\n \t\t\trcu_assign_pointer(link_sta-\u003egtk[idx], new);\n \t\t}\n@@ -569,6 +577,8 @@ static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,\n \n \t\tif (is_wep || pairwise)\n \t\t\trcu_assign_pointer(sdata-\u003ekeys[idx], new);\n+\t\telse if (cip)\n+\t\t\trcu_assign_pointer(link-\u003ecigtk[idx], new);\n \t\telse\n \t\t\trcu_assign_pointer(link-\u003egtk[idx], new);\n \n@@ -883,6 +893,10 @@ int ieee80211_key_link(struct ieee80211_key *key,\n \t\t\tret = -EOPNOTSUPP;\n \t\t\tgoto out;\n \t\t}\n+\n+\t\t/* Set CIP flag if enabled for the station */\n+\t\tif (sta-\u003esta.cip)\n+\t\t\tkey-\u003econf.flags |= IEEE80211_KEY_FLAG_CIP;\n \t} else if (sta) {\n \t\tstruct link_sta_info *link_sta = \u0026sta-\u003edeflink;\n \t\tint link_id = key-\u003econf.link_id;\n@@ -896,15 +910,25 @@ int ieee80211_key_link(struct ieee80211_key *key,\n \t\t\t}\n \t\t}\n \n-\t\told_key = wiphy_dereference(sdata-\u003elocal-\u003ehw.wiphy,\n-\t\t\t\t\t link_sta-\u003egtk[idx]);\n-\t} else {\n-\t\tif (idx \u003c NUM_DEFAULT_KEYS)\n+\t\tif (key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_CIP)\n \t\t\told_key = wiphy_dereference(sdata-\u003elocal-\u003ehw.wiphy,\n-\t\t\t\t\t\t sdata-\u003ekeys[idx]);\n-\t\tif (!old_key)\n+\t\t\t\t\t\t link_sta-\u003ecigtk[idx]);\n+\t\telse\n \t\t\told_key = wiphy_dereference(sdata-\u003elocal-\u003ehw.wiphy,\n-\t\t\t\t\t\t link-\u003egtk[idx]);\n+\t\t\t\t\t\t link_sta-\u003egtk[idx]);\n+\t} else {\n+\t\tif (key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_CIP) {\n+\t\t\told_key = wiphy_dereference(sdata-\u003elocal-\u003ehw.wiphy,\n+\t\t\t\t\t\t link-\u003ecigtk[idx]);\n+\t\t} else {\n+\t\t\tif (idx \u003c NUM_DEFAULT_KEYS)\n+\t\t\t\told_key = wiphy_dereference(sdata-\u003elocal-\u003ehw.wiphy,\n+\t\t\t\t\t\t\t sdata-\u003ekeys[idx]);\n+\n+\t\t\tif (!old_key)\n+\t\t\t\told_key = wiphy_dereference(sdata-\u003elocal-\u003ehw.wiphy,\n+\t\t\t\t\t\t\t link-\u003egtk[idx]);\n+\t\t}\n \t}\n \n \t/* Non-pairwise keys must also not switch the cipher on rekey */\n@@ -938,9 +962,17 @@ int ieee80211_key_link(struct ieee80211_key *key,\n \tif (sta \u0026\u0026 sta-\u003esta.spp_amsdu)\n \t\tkey-\u003econf.flags |= IEEE80211_KEY_FLAG_SPP_AMSDU;\n \n+\t/* A CIP related key must be GCMP-256 (really GMAC-256) */\n+\tif ((key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_CIP) \u0026\u0026\n+\t key-\u003econf.cipher != WLAN_CIPHER_SUITE_GCMP_256) {\n+\t\tret = -EINVAL;\n+\t\tgoto out;\n+\t}\n+\n \tincrement_tailroom_need_count(sdata);\n \n-\tret = ieee80211_key_replace(sdata, link, sta, pairwise, old_key, key);\n+\tret = ieee80211_key_replace(sdata, link, sta, key-\u003econf.flags,\n+\t\t\t\t old_key, key);\n \n \tif (!ret) {\n \t\tieee80211_debugfs_key_add(key);\n@@ -966,8 +998,7 @@ void ieee80211_key_free(struct ieee80211_key *key, bool delay_tailroom)\n \t */\n \tif (key-\u003esdata)\n \t\tieee80211_key_replace(key-\u003esdata, NULL, key-\u003esta,\n-\t\t\t\t key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_PAIRWISE,\n-\t\t\t\t key, NULL);\n+\t\t\t\t key-\u003econf.flags, key, NULL);\n \tieee80211_key_destroy(key, delay_tailroom);\n }\n \n@@ -1098,8 +1129,7 @@ static void ieee80211_free_keys_iface(struct ieee80211_sub_if_data *sdata,\n \n \tlist_for_each_entry_safe(key, tmp, \u0026sdata-\u003ekey_list, list) {\n \t\tieee80211_key_replace(key-\u003esdata, NULL, key-\u003esta,\n-\t\t\t\t key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_PAIRWISE,\n-\t\t\t\t key, NULL);\n+\t\t\t\t key-\u003econf.flags, key, NULL);\n \t\tlist_add_tail(\u0026key-\u003elist, keys);\n \t}\n \n@@ -1119,8 +1149,7 @@ void ieee80211_remove_link_keys(struct ieee80211_link_data *link,\n \t\tif (key-\u003econf.link_id != link-\u003elink_id)\n \t\t\tcontinue;\n \t\tieee80211_key_replace(key-\u003esdata, link, key-\u003esta,\n-\t\t\t\t key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_PAIRWISE,\n-\t\t\t\t key, NULL);\n+\t\t\t\t key-\u003econf.flags, key, NULL);\n \t\tlist_add_tail(\u0026key-\u003elist, keys);\n \t}\n }\n@@ -1196,8 +1225,17 @@ void ieee80211_free_sta_keys(struct ieee80211_local *local,\n \t\tif (!key)\n \t\t\tcontinue;\n \t\tieee80211_key_replace(key-\u003esdata, NULL, key-\u003esta,\n-\t\t\t\t key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_PAIRWISE,\n-\t\t\t\t key, NULL);\n+\t\t\t\t key-\u003econf.flags, key, NULL);\n+\t\t__ieee80211_key_destroy(key, key-\u003esdata-\u003evif.type ==\n+\t\t\t\t\tNL80211_IFTYPE_STATION);\n+\t}\n+\n+\tfor (i = 0; i \u003c ARRAY_SIZE(sta-\u003edeflink.cigtk); i++) {\n+\t\tkey = wiphy_dereference(local-\u003ehw.wiphy, sta-\u003edeflink.cigtk[i]);\n+\t\tif (!key)\n+\t\t\tcontinue;\n+\t\tieee80211_key_replace(key-\u003esdata, NULL, key-\u003esta,\n+\t\t\t\t key-\u003econf.flags, key, NULL);\n \t\t__ieee80211_key_destroy(key, key-\u003esdata-\u003evif.type ==\n \t\t\t\t\tNL80211_IFTYPE_STATION);\n \t}\n@@ -1207,8 +1245,7 @@ void ieee80211_free_sta_keys(struct ieee80211_local *local,\n \t\tif (!key)\n \t\t\tcontinue;\n \t\tieee80211_key_replace(key-\u003esdata, NULL, key-\u003esta,\n-\t\t\t\t key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_PAIRWISE,\n-\t\t\t\t key, NULL);\n+\t\t\t\t key-\u003econf.flags, key, NULL);\n \t\t__ieee80211_key_destroy(key, key-\u003esdata-\u003evif.type ==\n \t\t\t\t\tNL80211_IFTYPE_STATION);\n \t}\n@@ -1366,7 +1403,7 @@ EXPORT_SYMBOL_GPL(ieee80211_set_key_rx_seq);\n struct ieee80211_key_conf *\n ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,\n \t\t\tu8 idx, u8 *key_data, u8 key_len,\n-\t\t\tint link_id)\n+\t\t\tint link_id, bool cigtk)\n {\n \tstruct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);\n \tstruct ieee80211_local *local = sdata-\u003elocal;\n@@ -1390,10 +1427,20 @@ ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,\n \t\t NUM_DEFAULT_BEACON_KEYS))\n \t\treturn ERR_PTR(-EINVAL);\n \n-\tprev_key = wiphy_dereference(local-\u003ehw.wiphy,\n-\t\t\t\t link_data-\u003egtk[idx]);\n+\tif (WARN_ON(cigtk \u0026\u0026 idx \u003e= NUM_CTRL_KEYS))\n+\t\treturn ERR_PTR(-EINVAL);\n+\n+\tif (cigtk)\n+\t\tprev_key = wiphy_dereference(local-\u003ehw.wiphy,\n+\t\t\t\t\t link_data-\u003ecigtk[idx]);\n+\telse\n+\t\tprev_key = wiphy_dereference(local-\u003ehw.wiphy,\n+\t\t\t\t\t link_data-\u003egtk[idx]);\n \tif (!prev_key) {\n-\t\tif (idx \u003c NUM_DEFAULT_KEYS) {\n+\t\tif (cigtk) {\n+\t\t\tprev_key = wiphy_dereference(local-\u003ehw.wiphy,\n+\t\t\t\t\t\t link_data-\u003ecigtk[idx ^ 1]);\n+\t\t} else if (idx \u003c NUM_DEFAULT_KEYS) {\n \t\t\tfor (int i = 0; i \u003c NUM_DEFAULT_KEYS; i++) {\n \t\t\t\tif (i == idx)\n \t\t\t\t\tcontinue;\n@@ -1424,6 +1471,9 @@ ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,\n \tif (sdata-\u003eu.mgd.mfp != IEEE80211_MFP_DISABLED)\n \t\tkey-\u003econf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;\n \n+\tif (prev_key-\u003econf.flags \u0026 IEEE80211_KEY_FLAG_CIP)\n+\t\tkey-\u003econf.flags |= IEEE80211_KEY_FLAG_CIP;\n+\n \tkey-\u003econf.link_id = link_data-\u003elink_id;\n \n \terr = ieee80211_key_link(key, link_data, NULL);\ndiff --git a/net/mac80211/key.h b/net/mac80211/key.h\nindex 826e4e9387c55..c85992493afd1 100644\n--- a/net/mac80211/key.h\n+++ b/net/mac80211/key.h\n@@ -2,7 +2,7 @@\n /*\n * Copyright 2002-2004, Instant802 Networks, Inc.\n * Copyright 2005, Devicescape Software, Inc.\n- * Copyright (C) 2019, 2022-2023 Intel Corporation\n+ * Copyright (C) 2019, 2022-2023, 2026 Intel Corporation\n */\n \n #ifndef IEEE80211_KEY_H\n@@ -19,6 +19,7 @@\n #define NUM_DEFAULT_KEYS 4\n #define NUM_DEFAULT_MGMT_KEYS 2\n #define NUM_DEFAULT_BEACON_KEYS 2\n+#define NUM_CTRL_KEYS 2\n #define INVALID_PTK_KEYIDX 2 /* Keyidx always pointing to a NULL key for PTK */\n \n struct ieee80211_local;\ndiff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c\nindex f51167f0fc46d..34d713c9a6914 100644\n--- a/net/mac80211/mlme.c\n+++ b/net/mac80211/mlme.c\n@@ -2337,6 +2337,10 @@ ieee80211_add_link_elems(struct ieee80211_sub_if_data *sdata,\n \t\tieee80211_put_eht_cap(skb, sdata, sband,\n \t\t\t\t \u0026assoc_data-\u003elink[link_id].conn);\n \n+\t/* Insert CIP only on the assoc link (it will be inherited) */\n+\tif (link_id == assoc_data-\u003eassoc_link_id \u0026\u0026 assoc_data-\u003ecip)\n+\t\tieee80211_put_cip_cap(skb, sdata);\n+\n \tif (assoc_data-\u003elink[link_id].conn.mode \u003e= IEEE80211_CONN_MODE_UHR)\n \t\tieee80211_put_uhr_cap(skb, sdata, sband);\n \n@@ -2613,7 +2617,8 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)\n \t assoc_data-\u003eie_len + /* extra IEs */\n \t (assoc_data-\u003efils_kek_len ? 16 /* AES-SIV */ : 0) +\n \t 9 /* WMM */ +\n-\t 4 /* regulatory connectivity, if 6 GHz is supported */;\n+\t 4 /* regulatory connectivity, if 6 GHz is supported */ +\n+\t (assoc_data-\u003ecip ? 4 /* CIP capabilities */ : 0);\n \n \tfor (link_id = 0; link_id \u003c IEEE80211_MLD_MAX_NUM_LINKS; link_id++) {\n \t\tstruct cfg80211_bss *cbss = assoc_data-\u003elink[link_id].bss;\n@@ -6274,6 +6279,19 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link,\n \t\t/* TODO: OPEN: what happens if BSS color disable is set? */\n \t}\n \n+\tif (assoc_data-\u003ecip) {\n+\t\tif (elems-\u003ecip_cap) {\n+\t\t\tlink_sta-\u003epub-\u003ecip_mic_padding =\n+\t\t\t\tu8_get_bits(elems-\u003ecip_cap-\u003ev,\n+\t\t\t\t\t WLAN_CIP_CAPA_MIC_PADDING);\n+\t\t} else {\n+\t\t\tsdata_info(sdata,\n+\t\t\t\t \"CIP Capabilities not included in association response\\n\");\n+\t\t\tret = false;\n+\t\t\tgoto out;\n+\t\t}\n+\t}\n+\n \tif (cbss-\u003etransmitted_bss) {\n \t\tbss_conf-\u003enontransmitted = true;\n \t\tether_addr_copy(bss_conf-\u003etransmitter_bssid,\n@@ -7000,6 +7018,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,\n \t\tgoto out_err;\n \n \tsta-\u003esta.spp_amsdu = assoc_data-\u003espp_amsdu;\n+\tsta-\u003esta.cip = assoc_data-\u003ecip;\n \n \tif (ieee80211_vif_is_mld(\u0026sdata-\u003evif)) {\n \t\tif (!elems-\u003eml_basic)\n@@ -10538,6 +10557,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,\n \t}\n \n \tassoc_data-\u003espp_amsdu = req-\u003eflags \u0026 ASSOC_REQ_SPP_AMSDU;\n+\tassoc_data-\u003ecip = req-\u003eflags \u0026 ASSOC_REQ_CIP;\n \n \tif (ifmgd-\u003eauth_data \u0026\u0026 !ifmgd-\u003eauth_data-\u003edone) {\n \t\terr = -EBUSY;\ndiff --git a/net/mac80211/parse.c b/net/mac80211/parse.c\nindex cb2be167cde79..3b66ca7d7a5c2 100644\n--- a/net/mac80211/parse.c\n+++ b/net/mac80211/parse.c\n@@ -205,6 +205,10 @@ ieee80211_parse_extension_element(u32 *crc,\n \t\t\telems-\u003ettlm_num++;\n \t\t}\n \t\tbreak;\n+\tcase WLAN_EID_EXT_CIP_CAPA:\n+\t\tif (len \u003e= sizeof(*elems-\u003ecip_cap))\n+\t\t\telems-\u003ecip_cap = data;\n+\t\tbreak;\n \tcase WLAN_EID_EXT_UHR_OPER:\n \t\tif (params-\u003emode \u003c IEEE80211_CONN_MODE_UHR)\n \t\t\tbreak;\ndiff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h\nindex ee0d32877c5b4..f409f6a3afa1f 100644\n--- a/net/mac80211/sta_info.h\n+++ b/net/mac80211/sta_info.h\n@@ -485,6 +485,7 @@ struct ieee80211_fragment_cache {\n * @link_hash_node: hash node for rhashtable\n * @sta: Points to the STA info\n * @gtk: group keys negotiated with this station, if any\n+ * @cigtk: control integrity group keys negotiated with this station, if any\n * @tx_stats: TX statistics\n * @tx_stats.packets: # of packets transmitted\n * @tx_stats.bytes: # of bytes in all packets transmitted\n@@ -535,6 +536,7 @@ struct link_sta_info {\n \tstruct ieee80211_key __rcu *gtk[NUM_DEFAULT_KEYS +\n \t\t\t\t\tNUM_DEFAULT_MGMT_KEYS +\n \t\t\t\t\tNUM_DEFAULT_BEACON_KEYS];\n+\tstruct ieee80211_key __rcu *cigtk[NUM_CTRL_KEYS];\n \tstruct ieee80211_sta_rx_stats __percpu *pcpu_rx_stats;\n \n \t/* Updated from RX path only, no locking requirements */\ndiff --git a/net/mac80211/util.c b/net/mac80211/util.c\nindex a96078a6bfa29..8303f624b7f62 100644\n--- a/net/mac80211/util.c\n+++ b/net/mac80211/util.c\n@@ -4680,6 +4680,25 @@ int ieee80211_put_uhr_cap(struct sk_buff *skb,\n \treturn 0;\n }\n \n+int ieee80211_put_cip_cap(struct sk_buff *skb,\n+\t\t\t struct ieee80211_sub_if_data *sdata)\n+{\n+\tconst struct wiphy_iftype_ext_capab *ift_ext_capa =\n+\t\tcfg80211_get_iftype_ext_capa(sdata-\u003elocal-\u003ehw.wiphy,\n+\t\t\t\t\t ieee80211_vif_type_p2p(\u0026sdata-\u003evif));\n+\tu8 cip_capabilities = ift_ext_capa ? ift_ext_capa-\u003ecip_capabilities : 0;\n+\n+\tif (skb_tailroom(skb) \u003c 4)\n+\t\treturn -ENOBUFS;\n+\n+\tskb_put_u8(skb, WLAN_EID_EXTENSION);\n+\tskb_put_u8(skb, 2);\n+\tskb_put_u8(skb, WLAN_EID_EXT_CIP_CAPA);\n+\tskb_put_u8(skb, cip_capabilities);\n+\n+\treturn 0;\n+}\n+\n const char *ieee80211_conn_mode_str(enum ieee80211_conn_mode mode)\n {\n \tstatic const char * const modes[] = {\ndiff --git a/net/wireless/core.h b/net/wireless/core.h\nindex 15d9f7eb58b4d..3b90aa8cc6acf 100644\n--- a/net/wireless/core.h\n+++ b/net/wireless/core.h\n@@ -443,13 +443,16 @@ void cfg80211_sme_abandon_assoc(struct wireless_dev *wdev);\n \n /* internal helpers */\n bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher);\n+bool cfg80211_cigtk_supported(struct wireless_dev *wdev,\n+\t\t\t struct genl_info *info);\n bool cfg80211_valid_key_idx(struct wireless_dev *wdev,\n-\t\t\t int key_idx, bool pairwise,\n+\t\t\t int key_idx, enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr);\n int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,\n \t\t\t\t struct wireless_dev *wdev,\n \t\t\t\t struct key_params *params, int key_idx,\n-\t\t\t\t bool pairwise, const u8 *mac_addr);\n+\t\t\t\t enum nl80211_key_type type,\n+\t\t\t\t const u8 *mac_addr);\n void __cfg80211_scan_done(struct wiphy *wiphy, struct wiphy_work *wk);\n void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,\n \t\t\t bool send_message);\ndiff --git a/net/wireless/ibss.c b/net/wireless/ibss.c\nindex b1d748bdb504e..6ae561ed7f37f 100644\n--- a/net/wireless/ibss.c\n+++ b/net/wireless/ibss.c\n@@ -172,7 +172,8 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext)\n \t */\n \tif (rdev-\u003eops-\u003edel_key)\n \t\tfor (i = 0; i \u003c 6; i++)\n-\t\t\trdev_del_key(rdev, wdev, -1, i, false, NULL);\n+\t\t\trdev_del_key(rdev, wdev, -1, i, NL80211_KEYTYPE_GROUP,\n+\t\t\t\t NULL);\n \n \tif (wdev-\u003eu.ibss.current_bss) {\n \t\tcfg80211_unhold_bss(wdev-\u003eu.ibss.current_bss);\ndiff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c\nindex 8adbef5f04425..56648f7d9c7fe 100644\n--- a/net/wireless/nl80211.c\n+++ b/net/wireless/nl80211.c\n@@ -1096,6 +1096,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {\n \t[NL80211_ATTR_NPCA_PUNCT_BITMAP] =\n \t\tNLA_POLICY_FULL_RANGE(NLA_U32, \u0026nl80211_punct_bitmap_range),\n \t[NL80211_ATTR_STA_DUMP_LINK_STATS] = { .type = NLA_FLAG },\n+\t[NL80211_ATTR_ASSOC_CIP] = { .type = NLA_FLAG },\n+\t[NL80211_ATTR_CIP_CAPABILITIES] = { .type = NLA_U8 },\n };\n \n /* policy for the key attributes */\n@@ -1761,6 +1763,11 @@ static int nl80211_parse_key(struct genl_info *info, struct key_parse *k)\n \t\t\t\tGENL_SET_ERR_MSG(info, \"def key idx not 0-3\");\n \t\t\t\treturn -EINVAL;\n \t\t\t}\n+\t\t} else if (k-\u003etype == NL80211_KEYTYPE_CIGTK) {\n+\t\t\tif (k-\u003eidx \u003c 0 || k-\u003eidx \u003e 1) {\n+\t\t\t\tGENL_SET_ERR_MSG(info, \"CIGTK idx not 0-1\");\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n \t\t} else {\n \t\t\tif (k-\u003eidx \u003c 0 || k-\u003eidx \u003e 7) {\n \t\t\t\tGENL_SET_ERR_MSG(info, \"key idx not 0-7\");\n@@ -1825,7 +1832,9 @@ nl80211_parse_connkeys(struct cfg80211_registered_device *rdev,\n \t\t} else if (parse.defmgmt)\n \t\t\tgoto error;\n \t\terr = cfg80211_validate_key_settings(rdev, wdev, \u0026parse.p,\n-\t\t\t\t\t\t parse.idx, false, NULL);\n+\t\t\t\t\t\t parse.idx,\n+\t\t\t\t\t\t NL80211_KEYTYPE_GROUP,\n+\t\t\t\t\t\t NULL);\n \t\tif (err)\n \t\t\tgoto error;\n \t\tif (parse.p.cipher != WLAN_CIPHER_SUITE_WEP40 \u0026\u0026\n@@ -3615,6 +3624,11 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,\n \t\t\t\t\t\tNL80211_ATTR_EXT_MLD_CAPA_AND_OPS,\n \t\t\t\t\t\tcapab-\u003eext_mld_capa_and_ops))\n \t\t\t\t\tgoto nla_put_failure;\n+\t\t\t\tif (capab-\u003ecip_supported \u0026\u0026\n+\t\t\t\t nla_put_u8(msg,\n+\t\t\t\t\t NL80211_ATTR_CIP_CAPABILITIES,\n+\t\t\t\t\t capab-\u003ecip_capabilities))\n+\t\t\t\t\tgoto nla_put_failure;\n \n \t\t\t\tnla_nest_end(msg, nested_ext_capab);\n \t\t\t\tif (state-\u003esplit)\n@@ -5371,6 +5385,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)\n \tstruct wireless_dev *wdev = info-\u003euser_ptr[1];\n \tu8 key_idx = 0;\n \tconst u8 *mac_addr = NULL;\n+\tenum nl80211_key_type type;\n \tbool pairwise;\n \tstruct get_key_cookie cookie = {\n \t\t.error = 0,\n@@ -5403,19 +5418,24 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)\n \t\tmac_addr = nla_data(info-\u003eattrs[NL80211_ATTR_MAC]);\n \n \tpairwise = !!mac_addr;\n+\ttype = pairwise ? NL80211_KEYTYPE_PAIRWISE : NL80211_KEYTYPE_GROUP;\n \tif (info-\u003eattrs[NL80211_ATTR_KEY_TYPE]) {\n-\t\tu32 kt = nla_get_u32(info-\u003eattrs[NL80211_ATTR_KEY_TYPE]);\n+\t\ttype = nla_get_u32(info-\u003eattrs[NL80211_ATTR_KEY_TYPE]);\n \n-\t\tif (kt != NL80211_KEYTYPE_GROUP \u0026\u0026\n-\t\t kt != NL80211_KEYTYPE_PAIRWISE)\n+\t\tif (type != NL80211_KEYTYPE_GROUP \u0026\u0026\n+\t\t type != NL80211_KEYTYPE_PAIRWISE \u0026\u0026\n+\t\t type != NL80211_KEYTYPE_CIGTK) {\n+\t\t\tGENL_SET_ERR_MSG(info, \"key type not pairwise, group or CIGTK\");\n \t\t\treturn -EINVAL;\n-\t\tpairwise = kt == NL80211_KEYTYPE_PAIRWISE;\n+\t\t}\n+\n+\t\tpairwise = type == NL80211_KEYTYPE_PAIRWISE;\n \t}\n \n \tif (!rdev-\u003eops-\u003eget_key)\n \t\treturn -EOPNOTSUPP;\n \n-\tif (!cfg80211_valid_key_idx(wdev, key_idx, pairwise, mac_addr))\n+\tif (!cfg80211_valid_key_idx(wdev, key_idx, type, mac_addr))\n \t\treturn -ENOENT;\n \n \tmsg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);\n@@ -5444,7 +5464,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)\n \tif (err)\n \t\tgoto free_msg;\n \n-\terr = rdev_get_key(rdev, wdev, link_id, key_idx, pairwise, mac_addr,\n+\terr = rdev_get_key(rdev, wdev, link_id, key_idx, type, mac_addr,\n \t\t\t \u0026cookie, get_key_callback);\n \n \tif (err)\n@@ -5603,8 +5623,9 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)\n \n \t/* for now */\n \tif (key.type != NL80211_KEYTYPE_PAIRWISE \u0026\u0026\n-\t key.type != NL80211_KEYTYPE_GROUP) {\n-\t\tGENL_SET_ERR_MSG(info, \"key type not pairwise or group\");\n+\t key.type != NL80211_KEYTYPE_GROUP \u0026\u0026\n+\t key.type != NL80211_KEYTYPE_CIGTK) {\n+\t\tGENL_SET_ERR_MSG(info, \"key type not pairwise, group or CIGTK\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -5616,8 +5637,7 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)\n \t\treturn -EOPNOTSUPP;\n \n \tif (cfg80211_validate_key_settings(rdev, wdev, \u0026key.p, key.idx,\n-\t\t\t\t\t key.type == NL80211_KEYTYPE_PAIRWISE,\n-\t\t\t\t\t mac_addr)) {\n+\t\t\t\t\t key.type, mac_addr)) {\n \t\tGENL_SET_ERR_MSG(info, \"key setting validation failed\");\n \t\treturn -EINVAL;\n \t}\n@@ -5631,8 +5651,7 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)\n \t\t\t\tkey.type == NL80211_KEYTYPE_PAIRWISE);\n \n \tif (!err) {\n-\t\terr = rdev_add_key(rdev, wdev, link_id, key.idx,\n-\t\t\t\t key.type == NL80211_KEYTYPE_PAIRWISE,\n+\t\terr = rdev_add_key(rdev, wdev, link_id, key.idx, key.type,\n \t\t\t\t mac_addr, \u0026key.p);\n \t\tif (err)\n \t\t\tGENL_SET_ERR_MSG(info, \"key addition failed\");\n@@ -5666,12 +5685,13 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)\n \n \t/* for now */\n \tif (key.type != NL80211_KEYTYPE_PAIRWISE \u0026\u0026\n-\t key.type != NL80211_KEYTYPE_GROUP)\n+\t key.type != NL80211_KEYTYPE_GROUP \u0026\u0026\n+\t key.type != NL80211_KEYTYPE_CIGTK) {\n+\t\tGENL_SET_ERR_MSG(info, \"key type not pairwise, group or CIGTK\");\n \t\treturn -EINVAL;\n+\t}\n \n-\tif (!cfg80211_valid_key_idx(wdev, key.idx,\n-\t\t\t\t key.type == NL80211_KEYTYPE_PAIRWISE,\n-\t\t\t\t mac_addr))\n+\tif (!cfg80211_valid_key_idx(wdev, key.idx, key.type, mac_addr))\n \t\treturn -EINVAL;\n \n \tif (!rdev-\u003eops-\u003edel_key)\n@@ -5685,8 +5705,7 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)\n \n \tif (!err)\n \t\terr = rdev_del_key(rdev, wdev, link_id, key.idx,\n-\t\t\t\t key.type == NL80211_KEYTYPE_PAIRWISE,\n-\t\t\t\t mac_addr);\n+\t\t\t\t key.type, mac_addr);\n \n #ifdef CONFIG_CFG80211_WEXT\n \tif (!err) {\n@@ -8805,7 +8824,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,\n \t\treturn -EINVAL;\n \n \t/* When you run into this, adjust the code below for the new flag */\n-\tBUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8);\n+\tBUILD_BUG_ON(NL80211_STA_FLAG_MAX != 9);\n \n \tswitch (statype) {\n \tcase CFG80211_STA_MESH_PEER_KERNEL:\n@@ -8899,7 +8918,8 @@ int cfg80211_check_station_change(struct wiphy *wiphy,\n \t\t\t\t BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) |\n \t\t\t\t BIT(NL80211_STA_FLAG_WME) |\n \t\t\t\t BIT(NL80211_STA_FLAG_MFP) |\n-\t\t\t\t BIT(NL80211_STA_FLAG_SPP_AMSDU)))\n+\t\t\t\t BIT(NL80211_STA_FLAG_SPP_AMSDU) |\n+\t\t\t\t BIT(NL80211_STA_FLAG_CIP)))\n \t\t\treturn -EINVAL;\n \n \t\t/* but authenticated/associated only if driver handles it */\n@@ -9276,6 +9296,22 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)\n \t\t\tnla_get_u16(info-\u003eattrs[NL80211_ATTR_EML_CAPABILITY]);\n \t}\n \n+\tif (params.sta_flags_mask \u0026 BIT(NL80211_STA_FLAG_CIP) \u0026\u0026\n+\t params.sta_flags_set \u0026 BIT(NL80211_STA_FLAG_CIP)) {\n+\t\tif (!cfg80211_cigtk_supported(wdev, info))\n+\t\t\treturn -EINVAL;\n+\n+\t\t/* CIP capabilities are required if CIP is being enabled */\n+\t\tif (info-\u003eattrs[NL80211_ATTR_CIP_CAPABILITIES]) {\n+\t\t\tparams.link_sta_params.cip_cap_set = true;\n+\t\t\tparams.link_sta_params.cip_cap =\n+\t\t\t\tnla_get_u8(info-\u003eattrs[NL80211_ATTR_CIP_CAPABILITIES]);\n+\t\t} else {\n+\t\t\tGENL_SET_ERR_MSG(info, \"No CIP capabilities provided\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \tif (info-\u003eattrs[NL80211_ATTR_AIRTIME_WEIGHT])\n \t\tparams.airtime_weight =\n \t\t\tnla_get_u16(info-\u003eattrs[NL80211_ATTR_AIRTIME_WEIGHT]);\n@@ -9475,6 +9511,22 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)\n \t\t\tnla_get_u16(info-\u003eattrs[NL80211_ATTR_EML_CAPABILITY]);\n \t}\n \n+\tif (params.sta_flags_mask \u0026 BIT(NL80211_STA_FLAG_CIP) \u0026\u0026\n+\t params.sta_flags_set \u0026 BIT(NL80211_STA_FLAG_CIP)) {\n+\t\tif (!cfg80211_cigtk_supported(wdev, info))\n+\t\t\treturn -EINVAL;\n+\n+\t\t/* CIP capabilities are required if CIP is enabled */\n+\t\tif (info-\u003eattrs[NL80211_ATTR_CIP_CAPABILITIES]) {\n+\t\t\tparams.link_sta_params.cip_cap_set = true;\n+\t\t\tparams.link_sta_params.cip_cap =\n+\t\t\t\tnla_get_u8(info-\u003eattrs[NL80211_ATTR_CIP_CAPABILITIES]);\n+\t\t} else {\n+\t\t\tGENL_SET_ERR_MSG(info, \"No CIP capabilities provided\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \tif (info-\u003eattrs[NL80211_ATTR_HE_6GHZ_CAPABILITY])\n \t\tparams.link_sta_params.he_6ghz_capa =\n \t\t\tnla_data(info-\u003eattrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]);\n@@ -9552,7 +9604,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)\n \t\treturn -EINVAL;\n \n \t/* When you run into this, adjust the code below for the new flag */\n-\tBUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8);\n+\tBUILD_BUG_ON(NL80211_STA_FLAG_MAX != 9);\n \n \tswitch (wdev-\u003eiftype) {\n \tcase NL80211_IFTYPE_AP:\n@@ -9581,6 +9633,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)\n \t\t params.sta_flags_mask \u0026 BIT(NL80211_STA_FLAG_SPP_AMSDU))\n \t\t\treturn -EINVAL;\n \n+\t\tif (params.sta_flags_mask \u0026 BIT(NL80211_STA_FLAG_CIP) \u0026\u0026\n+\t\t !cfg80211_cigtk_supported(wdev, info))\n+\t\t\treturn -EINVAL;\n+\n \t\t/* Older userspace, or userspace wanting to be compatible with\n \t\t * !NL80211_FEATURE_FULL_AP_CLIENT_STATE, will not set the auth\n \t\t * and assoc flags in the mask, but assumes the station will be\n@@ -13307,6 +13363,13 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)\n \t\treq.flags |= ASSOC_REQ_SPP_AMSDU;\n \t}\n \n+\tif (nla_get_flag(info-\u003eattrs[NL80211_ATTR_ASSOC_CIP])) {\n+\t\tif (!cfg80211_cigtk_supported(dev-\u003eieee80211_ptr, info))\n+\t\t\treturn -EINVAL;\n+\n+\t\treq.flags |= ASSOC_REQ_CIP;\n+\t}\n+\n \treq.link_id = nl80211_link_id_or_invalid(info-\u003eattrs);\n \n \tif (info-\u003eattrs[NL80211_ATTR_MLO_LINKS]) {\n@@ -19174,6 +19237,23 @@ nl80211_add_mod_link_station(struct sk_buff *skb, struct genl_info *info,\n \t\tparams.he_6ghz_capa =\n \t\t\tnla_data(info-\u003eattrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]);\n \n+\tif (info-\u003eattrs[NL80211_ATTR_CIP_CAPABILITIES]) {\n+\t\tstruct wireless_dev *wdev = dev-\u003eieee80211_ptr;\n+\n+\t\tif (!cfg80211_cigtk_supported(wdev, info))\n+\t\t\treturn -EINVAL;\n+\n+\t\tparams.cip_cap_set = true;\n+\t\tparams.cip_cap =\n+\t\t\tnla_get_u8(info-\u003eattrs[NL80211_ATTR_CIP_CAPABILITIES]);\n+\n+\t\t/* Only permit CIP capabilities when adding link stations */\n+\t\tif (!add) {\n+\t\t\tGENL_SET_ERR_MSG(info, \"Cannot modify CIP capabilities\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \tif (info-\u003eattrs[NL80211_ATTR_OPMODE_NOTIF]) {\n \t\tparams.opmode_notif_used = true;\n \t\tparams.opmode_notif =\ndiff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h\nindex 6c3bad8b2d6f6..d4933bbbf0e7e 100644\n--- a/net/wireless/rdev-ops.h\n+++ b/net/wireless/rdev-ops.h\n@@ -78,42 +78,43 @@ rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,\n \n static inline int rdev_add_key(struct cfg80211_registered_device *rdev,\n \t\t\t struct wireless_dev *wdev, int link_id,\n-\t\t\t u8 key_index, bool pairwise, const u8 *mac_addr,\n-\t\t\t struct key_params *params)\n+\t\t\t u8 key_index, enum nl80211_key_type type,\n+\t\t\t const u8 *mac_addr, struct key_params *params)\n {\n \tint ret;\n-\ttrace_rdev_add_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index, pairwise,\n+\ttrace_rdev_add_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index, type,\n \t\t\t mac_addr, params-\u003emode);\n \tret = rdev-\u003eops-\u003eadd_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index,\n-\t\t\t\t pairwise, mac_addr, params);\n+\t\t\t\t type, mac_addr, params);\n \ttrace_rdev_return_int(\u0026rdev-\u003ewiphy, ret);\n \treturn ret;\n }\n \n static inline int\n rdev_get_key(struct cfg80211_registered_device *rdev, struct wireless_dev *wdev,\n-\t int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,\n-\t void *cookie,\n+\t int link_id, u8 key_index, enum nl80211_key_type type,\n+\t const u8 *mac_addr, void *cookie,\n \t void (*callback)(void *cookie, struct key_params*))\n {\n \tint ret;\n-\ttrace_rdev_get_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index, pairwise,\n+\ttrace_rdev_get_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index, type,\n \t\t\t mac_addr);\n \tret = rdev-\u003eops-\u003eget_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index,\n-\t\t\t\t pairwise, mac_addr, cookie, callback);\n+\t\t\t\t type, mac_addr, cookie, callback);\n \ttrace_rdev_return_int(\u0026rdev-\u003ewiphy, ret);\n \treturn ret;\n }\n \n static inline int rdev_del_key(struct cfg80211_registered_device *rdev,\n \t\t\t struct wireless_dev *wdev, int link_id,\n-\t\t\t u8 key_index, bool pairwise, const u8 *mac_addr)\n+\t\t\t u8 key_index, enum nl80211_key_type type,\n+\t\t\t const u8 *mac_addr)\n {\n \tint ret;\n-\ttrace_rdev_del_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index, pairwise,\n+\ttrace_rdev_del_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index, type,\n \t\t\t mac_addr);\n \tret = rdev-\u003eops-\u003edel_key(\u0026rdev-\u003ewiphy, wdev, link_id, key_index,\n-\t\t\t\t pairwise, mac_addr);\n+\t\t\t\t type, mac_addr);\n \ttrace_rdev_return_int(\u0026rdev-\u003ewiphy, ret);\n \treturn ret;\n }\ndiff --git a/net/wireless/sme.c b/net/wireless/sme.c\nindex 2a719b5c487e3..458f72d8351ab 100644\n--- a/net/wireless/sme.c\n+++ b/net/wireless/sme.c\n@@ -1387,7 +1387,15 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,\n \t\t\t NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT))\n \t\t\tmax_key_idx = 7;\n \t\tfor (i = 0; i \u003c= max_key_idx; i++)\n-\t\t\trdev_del_key(rdev, wdev, -1, i, false, NULL);\n+\t\t\trdev_del_key(rdev, wdev, -1, i, NL80211_KEYTYPE_GROUP,\n+\t\t\t\t NULL);\n+\n+\t\tif (cfg80211_cigtk_supported(wdev, NULL)) {\n+\t\t\trdev_del_key(rdev, wdev, -1, 0, NL80211_KEYTYPE_CIGTK,\n+\t\t\t\t NULL);\n+\t\t\trdev_del_key(rdev, wdev, -1, 1, NL80211_KEYTYPE_CIGTK,\n+\t\t\t\t NULL);\n+\t\t}\n \t}\n \n \trdev_set_qos_map(rdev, dev, NULL);\ndiff --git a/net/wireless/trace.h b/net/wireless/trace.h\nindex 8c2a91b85c396..c210ca1e44e2b 100644\n--- a/net/wireless/trace.h\n+++ b/net/wireless/trace.h\n@@ -557,15 +557,15 @@ TRACE_EVENT(rdev_change_virtual_intf,\n \n DECLARE_EVENT_CLASS(key_handle,\n \tTP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n-\t\t u8 key_index, bool pairwise, const u8 *mac_addr),\n-\tTP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr),\n+\t\t u8 key_index, enum nl80211_key_type type, const u8 *mac_addr),\n+\tTP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr),\n \tTP_STRUCT__entry(\n \t\tWIPHY_ENTRY\n \t\tWDEV_ENTRY\n \t\tMAC_ENTRY(mac_addr)\n \t\t__field(int, link_id)\n \t\t__field(u8, key_index)\n-\t\t__field(bool, pairwise)\n+\t\t__field(u8, type)\n \t),\n \tTP_fast_assign(\n \t\tWIPHY_ASSIGN;\n@@ -573,38 +573,40 @@ DECLARE_EVENT_CLASS(key_handle,\n \t\tMAC_ASSIGN(mac_addr, mac_addr);\n \t\t__entry-\u003elink_id = link_id;\n \t\t__entry-\u003ekey_index = key_index;\n-\t\t__entry-\u003epairwise = pairwise;\n+\t\t__entry-\u003etype = type;\n \t),\n \tTP_printk(WIPHY_PR_FMT \", \" WDEV_PR_FMT \", link_id: %d, \"\n-\t\t \"key_index: %u, pairwise: %s, mac addr: %pM\",\n+\t\t \"key_index: %u, pairwise: %s, type: %d, mac addr: %pM\",\n \t\t WIPHY_PR_ARG, WDEV_PR_ARG, __entry-\u003elink_id,\n-\t\t __entry-\u003ekey_index, BOOL_TO_STR(__entry-\u003epairwise),\n-\t\t __entry-\u003emac_addr)\n+\t\t __entry-\u003ekey_index,\n+\t\t BOOL_TO_STR(__entry-\u003etype == NL80211_KEYTYPE_PAIRWISE),\n+\t\t __entry-\u003etype, __entry-\u003emac_addr)\n );\n \n DEFINE_EVENT(key_handle, rdev_get_key,\n \tTP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n-\t\t u8 key_index, bool pairwise, const u8 *mac_addr),\n-\tTP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr)\n+\t\t u8 key_index, enum nl80211_key_type type, const u8 *mac_addr),\n+\tTP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr)\n );\n \n DEFINE_EVENT(key_handle, rdev_del_key,\n \tTP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n-\t\t u8 key_index, bool pairwise, const u8 *mac_addr),\n-\tTP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr)\n+\t\t u8 key_index, enum nl80211_key_type type, const u8 *mac_addr),\n+\tTP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr)\n );\n \n TRACE_EVENT(rdev_add_key,\n \tTP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,\n-\t\t u8 key_index, bool pairwise, const u8 *mac_addr, u8 mode),\n-\tTP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr, mode),\n+\t\t u8 key_index, enum nl80211_key_type type, const u8 *mac_addr,\n+\t\t u8 mode),\n+\tTP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr, mode),\n \tTP_STRUCT__entry(\n \t\tWIPHY_ENTRY\n \t\tWDEV_ENTRY\n \t\tMAC_ENTRY(mac_addr)\n \t\t__field(int, link_id)\n \t\t__field(u8, key_index)\n-\t\t__field(bool, pairwise)\n+\t\t__field(u8, type)\n \t\t__field(u8, mode)\n \t),\n \tTP_fast_assign(\n@@ -613,15 +615,16 @@ TRACE_EVENT(rdev_add_key,\n \t\tMAC_ASSIGN(mac_addr, mac_addr);\n \t\t__entry-\u003elink_id = link_id;\n \t\t__entry-\u003ekey_index = key_index;\n-\t\t__entry-\u003epairwise = pairwise;\n+\t\t__entry-\u003etype = type;\n \t\t__entry-\u003emode = mode;\n \t),\n \tTP_printk(WIPHY_PR_FMT \", \" WDEV_PR_FMT \", link_id: %d, \"\n-\t\t \"key_index: %u, mode: %u, pairwise: %s, \"\n+\t\t \"key_index: %u, mode: %u, pairwise: %s, type: %d, \"\n \t\t \"mac addr: %pM\",\n \t\t WIPHY_PR_ARG, WDEV_PR_ARG, __entry-\u003elink_id,\n \t\t __entry-\u003ekey_index, __entry-\u003emode,\n-\t\t BOOL_TO_STR(__entry-\u003epairwise), __entry-\u003emac_addr)\n+\t\t BOOL_TO_STR(__entry-\u003etype == NL80211_KEYTYPE_PAIRWISE),\n+\t\t __entry-\u003etype, __entry-\u003emac_addr)\n );\n \n TRACE_EVENT(rdev_set_default_key,\ndiff --git a/net/wireless/util.c b/net/wireless/util.c\nindex 3e584d0ca3e26..dd166c352910f 100644\n--- a/net/wireless/util.c\n+++ b/net/wireless/util.c\n@@ -258,8 +258,24 @@ static bool cfg80211_igtk_cipher_supported(struct wiphy *wiphy)\n \treturn false;\n }\n \n+bool cfg80211_cigtk_supported(struct wireless_dev *wdev,\n+\t\t\t struct genl_info *info)\n+{\n+\tconst struct wiphy_iftype_ext_capab *ext_capab =\n+\t\tcfg80211_get_iftype_ext_capa(wdev-\u003ewiphy, wdev-\u003eiftype);\n+\n+\tif (ext_capab \u0026\u0026 ext_capab-\u003ecip_supported)\n+\t\treturn true;\n+\n+\tif (info)\n+\t\tGENL_SET_ERR_MSG(info,\n+\t\t\t\t \"Control Integrity Protocol not supported\");\n+\n+\treturn false;\n+}\n+\n bool cfg80211_valid_key_idx(struct wireless_dev *wdev,\n-\t\t\t int key_idx, bool pairwise,\n+\t\t\t int key_idx, enum nl80211_key_type type,\n \t\t\t const u8 *mac_addr)\n {\n \tif (WARN_ON(!wdev))\n@@ -272,13 +288,24 @@ bool cfg80211_valid_key_idx(struct wireless_dev *wdev,\n \t * Can't differentiate ciphers here so allow 0..3.\n \t * Pairwise keys must be for a station (MAC address given).\n \t */\n-\tif (pairwise) {\n+\tif (type == NL80211_KEYTYPE_PAIRWISE) {\n \t\tif (!mac_addr)\n \t\t\treturn false;\n \n \t\treturn key_idx \u003c 4;\n \t}\n \n+\t/* Check the wdev/iftype supports CIGTK */\n+\tif (type == NL80211_KEYTYPE_CIGTK) {\n+\t\tif (!cfg80211_cigtk_supported(wdev, NULL))\n+\t\t\treturn false;\n+\n+\t\tif (key_idx \u003e= 2)\n+\t\t\treturn false;\n+\n+\t\t/* fallthrough for mac_addr checks */\n+\t}\n+\n \t/*\n \t * For group keys, mac_addr==NULL means setting a group key\n \t * for TX, which is only supported on some interface types,\n@@ -343,9 +370,12 @@ bool cfg80211_valid_key_idx(struct wireless_dev *wdev,\n int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,\n \t\t\t\t struct wireless_dev *wdev,\n \t\t\t\t struct key_params *params, int key_idx,\n-\t\t\t\t bool pairwise, const u8 *mac_addr)\n+\t\t\t\t enum nl80211_key_type type,\n+\t\t\t\t const u8 *mac_addr)\n {\n-\tif (!cfg80211_valid_key_idx(wdev, key_idx, pairwise, mac_addr))\n+\tbool pairwise = type == NL80211_KEYTYPE_PAIRWISE;\n+\n+\tif (!cfg80211_valid_key_idx(wdev, key_idx, type, mac_addr))\n \t\treturn -EINVAL;\n \n \tswitch (params-\u003ecipher) {\n@@ -1172,7 +1202,7 @@ void cfg80211_upload_connect_keys(struct wireless_dev *wdev)\n \tfor (i = 0; i \u003c 4; i++) {\n \t\tif (!wdev-\u003econnect_keys-\u003eparams[i].cipher)\n \t\t\tcontinue;\n-\t\tif (rdev_add_key(rdev, wdev, -1, i, false, NULL,\n+\t\tif (rdev_add_key(rdev, wdev, -1, i, NL80211_KEYTYPE_GROUP, NULL,\n \t\t\t\t \u0026wdev-\u003econnect_keys-\u003eparams[i])) {\n \t\t\tnetdev_err(dev, \"failed to set key %d\\n\", i);\n \t\t\tcontinue;\ndiff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c\nindex d45bc08c0de49..ec2389f6b8b18 100644\n--- a/net/wireless/wext-compat.c\n+++ b/net/wireless/wext-compat.c\n@@ -401,6 +401,8 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev,\n \t\t\t\t int idx, struct key_params *params)\n {\n \tstruct wireless_dev *wdev = dev-\u003eieee80211_ptr;\n+\tenum nl80211_key_type key_type =\n+\t\tpairwise ? NL80211_KEYTYPE_PAIRWISE : NL80211_KEYTYPE_GROUP;\n \tint err, i;\n \tbool rejoin = false;\n \n@@ -454,11 +456,11 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev,\n \t\t\t\trejoin = true;\n \t\t\t}\n \n-\t\t\tif (!cfg80211_valid_key_idx(wdev, idx, pairwise, addr))\n+\t\t\tif (!cfg80211_valid_key_idx(wdev, idx, key_type, addr))\n \t\t\t\terr = -ENOENT;\n \t\t\telse\n-\t\t\t\terr = rdev_del_key(rdev, wdev, -1, idx, pairwise,\n-\t\t\t\t\t\t addr);\n+\t\t\t\terr = rdev_del_key(rdev, wdev, -1, idx,\n+\t\t\t\t\t\t key_type, addr);\n \t\t}\n \t\twdev-\u003ewext.connect.privacy = false;\n \t\t/*\n"
} |
| 2/1 | 2026/08/01 20:02 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"MAC80211",
"CFG80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_new_key",
"nl80211_del_key",
"nl80211_get_key",
"nl80211_set_station",
"nl80211_new_station",
"nl80211_associate",
"ieee80211_key_link",
"ieee80211_gtk_rekey_add",
"ieee80211_put_cip_cap",
"cfg80211_cigtk_supported",
"cfg80211_valid_key_idx",
"cfg80211_validate_key_settings"
],
"Reasoning": "The patch introduces support for the Control Integrity Protocol (CIP) in cfg80211 and mac80211, including a new key type `NL80211_KEYTYPE_CIGTK` and new netlink attributes. It modifies key handling logic across the wireless stack and updates `mac80211_hwsim` to advertise CIP support, making it testable in virtualized environments. The changes are functional and reachable via standard nl80211 netlink commands.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit f9b4d9d352c7022539c302dd0518e22603759d20
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Aug 1 20:02:25 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index ecde91159b546..d4e9423fc5e4d 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1125,13 +1125,15 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
}
static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr,
struct key_params *params)
{
struct ath6kl *ar = ath6kl_priv(wdev->netdev);
struct ath6kl_vif *vif = netdev_priv(wdev->netdev);
struct ath6kl_key *key = NULL;
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
int seq_len;
u8 key_usage;
u8 key_type;
@@ -1250,7 +1252,8 @@ static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wde
}
static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
struct ath6kl *ar = ath6kl_priv(wdev->netdev);
@@ -1280,7 +1283,8 @@ static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wde
}
static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr, void *cookie,
void (*callback) (void *cookie,
struct key_params *))
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 5f2bd9a31faf6..c097831b7faf3 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -1621,11 +1621,13 @@ static void wil_del_rx_key(u8 key_index, enum wmi_key_usage key_usage,
static int wil_cfg80211_add_key(struct wiphy *wiphy,
struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise,
+ u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr,
struct key_params *params)
{
int rc;
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
struct wil6210_priv *wil = wiphy_to_wil(wiphy);
struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
enum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise);
@@ -1696,12 +1698,14 @@ static int wil_cfg80211_add_key(struct wiphy *wiphy,
static int wil_cfg80211_del_key(struct wiphy *wiphy,
struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise,
+ u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
struct wil6210_priv *wil = wiphy_to_wil(wiphy);
struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
- enum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise);
+ enum wmi_key_usage key_usage =
+ wil_detect_key_usage(wdev, type == NL80211_KEYTYPE_PAIRWISE);
struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid,
key_usage,
mac_addr);
@@ -2072,7 +2076,8 @@ void wil_cfg80211_ap_recovery(struct wil6210_priv *wil)
key_params.seq_len = IEEE80211_GCMP_PN_LEN;
rc = wil_cfg80211_add_key(wiphy, vif_to_wdev(vif), -1,
vif->gtk_index,
- false, NULL, &key_params);
+ NL80211_KEYTYPE_PAIRWISE,
+ NULL, &key_params);
if (rc)
wil_err(wil, "vif %d recovery add key failed (%d)\n",
i, rc);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 6b2c34e3a796c..785fd57d7c6cc 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -2770,7 +2770,8 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev,
static s32
brcmf_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_idx, bool pairwise,
+ int link_id, u8 key_idx,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
struct brcmf_if *ifp = netdev_priv(wdev->netdev);
@@ -2808,7 +2809,8 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
static s32
brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_idx, bool pairwise,
+ int link_id, u8 key_idx,
+ enum nl80211_key_type type,
const u8 *mac_addr, struct key_params *params)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
@@ -2834,7 +2836,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
if (params->key_len == 0)
return brcmf_cfg80211_del_key(wiphy, wdev, -1, key_idx,
- pairwise, mac_addr);
+ type, mac_addr);
if (params->key_len > sizeof(key->data)) {
bphy_err(drvr, "Too long key length (%u)\n", params->key_len);
@@ -2930,7 +2932,8 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
static s32
brcmf_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_idx, bool pairwise,
+ int link_id, u8 key_idx,
+ enum nl80211_key_type type,
const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie,
struct key_params *params))
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
index 55f9b809e764d..6d8ede336d59b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
@@ -1138,7 +1138,8 @@ iwl_mld_add_mcast_rekey(struct ieee80211_vif *vif,
return;
key_config = ieee80211_gtk_rekey_add(vif, key_data->id, key_data->key,
- sizeof(key_data->key), link_id);
+ sizeof(key_data->key), link_id,
+ false);
if (IS_ERR(key_config))
return;
@@ -1220,7 +1221,8 @@ static void iwl_mld_mlo_rekey(struct iwl_mld *mld,
mlo_key->idx, link_id);
key = ieee80211_gtk_rekey_add(vif, mlo_key->idx, mlo_key->key,
- sizeof(mlo_key->key), link_id);
+ sizeof(mlo_key->key), link_id,
+ false);
if (IS_ERR(key))
continue;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 6b11fa32ea5c6..bd52f2ebd3ba1 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -1887,7 +1887,8 @@ static bool iwl_mvm_gtk_rekey(struct iwl_wowlan_status_data *status,
key = ieee80211_gtk_rekey_add(vif, status->gtk[i].id,
status->gtk[i].key,
- sizeof(status->gtk[i].key), -1);
+ sizeof(status->gtk[i].key), -1,
+ false);
if (IS_ERR(key)) {
/* FW may send also the old keys */
if (PTR_ERR(key) == -EALREADY)
@@ -1922,7 +1923,8 @@ iwl_mvm_d3_igtk_bigtk_rekey_add(struct iwl_wowlan_status_data *status,
return true;
key_config = ieee80211_gtk_rekey_add(vif, keyidx, key_data->key,
- sizeof(key_data->key), -1);
+ sizeof(key_data->key), -1,
+ false);
if (IS_ERR(key_config)) {
/* FW may send also the old keys */
return PTR_ERR(key_config) == -EALREADY;
diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c
index 72c92f72469de..e015cfa1950c1 100644
--- a/drivers/net/wireless/marvell/libertas/cfg.c
+++ b/drivers/net/wireless/marvell/libertas/cfg.c
@@ -1508,7 +1508,8 @@ static int lbs_cfg_set_default_key(struct wiphy *wiphy,
static int lbs_cfg_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 idx, bool pairwise,
+ int link_id, u8 idx,
+ enum nl80211_key_type type,
const u8 *mac_addr, struct key_params *params)
{
struct lbs_private *priv = wiphy_priv(wiphy);
@@ -1569,7 +1570,8 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
static int lbs_cfg_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 8ec2d22a8c33a..060c351cecc06 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -142,12 +142,14 @@ static void *mwifiex_cfg80211_get_adapter(struct wiphy *wiphy)
*/
static int
mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- const u8 *peer_mac = pairwise ? mac_addr : bc_mac;
+ const u8 *peer_mac =
+ (type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;
if (mwifiex_set_encode(priv, NULL, NULL, 0, key_index, peer_mac, 1)) {
mwifiex_dbg(priv->adapter, ERROR, "deleting the crypto keys\n");
@@ -482,13 +484,15 @@ mwifiex_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,
*/
static int
mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr, struct key_params *params)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
struct mwifiex_wep_key *wep_key;
static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- const u8 *peer_mac = pairwise ? mac_addr : bc_mac;
+ const u8 *peer_mac =
+ (type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;
if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_UAP &&
(params->cipher == WLAN_CIPHER_SUITE_WEP40 ||
diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
index 6654fce4ded84..7850e0a483907 100644
--- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c
+++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
@@ -535,10 +535,13 @@ static int wilc_wfi_cfg_copy_wpa_info(struct wilc_wfi_key *key_info,
}
static int add_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr,
+ u8 key_index,
+ enum nl80211_key_type type,
+ const u8 *mac_addr,
struct key_params *params)
{
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
int ret = 0, keylen = params->key_len;
const u8 *rx_mic = NULL;
const u8 *tx_mic = NULL;
@@ -641,9 +644,10 @@ static int add_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
static int del_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index,
- bool pairwise,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
struct wilc_vif *vif = netdev_priv(wdev->netdev);
struct wilc_priv *priv = &vif->priv;
@@ -681,10 +685,11 @@ static int del_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
}
static int get_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr,
- void *cookie,
+ u8 key_index, enum nl80211_key_type type,
+ const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie, struct key_params *))
{
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
struct wilc_vif *vif = netdev_priv(wdev->netdev);
struct wilc_priv *priv = &vif->priv;
struct key_params key_params;
diff --git a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
index 4f9e20f728114..08b6db147452c 100644
--- a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
+++ b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
@@ -99,12 +99,14 @@ static void *nxpwifi_cfg80211_get_adapter(struct wiphy *wiphy)
/* cfg80211 operation handler to delete a network key. */
static int
nxpwifi_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
struct nxpwifi_private *priv = nxpwifi_netdev_get_priv(wdev->netdev);
static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
- const u8 *peer_mac = pairwise ? mac_addr : bc_mac;
+ const u8 *peer_mac =
+ (type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;
int ret;
ret = nxpwifi_set_encode(priv, NULL, NULL, 0, key_index, peer_mac, 1);
@@ -428,7 +430,8 @@ nxpwifi_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *netdev,
/* cfg80211 handler for adding an 802.11 encryption key. */
static int
nxpwifi_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr, struct key_params *params)
{
struct nxpwifi_private *priv = nxpwifi_netdev_get_priv(wdev->netdev);
@@ -438,7 +441,7 @@ nxpwifi_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int ret;
eth_broadcast_addr(bc_mac);
- peer_mac = pairwise ? mac_addr : bc_mac;
+ peer_mac = (type == NL80211_KEYTYPE_PAIRWISE) ? mac_addr : bc_mac;
if (GET_BSS_ROLE(priv) == NXPWIFI_BSS_ROLE_UAP &&
(params->cipher == WLAN_CIPHER_SUITE_WEP40 ||
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 9e44c85d2051c..38625342169ff 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -533,10 +533,12 @@ qtnf_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev,
}
static int qtnf_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr, struct key_params *params)
{
struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev);
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
int ret;
ret = qtnf_cmd_send_add_key(vif, key_index, pairwise, mac_addr, params);
@@ -549,10 +551,12 @@ static int qtnf_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
}
static int qtnf_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr)
{
struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev);
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
int ret;
ret = qtnf_cmd_send_del_key(vif, key_index, pairwise, mac_addr);
diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c
index 8dadd8df4fc65..c8e002238ecb2 100644
--- a/drivers/net/wireless/realtek/rtw89/wow.c
+++ b/drivers/net/wireless/realtek/rtw89/wow.c
@@ -669,10 +669,12 @@ static struct ieee80211_key_conf *rtw89_wow_gtk_rekey(struct rtw89_dev *rtwdev,
if (ieee80211_vif_is_mld(wow_vif))
key = ieee80211_gtk_rekey_add(wow_vif, keyidx, gtk,
cipher_info->len,
- rtwvif_link->link_id);
+ rtwvif_link->link_id,
+ false);
else
key = ieee80211_gtk_rekey_add(wow_vif, keyidx, gtk,
- cipher_info->len, -1);
+ cipher_info->len, -1,
+ false);
kfree(rekey_conf);
if (IS_ERR(key)) {
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
index 02b6d81cccd11..1cc322aa898dd 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
@@ -5668,6 +5668,9 @@ static const struct wiphy_iftype_ext_capab mac80211_hwsim_iftypes_ext_capa[] = {
.eml_capabilities = IEEE80211_EML_CAP_EMLSR_SUPP |
IEEE80211_EML_CAP_EMLMR_SUPPORT,
.mld_capa_and_ops = MAC80211_HWSIM_MLD_CAPA_OPS,
+ /* CIP works as hwsim does not have control frames */
+ .cip_supported = true,
+ .cip_capabilities = 0,
},
};
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 26e6740388654..16d78fd61c223 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1828,6 +1828,7 @@ enum ieee80211_eid_ext {
WLAN_EID_EXT_BANDWIDTH_INDICATION = 135,
WLAN_EID_EXT_KNOWN_STA_IDENTIFCATION = 136,
WLAN_EID_EXT_NON_AP_STA_REG_CON = 137,
+ WLAN_EID_EXT_CIP_CAPA = 150,
WLAN_EID_EXT_UHR_OPER = 151,
WLAN_EID_EXT_UHR_CAPA = 152,
WLAN_EID_EXT_MACP = 153,
@@ -2900,4 +2901,16 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
__ieee80211_check_tim(tim, tim_len, aid);
}
+/* The MIC padding subfield in the CIP capabilities */
+#define WLAN_CIP_CAPA_MIC_PADDING 0x0F
+
+/**
+ * struct ieee80211_cip_cap - CIP Capabilities element
+ *
+ * @v: The value of the Control Integrity Protocol Capability element
+ */
+struct ieee80211_cip_cap {
+ u8 v;
+} __packed;
+
#endif /* LINUX_IEEE80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index dcbb0e55c32ec..b5d98ba07239b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1821,6 +1821,8 @@ struct sta_txpwr {
* @s1g_capa: S1G capabilities of station
* @uhr_capa: UHR capabilities of the station
* @uhr_capa_len: the length of the UHR capabilities
+ * @cip_cap_set: If CIP capabilities are present, required for CIP stations
+ * @cip_cap: CIP capabilities of station
*/
struct link_station_parameters {
const u8 *mld_mac;
@@ -1842,6 +1844,8 @@ struct link_station_parameters {
const struct ieee80211_s1g_cap *s1g_capa;
const struct ieee80211_uhr_cap *uhr_capa;
u8 uhr_capa_len;
+ bool cip_cap_set;
+ u8 cip_cap;
};
/**
@@ -3402,6 +3406,7 @@ struct cfg80211_ml_reconf_req {
* flag is not set.
* @ASSOC_REQ_SPP_AMSDU: SPP A-MSDUs will be used on this connection (if any)
* @ASSOC_REQ_DISABLE_UHR: Disable UHR
+ * @ASSOC_REQ_CIP: Enable Control Integrity Protocol
*/
enum cfg80211_assoc_req_flags {
ASSOC_REQ_DISABLE_HT = BIT(0),
@@ -3413,6 +3418,7 @@ enum cfg80211_assoc_req_flags {
CONNECT_REQ_MLO_SUPPORT = BIT(6),
ASSOC_REQ_SPP_AMSDU = BIT(7),
ASSOC_REQ_DISABLE_UHR = BIT(8),
+ ASSOC_REQ_CIP = BIT(9),
};
/**
@@ -5300,14 +5306,17 @@ struct cfg80211_ops {
unsigned int link_id);
int (*add_key)(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr, struct key_params *params);
int (*get_key)(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie, struct key_params*));
int (*del_key)(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise,
+ int link_id, u8 key_index,
+ enum nl80211_key_type type,
const u8 *mac_addr);
int (*set_default_key)(struct wiphy *wiphy,
struct net_device *netdev, int link_id,
@@ -6041,6 +6050,8 @@ struct wiphy_vendor_command {
* @eml_capabilities: EML capabilities (for MLO)
* @mld_capa_and_ops: MLD capabilities and operations (for MLO)
* @ext_mld_capa_and_ops: Extended MLD capabilities and operations (for MLO)
+ * @cip_supported: CIP is supported and the capabilities are valid
+ * @cip_capabilities: CIP Capabilities element containing the MIC padding delay
*/
struct wiphy_iftype_ext_capab {
enum nl80211_iftype iftype;
@@ -6050,6 +6061,8 @@ struct wiphy_iftype_ext_capab {
u16 eml_capabilities;
u16 mld_capa_and_ops;
u16 ext_mld_capa_and_ops;
+ bool cip_supported;
+ u8 cip_capabilities;
};
/**
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9d1fac6e80829..aae140fdc2bb1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2396,6 +2396,8 @@ static inline bool lockdep_vif_wiphy_mutex_held(struct ieee80211_vif *vif)
* number generation only
* @IEEE80211_KEY_FLAG_SPP_AMSDU: SPP A-MSDUs can be used with this key
* (set by mac80211 from the sta->spp_amsdu flag)
+ * @IEEE80211_KEY_FLAG_CIP: This key is used for the Control Integrity
+ * Protocol, and is either a pairwise key or a CIGTK.
*/
enum ieee80211_key_flags {
IEEE80211_KEY_FLAG_GENERATE_IV_MGMT = BIT(0),
@@ -2410,6 +2412,7 @@ enum ieee80211_key_flags {
IEEE80211_KEY_FLAG_NO_AUTO_TX = BIT(9),
IEEE80211_KEY_FLAG_GENERATE_MMIE = BIT(10),
IEEE80211_KEY_FLAG_SPP_AMSDU = BIT(11),
+ IEEE80211_KEY_FLAG_CIP = BIT(12),
};
/**
@@ -2630,6 +2633,8 @@ struct ieee80211_sta_aggregates {
* @eht_cap: EHT capabilities of this STA
* @uhr_cap: UHR capabilities of this STA
* @s1g_cap: S1G capabilities of this STA
+ * @cip_mic_padding: the MIC padding required by the STA as defined in its
+ * CIP Capabilities element
* @agg: per-link data for multi-link aggregation
* @bandwidth: current bandwidth the station can receive with.
* This is the minimum between the peer's capabilities and our own
@@ -2658,6 +2663,7 @@ struct ieee80211_link_sta {
struct ieee80211_sta_eht_cap eht_cap;
struct ieee80211_sta_uhr_cap uhr_cap;
struct ieee80211_sta_s1g_cap s1g_cap;
+ u8 cip_mic_padding;
struct ieee80211_sta_aggregates agg;
@@ -2721,6 +2727,7 @@ struct ieee80211_link_sta {
* @valid_links: bitmap of valid links, or 0 for non-MLO
* @spp_amsdu: indicates whether the STA uses SPP A-MSDU or not.
* @epp_peer: indicates that the peer is an EPP peer.
+ * @cip: indicates whether the STA uses control frame protection or not.
* @nmi: For NDI stations, pointer to the NMI station of the peer.
* @nan_sched: NAN peer schedule for this station. Valid only for NMI stations.
* @ext_mld_capa_ops: the MLD's extended MLD capabilities and operations
@@ -2742,6 +2749,8 @@ struct ieee80211_sta {
u8 max_amsdu_subframes;
u16 eml_cap;
+ bool cip;
+
struct ieee80211_sta_aggregates *cur;
bool support_p2p_ps;
@@ -6279,6 +6288,7 @@ void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
* @key_len: the key data. Might be bigger than the actual key length,
* but not smaller (for the driver convinence)
* @link_id: the link id of the key or -1 for non-MLO
+ * @cigtk: whether this is a CIGTK
*
* When GTK rekeying was done while the system was suspended, (a) new
* key(s) will be available. These will be needed by mac80211 for proper
@@ -6305,7 +6315,7 @@ void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
struct ieee80211_key_conf *
ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
u8 idx, u8 *key_data, u8 key_len,
- int link_id);
+ int link_id, bool cigtk);
/**
* ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 020387d764122..3e6e59fb8e17f 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -3185,6 +3185,11 @@ enum nl80211_commands {
* The aggregated message always precedes the per-link messages for the
* same station within a dump sequence.
*
+ * @NL80211_ATTR_ASSOC_CIP: Enable Control Integrity Protocol for the
+ * association
+ * @NL80211_ATTR_CIP_CAPABILITIES: The Control Integrity Protocol for the
+ * station.
+ *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -3280,6 +3285,8 @@ enum nl80211_attrs {
NL80211_ATTR_FREQ_FIXED,
+ NL80211_ATTR_ASSOC_CIP,
+ NL80211_ATTR_CIP_CAPABILITIES,
NL80211_ATTR_WIPHY_RETRY_SHORT,
NL80211_ATTR_WIPHY_RETRY_LONG,
@@ -3934,6 +3941,7 @@ enum nl80211_iftype {
* that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
* previously added station into associated state
* @NL80211_STA_FLAG_SPP_AMSDU: station supports SPP A-MSDUs
+ * @NL80211_STA_FLAG_CIP: station has Control Integrity Protocol (CIP) enabled
* @NL80211_STA_FLAG_MAX: highest station flag number currently defined
* @__NL80211_STA_FLAG_AFTER_LAST: internal use
*/
@@ -3947,6 +3955,7 @@ enum nl80211_sta_flags {
NL80211_STA_FLAG_TDLS_PEER,
NL80211_STA_FLAG_ASSOCIATED,
NL80211_STA_FLAG_SPP_AMSDU,
+ NL80211_STA_FLAG_CIP,
/* keep last */
__NL80211_STA_FLAG_AFTER_LAST,
@@ -5778,12 +5787,16 @@ enum nl80211_auth_type {
* @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
* @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
* @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
+ * @NL80211_KEYTYPE_CIGTK: Control Integrity Group Temporal Key
+ * The cipher is GMAC-256 but passed as GCMP-256,
+ * same as the pairwise key when used for CIP.
* @NUM_NL80211_KEYTYPES: number of defined key types
*/
enum nl80211_key_type {
NL80211_KEYTYPE_GROUP,
NL80211_KEYTYPE_PAIRWISE,
NL80211_KEYTYPE_PEERKEY,
+ NL80211_KEYTYPE_CIGTK,
NUM_NL80211_KEYTYPES
};
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 0a9247be26afa..3bf81629cde34 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -611,12 +611,15 @@ static int ieee80211_set_tx(struct ieee80211_sub_if_data *sdata,
}
static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_idx, bool pairwise,
+ int link_id, u8 key_idx,
+ enum nl80211_key_type type,
const u8 *mac_addr, struct key_params *params)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct ieee80211_link_data *link =
ieee80211_link_or_deflink(sdata, link_id, false);
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
+ bool cigtk = type == NL80211_KEYTYPE_CIGTK;
struct ieee80211_local *local = sdata->local;
struct sta_info *sta = NULL;
struct ieee80211_key *key;
@@ -660,6 +663,9 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
key->conf.link_id = -1;
} else {
key->conf.link_id = link->link_id;
+
+ if (cigtk)
+ key->conf.flags |= IEEE80211_KEY_FLAG_CIP;
}
if (params->mode == NL80211_KEY_NO_TX)
@@ -737,10 +743,13 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
static struct ieee80211_key *
ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,
- u8 key_idx, bool pairwise, const u8 *mac_addr)
+ u8 key_idx, enum nl80211_key_type type,
+ const u8 *mac_addr)
{
struct ieee80211_local *local __maybe_unused = sdata->local;
struct ieee80211_link_data *link = &sdata->deflink;
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
+ bool cigtk = type == NL80211_KEYTYPE_CIGTK;
struct ieee80211_key *key;
if (link_id >= 0) {
@@ -770,7 +779,11 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,
return wiphy_dereference(local->hw.wiphy,
sta->ptk[key_idx]);
- if (!pairwise &&
+ if (cigtk && key_idx < NUM_CTRL_KEYS)
+ return wiphy_dereference(local->hw.wiphy,
+ link_sta->cigtk[key_idx]);
+
+ if (!pairwise && !cigtk &&
key_idx < NUM_DEFAULT_KEYS +
NUM_DEFAULT_MGMT_KEYS +
NUM_DEFAULT_BEACON_KEYS)
@@ -783,6 +796,9 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,
if (pairwise && key_idx < NUM_DEFAULT_KEYS)
return wiphy_dereference(local->hw.wiphy, sdata->keys[key_idx]);
+ if (cigtk)
+ return wiphy_dereference(local->hw.wiphy, link->cigtk[key_idx]);
+
key = wiphy_dereference(local->hw.wiphy, link->gtk[key_idx]);
if (key)
return key;
@@ -795,8 +811,8 @@ ieee80211_lookup_key(struct ieee80211_sub_if_data *sdata, int link_id,
}
static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_idx, bool pairwise,
- const u8 *mac_addr)
+ int link_id, u8 key_idx,
+ enum nl80211_key_type type, const u8 *mac_addr)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct ieee80211_local *local = sdata->local;
@@ -804,7 +820,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
lockdep_assert_wiphy(local->hw.wiphy);
- key = ieee80211_lookup_key(sdata, link_id, key_idx, pairwise, mac_addr);
+ key = ieee80211_lookup_key(sdata, link_id, key_idx, type, mac_addr);
if (!key)
return -ENOENT;
@@ -814,7 +830,8 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
}
static int ieee80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
- int link_id, u8 key_idx, bool pairwise,
+ int link_id, u8 key_idx,
+ enum nl80211_key_type type,
const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie,
struct key_params *params))
@@ -833,7 +850,7 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
rcu_read_lock();
- key = ieee80211_lookup_key(sdata, link_id, key_idx, pairwise, mac_addr);
+ key = ieee80211_lookup_key(sdata, link_id, key_idx, type, mac_addr);
if (!key)
goto out;
@@ -2289,6 +2306,8 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,
case STA_LINK_MODE_NEW:
if (!params->link_mac)
return -EINVAL;
+ if (sta->sta.cip && !params->cip_cap_set)
+ return -EINVAL;
break;
case STA_LINK_MODE_LINK_MODIFY:
break;
@@ -2411,6 +2430,9 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,
ieee80211_s1g_cap_to_sta_s1g_cap(sdata, params->s1g_capa,
link_sta);
+ if (params->cip_cap_set)
+ link_sta->pub->cip_mic_padding = params->cip_cap;
+
switch (sdata->vif.type) {
case NL80211_IFTYPE_NAN:
case NL80211_IFTYPE_NAN_DATA:
@@ -2573,6 +2595,9 @@ static int sta_apply_parameters(struct ieee80211_local *local,
if (params->eml_cap_present)
sta->sta.eml_cap = params->eml_cap;
+ if (params->sta_flags_set & BIT(NL80211_STA_FLAG_CIP))
+ sta->sta.cip = true;
+
ret = sta_link_apply_parameters(local, sta, STA_LINK_MODE_STA_MODIFY,
¶ms->link_sta_params);
if (ret)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index a1ef88fe846dd..fc85f8bf96e3a 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -477,6 +477,7 @@ struct ieee80211_mgd_assoc_data {
bool comeback; /* whether the AP has requested association comeback */
bool s1g;
bool spp_amsdu;
+ bool cip;
s8 assoc_link_id;
@@ -1104,6 +1105,7 @@ struct ieee80211_link_data {
struct ieee80211_key __rcu *gtk[NUM_DEFAULT_KEYS +
NUM_DEFAULT_MGMT_KEYS +
NUM_DEFAULT_BEACON_KEYS];
+ struct ieee80211_key __rcu *cigtk[NUM_CTRL_KEYS];
struct ieee80211_key __rcu *default_multicast_key;
struct ieee80211_key __rcu *default_mgmt_key;
struct ieee80211_key __rcu *default_beacon_key;
@@ -1870,6 +1872,7 @@ struct ieee802_11_elems {
const struct ieee80211_ttlm_elem *ttlm[IEEE80211_TTLM_MAX_CNT];
const struct ieee80211_uhr_cap *uhr_cap;
const struct ieee80211_uhr_operation *uhr_operation;
+ const struct ieee80211_cip_cap *cip_cap;
/* not the order in the psd values is per element, not per chandef */
struct ieee80211_parsed_tpe tpe;
@@ -2775,6 +2778,8 @@ int ieee80211_put_uhr_cap(struct sk_buff *skb,
const struct ieee80211_supported_band *sband);
void ieee80211_put_reg_conn(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb);
+int ieee80211_put_cip_cap(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata);
/* channel management */
bool ieee80211_chandef_ht_oper(const struct ieee80211_ht_operation *ht_oper,
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index f45e792abede5..4c9788ec0b74f 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -205,6 +205,10 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
sta ? sta->sta.addr : bcast_addr, ret);
out_unsupported:
+ /* Control Integrity Protocol can only be done in hardware */
+ if (key->conf.flags & IEEE80211_KEY_FLAG_CIP)
+ return -EINVAL;
+
switch (key->conf.cipher) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
@@ -440,11 +444,13 @@ void ieee80211_set_default_beacon_key(struct ieee80211_link_data *link,
static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
struct ieee80211_link_data *link,
struct sta_info *sta,
- bool pairwise,
+ enum ieee80211_key_flags flags,
struct ieee80211_key *old,
struct ieee80211_key *new)
{
struct link_sta_info *link_sta = sta ? &sta->deflink : NULL;
+ bool pairwise = flags & IEEE80211_KEY_FLAG_PAIRWISE;
+ bool cip = flags & IEEE80211_KEY_FLAG_CIP;
int link_id;
int idx;
int ret = 0;
@@ -535,6 +541,8 @@ static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
if (new &&
!(new->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX))
_ieee80211_set_tx_key(new, true);
+ } else if (cip) {
+ rcu_assign_pointer(link_sta->cigtk[idx], new);
} else {
rcu_assign_pointer(link_sta->gtk[idx], new);
}
@@ -569,6 +577,8 @@ static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
if (is_wep || pairwise)
rcu_assign_pointer(sdata->keys[idx], new);
+ else if (cip)
+ rcu_assign_pointer(link->cigtk[idx], new);
else
rcu_assign_pointer(link->gtk[idx], new);
@@ -883,6 +893,10 @@ int ieee80211_key_link(struct ieee80211_key *key,
ret = -EOPNOTSUPP;
goto out;
}
+
+ /* Set CIP flag if enabled for the station */
+ if (sta->sta.cip)
+ key->conf.flags |= IEEE80211_KEY_FLAG_CIP;
} else if (sta) {
struct link_sta_info *link_sta = &sta->deflink;
int link_id = key->conf.link_id;
@@ -896,15 +910,25 @@ int ieee80211_key_link(struct ieee80211_key *key,
}
}
- old_key = wiphy_dereference(sdata->local->hw.wiphy,
- link_sta->gtk[idx]);
- } else {
- if (idx < NUM_DEFAULT_KEYS)
+ if (key->conf.flags & IEEE80211_KEY_FLAG_CIP)
old_key = wiphy_dereference(sdata->local->hw.wiphy,
- sdata->keys[idx]);
- if (!old_key)
+ link_sta->cigtk[idx]);
+ else
old_key = wiphy_dereference(sdata->local->hw.wiphy,
- link->gtk[idx]);
+ link_sta->gtk[idx]);
+ } else {
+ if (key->conf.flags & IEEE80211_KEY_FLAG_CIP) {
+ old_key = wiphy_dereference(sdata->local->hw.wiphy,
+ link->cigtk[idx]);
+ } else {
+ if (idx < NUM_DEFAULT_KEYS)
+ old_key = wiphy_dereference(sdata->local->hw.wiphy,
+ sdata->keys[idx]);
+
+ if (!old_key)
+ old_key = wiphy_dereference(sdata->local->hw.wiphy,
+ link->gtk[idx]);
+ }
}
/* Non-pairwise keys must also not switch the cipher on rekey */
@@ -938,9 +962,17 @@ int ieee80211_key_link(struct ieee80211_key *key,
if (sta && sta->sta.spp_amsdu)
key->conf.flags |= IEEE80211_KEY_FLAG_SPP_AMSDU;
+ /* A CIP related key must be GCMP-256 (really GMAC-256) */
+ if ((key->conf.flags & IEEE80211_KEY_FLAG_CIP) &&
+ key->conf.cipher != WLAN_CIPHER_SUITE_GCMP_256) {
+ ret = -EINVAL;
+ goto out;
+ }
+
increment_tailroom_need_count(sdata);
- ret = ieee80211_key_replace(sdata, link, sta, pairwise, old_key, key);
+ ret = ieee80211_key_replace(sdata, link, sta, key->conf.flags,
+ old_key, key);
if (!ret) {
ieee80211_debugfs_key_add(key);
@@ -966,8 +998,7 @@ void ieee80211_key_free(struct ieee80211_key *key, bool delay_tailroom)
*/
if (key->sdata)
ieee80211_key_replace(key->sdata, NULL, key->sta,
- key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
- key, NULL);
+ key->conf.flags, key, NULL);
ieee80211_key_destroy(key, delay_tailroom);
}
@@ -1098,8 +1129,7 @@ static void ieee80211_free_keys_iface(struct ieee80211_sub_if_data *sdata,
list_for_each_entry_safe(key, tmp, &sdata->key_list, list) {
ieee80211_key_replace(key->sdata, NULL, key->sta,
- key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
- key, NULL);
+ key->conf.flags, key, NULL);
list_add_tail(&key->list, keys);
}
@@ -1119,8 +1149,7 @@ void ieee80211_remove_link_keys(struct ieee80211_link_data *link,
if (key->conf.link_id != link->link_id)
continue;
ieee80211_key_replace(key->sdata, link, key->sta,
- key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
- key, NULL);
+ key->conf.flags, key, NULL);
list_add_tail(&key->list, keys);
}
}
@@ -1196,8 +1225,17 @@ void ieee80211_free_sta_keys(struct ieee80211_local *local,
if (!key)
continue;
ieee80211_key_replace(key->sdata, NULL, key->sta,
- key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
- key, NULL);
+ key->conf.flags, key, NULL);
+ __ieee80211_key_destroy(key, key->sdata->vif.type ==
+ NL80211_IFTYPE_STATION);
+ }
+
+ for (i = 0; i < ARRAY_SIZE(sta->deflink.cigtk); i++) {
+ key = wiphy_dereference(local->hw.wiphy, sta->deflink.cigtk[i]);
+ if (!key)
+ continue;
+ ieee80211_key_replace(key->sdata, NULL, key->sta,
+ key->conf.flags, key, NULL);
__ieee80211_key_destroy(key, key->sdata->vif.type ==
NL80211_IFTYPE_STATION);
}
@@ -1207,8 +1245,7 @@ void ieee80211_free_sta_keys(struct ieee80211_local *local,
if (!key)
continue;
ieee80211_key_replace(key->sdata, NULL, key->sta,
- key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
- key, NULL);
+ key->conf.flags, key, NULL);
__ieee80211_key_destroy(key, key->sdata->vif.type ==
NL80211_IFTYPE_STATION);
}
@@ -1366,7 +1403,7 @@ EXPORT_SYMBOL_GPL(ieee80211_set_key_rx_seq);
struct ieee80211_key_conf *
ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
u8 idx, u8 *key_data, u8 key_len,
- int link_id)
+ int link_id, bool cigtk)
{
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
struct ieee80211_local *local = sdata->local;
@@ -1390,10 +1427,20 @@ ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
NUM_DEFAULT_BEACON_KEYS))
return ERR_PTR(-EINVAL);
- prev_key = wiphy_dereference(local->hw.wiphy,
- link_data->gtk[idx]);
+ if (WARN_ON(cigtk && idx >= NUM_CTRL_KEYS))
+ return ERR_PTR(-EINVAL);
+
+ if (cigtk)
+ prev_key = wiphy_dereference(local->hw.wiphy,
+ link_data->cigtk[idx]);
+ else
+ prev_key = wiphy_dereference(local->hw.wiphy,
+ link_data->gtk[idx]);
if (!prev_key) {
- if (idx < NUM_DEFAULT_KEYS) {
+ if (cigtk) {
+ prev_key = wiphy_dereference(local->hw.wiphy,
+ link_data->cigtk[idx ^ 1]);
+ } else if (idx < NUM_DEFAULT_KEYS) {
for (int i = 0; i < NUM_DEFAULT_KEYS; i++) {
if (i == idx)
continue;
@@ -1424,6 +1471,9 @@ ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
if (sdata->u.mgd.mfp != IEEE80211_MFP_DISABLED)
key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT;
+ if (prev_key->conf.flags & IEEE80211_KEY_FLAG_CIP)
+ key->conf.flags |= IEEE80211_KEY_FLAG_CIP;
+
key->conf.link_id = link_data->link_id;
err = ieee80211_key_link(key, link_data, NULL);
diff --git a/net/mac80211/key.h b/net/mac80211/key.h
index 826e4e9387c55..c85992493afd1 100644
--- a/net/mac80211/key.h
+++ b/net/mac80211/key.h
@@ -2,7 +2,7 @@
/*
* Copyright 2002-2004, Instant802 Networks, Inc.
* Copyright 2005, Devicescape Software, Inc.
- * Copyright (C) 2019, 2022-2023 Intel Corporation
+ * Copyright (C) 2019, 2022-2023, 2026 Intel Corporation
*/
#ifndef IEEE80211_KEY_H
@@ -19,6 +19,7 @@
#define NUM_DEFAULT_KEYS 4
#define NUM_DEFAULT_MGMT_KEYS 2
#define NUM_DEFAULT_BEACON_KEYS 2
+#define NUM_CTRL_KEYS 2
#define INVALID_PTK_KEYIDX 2 /* Keyidx always pointing to a NULL key for PTK */
struct ieee80211_local;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f51167f0fc46d..34d713c9a6914 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2337,6 +2337,10 @@ ieee80211_add_link_elems(struct ieee80211_sub_if_data *sdata,
ieee80211_put_eht_cap(skb, sdata, sband,
&assoc_data->link[link_id].conn);
+ /* Insert CIP only on the assoc link (it will be inherited) */
+ if (link_id == assoc_data->assoc_link_id && assoc_data->cip)
+ ieee80211_put_cip_cap(skb, sdata);
+
if (assoc_data->link[link_id].conn.mode >= IEEE80211_CONN_MODE_UHR)
ieee80211_put_uhr_cap(skb, sdata, sband);
@@ -2613,7 +2617,8 @@ static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
assoc_data->ie_len + /* extra IEs */
(assoc_data->fils_kek_len ? 16 /* AES-SIV */ : 0) +
9 /* WMM */ +
- 4 /* regulatory connectivity, if 6 GHz is supported */;
+ 4 /* regulatory connectivity, if 6 GHz is supported */ +
+ (assoc_data->cip ? 4 /* CIP capabilities */ : 0);
for (link_id = 0; link_id < IEEE80211_MLD_MAX_NUM_LINKS; link_id++) {
struct cfg80211_bss *cbss = assoc_data->link[link_id].bss;
@@ -6274,6 +6279,19 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link,
/* TODO: OPEN: what happens if BSS color disable is set? */
}
+ if (assoc_data->cip) {
+ if (elems->cip_cap) {
+ link_sta->pub->cip_mic_padding =
+ u8_get_bits(elems->cip_cap->v,
+ WLAN_CIP_CAPA_MIC_PADDING);
+ } else {
+ sdata_info(sdata,
+ "CIP Capabilities not included in association response\n");
+ ret = false;
+ goto out;
+ }
+ }
+
if (cbss->transmitted_bss) {
bss_conf->nontransmitted = true;
ether_addr_copy(bss_conf->transmitter_bssid,
@@ -7000,6 +7018,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
goto out_err;
sta->sta.spp_amsdu = assoc_data->spp_amsdu;
+ sta->sta.cip = assoc_data->cip;
if (ieee80211_vif_is_mld(&sdata->vif)) {
if (!elems->ml_basic)
@@ -10538,6 +10557,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
}
assoc_data->spp_amsdu = req->flags & ASSOC_REQ_SPP_AMSDU;
+ assoc_data->cip = req->flags & ASSOC_REQ_CIP;
if (ifmgd->auth_data && !ifmgd->auth_data->done) {
err = -EBUSY;
diff --git a/net/mac80211/parse.c b/net/mac80211/parse.c
index cb2be167cde79..3b66ca7d7a5c2 100644
--- a/net/mac80211/parse.c
+++ b/net/mac80211/parse.c
@@ -205,6 +205,10 @@ ieee80211_parse_extension_element(u32 *crc,
elems->ttlm_num++;
}
break;
+ case WLAN_EID_EXT_CIP_CAPA:
+ if (len >= sizeof(*elems->cip_cap))
+ elems->cip_cap = data;
+ break;
case WLAN_EID_EXT_UHR_OPER:
if (params->mode < IEEE80211_CONN_MODE_UHR)
break;
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index ee0d32877c5b4..f409f6a3afa1f 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -485,6 +485,7 @@ struct ieee80211_fragment_cache {
* @link_hash_node: hash node for rhashtable
* @sta: Points to the STA info
* @gtk: group keys negotiated with this station, if any
+ * @cigtk: control integrity group keys negotiated with this station, if any
* @tx_stats: TX statistics
* @tx_stats.packets: # of packets transmitted
* @tx_stats.bytes: # of bytes in all packets transmitted
@@ -535,6 +536,7 @@ struct link_sta_info {
struct ieee80211_key __rcu *gtk[NUM_DEFAULT_KEYS +
NUM_DEFAULT_MGMT_KEYS +
NUM_DEFAULT_BEACON_KEYS];
+ struct ieee80211_key __rcu *cigtk[NUM_CTRL_KEYS];
struct ieee80211_sta_rx_stats __percpu *pcpu_rx_stats;
/* Updated from RX path only, no locking requirements */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index a96078a6bfa29..8303f624b7f62 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -4680,6 +4680,25 @@ int ieee80211_put_uhr_cap(struct sk_buff *skb,
return 0;
}
+int ieee80211_put_cip_cap(struct sk_buff *skb,
+ struct ieee80211_sub_if_data *sdata)
+{
+ const struct wiphy_iftype_ext_capab *ift_ext_capa =
+ cfg80211_get_iftype_ext_capa(sdata->local->hw.wiphy,
+ ieee80211_vif_type_p2p(&sdata->vif));
+ u8 cip_capabilities = ift_ext_capa ? ift_ext_capa->cip_capabilities : 0;
+
+ if (skb_tailroom(skb) < 4)
+ return -ENOBUFS;
+
+ skb_put_u8(skb, WLAN_EID_EXTENSION);
+ skb_put_u8(skb, 2);
+ skb_put_u8(skb, WLAN_EID_EXT_CIP_CAPA);
+ skb_put_u8(skb, cip_capabilities);
+
+ return 0;
+}
+
const char *ieee80211_conn_mode_str(enum ieee80211_conn_mode mode)
{
static const char * const modes[] = {
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 15d9f7eb58b4d..3b90aa8cc6acf 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -443,13 +443,16 @@ void cfg80211_sme_abandon_assoc(struct wireless_dev *wdev);
/* internal helpers */
bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher);
+bool cfg80211_cigtk_supported(struct wireless_dev *wdev,
+ struct genl_info *info);
bool cfg80211_valid_key_idx(struct wireless_dev *wdev,
- int key_idx, bool pairwise,
+ int key_idx, enum nl80211_key_type type,
const u8 *mac_addr);
int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
struct key_params *params, int key_idx,
- bool pairwise, const u8 *mac_addr);
+ enum nl80211_key_type type,
+ const u8 *mac_addr);
void __cfg80211_scan_done(struct wiphy *wiphy, struct wiphy_work *wk);
void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev,
bool send_message);
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index b1d748bdb504e..6ae561ed7f37f 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -172,7 +172,8 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext)
*/
if (rdev->ops->del_key)
for (i = 0; i < 6; i++)
- rdev_del_key(rdev, wdev, -1, i, false, NULL);
+ rdev_del_key(rdev, wdev, -1, i, NL80211_KEYTYPE_GROUP,
+ NULL);
if (wdev->u.ibss.current_bss) {
cfg80211_unhold_bss(wdev->u.ibss.current_bss);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 8adbef5f04425..56648f7d9c7fe 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1096,6 +1096,8 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
[NL80211_ATTR_NPCA_PUNCT_BITMAP] =
NLA_POLICY_FULL_RANGE(NLA_U32, &nl80211_punct_bitmap_range),
[NL80211_ATTR_STA_DUMP_LINK_STATS] = { .type = NLA_FLAG },
+ [NL80211_ATTR_ASSOC_CIP] = { .type = NLA_FLAG },
+ [NL80211_ATTR_CIP_CAPABILITIES] = { .type = NLA_U8 },
};
/* policy for the key attributes */
@@ -1761,6 +1763,11 @@ static int nl80211_parse_key(struct genl_info *info, struct key_parse *k)
GENL_SET_ERR_MSG(info, "def key idx not 0-3");
return -EINVAL;
}
+ } else if (k->type == NL80211_KEYTYPE_CIGTK) {
+ if (k->idx < 0 || k->idx > 1) {
+ GENL_SET_ERR_MSG(info, "CIGTK idx not 0-1");
+ return -EINVAL;
+ }
} else {
if (k->idx < 0 || k->idx > 7) {
GENL_SET_ERR_MSG(info, "key idx not 0-7");
@@ -1825,7 +1832,9 @@ nl80211_parse_connkeys(struct cfg80211_registered_device *rdev,
} else if (parse.defmgmt)
goto error;
err = cfg80211_validate_key_settings(rdev, wdev, &parse.p,
- parse.idx, false, NULL);
+ parse.idx,
+ NL80211_KEYTYPE_GROUP,
+ NULL);
if (err)
goto error;
if (parse.p.cipher != WLAN_CIPHER_SUITE_WEP40 &&
@@ -3615,6 +3624,11 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
NL80211_ATTR_EXT_MLD_CAPA_AND_OPS,
capab->ext_mld_capa_and_ops))
goto nla_put_failure;
+ if (capab->cip_supported &&
+ nla_put_u8(msg,
+ NL80211_ATTR_CIP_CAPABILITIES,
+ capab->cip_capabilities))
+ goto nla_put_failure;
nla_nest_end(msg, nested_ext_capab);
if (state->split)
@@ -5371,6 +5385,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
struct wireless_dev *wdev = info->user_ptr[1];
u8 key_idx = 0;
const u8 *mac_addr = NULL;
+ enum nl80211_key_type type;
bool pairwise;
struct get_key_cookie cookie = {
.error = 0,
@@ -5403,19 +5418,24 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]);
pairwise = !!mac_addr;
+ type = pairwise ? NL80211_KEYTYPE_PAIRWISE : NL80211_KEYTYPE_GROUP;
if (info->attrs[NL80211_ATTR_KEY_TYPE]) {
- u32 kt = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]);
+ type = nla_get_u32(info->attrs[NL80211_ATTR_KEY_TYPE]);
- if (kt != NL80211_KEYTYPE_GROUP &&
- kt != NL80211_KEYTYPE_PAIRWISE)
+ if (type != NL80211_KEYTYPE_GROUP &&
+ type != NL80211_KEYTYPE_PAIRWISE &&
+ type != NL80211_KEYTYPE_CIGTK) {
+ GENL_SET_ERR_MSG(info, "key type not pairwise, group or CIGTK");
return -EINVAL;
- pairwise = kt == NL80211_KEYTYPE_PAIRWISE;
+ }
+
+ pairwise = type == NL80211_KEYTYPE_PAIRWISE;
}
if (!rdev->ops->get_key)
return -EOPNOTSUPP;
- if (!cfg80211_valid_key_idx(wdev, key_idx, pairwise, mac_addr))
+ if (!cfg80211_valid_key_idx(wdev, key_idx, type, mac_addr))
return -ENOENT;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
@@ -5444,7 +5464,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
if (err)
goto free_msg;
- err = rdev_get_key(rdev, wdev, link_id, key_idx, pairwise, mac_addr,
+ err = rdev_get_key(rdev, wdev, link_id, key_idx, type, mac_addr,
&cookie, get_key_callback);
if (err)
@@ -5603,8 +5623,9 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
/* for now */
if (key.type != NL80211_KEYTYPE_PAIRWISE &&
- key.type != NL80211_KEYTYPE_GROUP) {
- GENL_SET_ERR_MSG(info, "key type not pairwise or group");
+ key.type != NL80211_KEYTYPE_GROUP &&
+ key.type != NL80211_KEYTYPE_CIGTK) {
+ GENL_SET_ERR_MSG(info, "key type not pairwise, group or CIGTK");
return -EINVAL;
}
@@ -5616,8 +5637,7 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
return -EOPNOTSUPP;
if (cfg80211_validate_key_settings(rdev, wdev, &key.p, key.idx,
- key.type == NL80211_KEYTYPE_PAIRWISE,
- mac_addr)) {
+ key.type, mac_addr)) {
GENL_SET_ERR_MSG(info, "key setting validation failed");
return -EINVAL;
}
@@ -5631,8 +5651,7 @@ static int nl80211_new_key(struct sk_buff *skb, struct genl_info *info)
key.type == NL80211_KEYTYPE_PAIRWISE);
if (!err) {
- err = rdev_add_key(rdev, wdev, link_id, key.idx,
- key.type == NL80211_KEYTYPE_PAIRWISE,
+ err = rdev_add_key(rdev, wdev, link_id, key.idx, key.type,
mac_addr, &key.p);
if (err)
GENL_SET_ERR_MSG(info, "key addition failed");
@@ -5666,12 +5685,13 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
/* for now */
if (key.type != NL80211_KEYTYPE_PAIRWISE &&
- key.type != NL80211_KEYTYPE_GROUP)
+ key.type != NL80211_KEYTYPE_GROUP &&
+ key.type != NL80211_KEYTYPE_CIGTK) {
+ GENL_SET_ERR_MSG(info, "key type not pairwise, group or CIGTK");
return -EINVAL;
+ }
- if (!cfg80211_valid_key_idx(wdev, key.idx,
- key.type == NL80211_KEYTYPE_PAIRWISE,
- mac_addr))
+ if (!cfg80211_valid_key_idx(wdev, key.idx, key.type, mac_addr))
return -EINVAL;
if (!rdev->ops->del_key)
@@ -5685,8 +5705,7 @@ static int nl80211_del_key(struct sk_buff *skb, struct genl_info *info)
if (!err)
err = rdev_del_key(rdev, wdev, link_id, key.idx,
- key.type == NL80211_KEYTYPE_PAIRWISE,
- mac_addr);
+ key.type, mac_addr);
#ifdef CONFIG_CFG80211_WEXT
if (!err) {
@@ -8805,7 +8824,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
return -EINVAL;
/* When you run into this, adjust the code below for the new flag */
- BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8);
+ BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 9);
switch (statype) {
case CFG80211_STA_MESH_PEER_KERNEL:
@@ -8899,7 +8918,8 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) |
BIT(NL80211_STA_FLAG_WME) |
BIT(NL80211_STA_FLAG_MFP) |
- BIT(NL80211_STA_FLAG_SPP_AMSDU)))
+ BIT(NL80211_STA_FLAG_SPP_AMSDU) |
+ BIT(NL80211_STA_FLAG_CIP)))
return -EINVAL;
/* but authenticated/associated only if driver handles it */
@@ -9276,6 +9296,22 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
nla_get_u16(info->attrs[NL80211_ATTR_EML_CAPABILITY]);
}
+ if (params.sta_flags_mask & BIT(NL80211_STA_FLAG_CIP) &&
+ params.sta_flags_set & BIT(NL80211_STA_FLAG_CIP)) {
+ if (!cfg80211_cigtk_supported(wdev, info))
+ return -EINVAL;
+
+ /* CIP capabilities are required if CIP is being enabled */
+ if (info->attrs[NL80211_ATTR_CIP_CAPABILITIES]) {
+ params.link_sta_params.cip_cap_set = true;
+ params.link_sta_params.cip_cap =
+ nla_get_u8(info->attrs[NL80211_ATTR_CIP_CAPABILITIES]);
+ } else {
+ GENL_SET_ERR_MSG(info, "No CIP capabilities provided");
+ return -EINVAL;
+ }
+ }
+
if (info->attrs[NL80211_ATTR_AIRTIME_WEIGHT])
params.airtime_weight =
nla_get_u16(info->attrs[NL80211_ATTR_AIRTIME_WEIGHT]);
@@ -9475,6 +9511,22 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
nla_get_u16(info->attrs[NL80211_ATTR_EML_CAPABILITY]);
}
+ if (params.sta_flags_mask & BIT(NL80211_STA_FLAG_CIP) &&
+ params.sta_flags_set & BIT(NL80211_STA_FLAG_CIP)) {
+ if (!cfg80211_cigtk_supported(wdev, info))
+ return -EINVAL;
+
+ /* CIP capabilities are required if CIP is enabled */
+ if (info->attrs[NL80211_ATTR_CIP_CAPABILITIES]) {
+ params.link_sta_params.cip_cap_set = true;
+ params.link_sta_params.cip_cap =
+ nla_get_u8(info->attrs[NL80211_ATTR_CIP_CAPABILITIES]);
+ } else {
+ GENL_SET_ERR_MSG(info, "No CIP capabilities provided");
+ return -EINVAL;
+ }
+ }
+
if (info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY])
params.link_sta_params.he_6ghz_capa =
nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]);
@@ -9552,7 +9604,7 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
return -EINVAL;
/* When you run into this, adjust the code below for the new flag */
- BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 8);
+ BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 9);
switch (wdev->iftype) {
case NL80211_IFTYPE_AP:
@@ -9581,6 +9633,10 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
params.sta_flags_mask & BIT(NL80211_STA_FLAG_SPP_AMSDU))
return -EINVAL;
+ if (params.sta_flags_mask & BIT(NL80211_STA_FLAG_CIP) &&
+ !cfg80211_cigtk_supported(wdev, info))
+ return -EINVAL;
+
/* Older userspace, or userspace wanting to be compatible with
* !NL80211_FEATURE_FULL_AP_CLIENT_STATE, will not set the auth
* and assoc flags in the mask, but assumes the station will be
@@ -13307,6 +13363,13 @@ static int nl80211_associate(struct sk_buff *skb, struct genl_info *info)
req.flags |= ASSOC_REQ_SPP_AMSDU;
}
+ if (nla_get_flag(info->attrs[NL80211_ATTR_ASSOC_CIP])) {
+ if (!cfg80211_cigtk_supported(dev->ieee80211_ptr, info))
+ return -EINVAL;
+
+ req.flags |= ASSOC_REQ_CIP;
+ }
+
req.link_id = nl80211_link_id_or_invalid(info->attrs);
if (info->attrs[NL80211_ATTR_MLO_LINKS]) {
@@ -19174,6 +19237,23 @@ nl80211_add_mod_link_station(struct sk_buff *skb, struct genl_info *info,
params.he_6ghz_capa =
nla_data(info->attrs[NL80211_ATTR_HE_6GHZ_CAPABILITY]);
+ if (info->attrs[NL80211_ATTR_CIP_CAPABILITIES]) {
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ if (!cfg80211_cigtk_supported(wdev, info))
+ return -EINVAL;
+
+ params.cip_cap_set = true;
+ params.cip_cap =
+ nla_get_u8(info->attrs[NL80211_ATTR_CIP_CAPABILITIES]);
+
+ /* Only permit CIP capabilities when adding link stations */
+ if (!add) {
+ GENL_SET_ERR_MSG(info, "Cannot modify CIP capabilities");
+ return -EINVAL;
+ }
+ }
+
if (info->attrs[NL80211_ATTR_OPMODE_NOTIF]) {
params.opmode_notif_used = true;
params.opmode_notif =
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 6c3bad8b2d6f6..d4933bbbf0e7e 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -78,42 +78,43 @@ rdev_change_virtual_intf(struct cfg80211_registered_device *rdev,
static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr,
- struct key_params *params)
+ u8 key_index, enum nl80211_key_type type,
+ const u8 *mac_addr, struct key_params *params)
{
int ret;
- trace_rdev_add_key(&rdev->wiphy, wdev, link_id, key_index, pairwise,
+ trace_rdev_add_key(&rdev->wiphy, wdev, link_id, key_index, type,
mac_addr, params->mode);
ret = rdev->ops->add_key(&rdev->wiphy, wdev, link_id, key_index,
- pairwise, mac_addr, params);
+ type, mac_addr, params);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
static inline int
rdev_get_key(struct cfg80211_registered_device *rdev, struct wireless_dev *wdev,
- int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
- void *cookie,
+ int link_id, u8 key_index, enum nl80211_key_type type,
+ const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie, struct key_params*))
{
int ret;
- trace_rdev_get_key(&rdev->wiphy, wdev, link_id, key_index, pairwise,
+ trace_rdev_get_key(&rdev->wiphy, wdev, link_id, key_index, type,
mac_addr);
ret = rdev->ops->get_key(&rdev->wiphy, wdev, link_id, key_index,
- pairwise, mac_addr, cookie, callback);
+ type, mac_addr, cookie, callback);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr)
+ u8 key_index, enum nl80211_key_type type,
+ const u8 *mac_addr)
{
int ret;
- trace_rdev_del_key(&rdev->wiphy, wdev, link_id, key_index, pairwise,
+ trace_rdev_del_key(&rdev->wiphy, wdev, link_id, key_index, type,
mac_addr);
ret = rdev->ops->del_key(&rdev->wiphy, wdev, link_id, key_index,
- pairwise, mac_addr);
+ type, mac_addr);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 2a719b5c487e3..458f72d8351ab 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -1387,7 +1387,15 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT))
max_key_idx = 7;
for (i = 0; i <= max_key_idx; i++)
- rdev_del_key(rdev, wdev, -1, i, false, NULL);
+ rdev_del_key(rdev, wdev, -1, i, NL80211_KEYTYPE_GROUP,
+ NULL);
+
+ if (cfg80211_cigtk_supported(wdev, NULL)) {
+ rdev_del_key(rdev, wdev, -1, 0, NL80211_KEYTYPE_CIGTK,
+ NULL);
+ rdev_del_key(rdev, wdev, -1, 1, NL80211_KEYTYPE_CIGTK,
+ NULL);
+ }
}
rdev_set_qos_map(rdev, dev, NULL);
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 8c2a91b85c396..c210ca1e44e2b 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -557,15 +557,15 @@ TRACE_EVENT(rdev_change_virtual_intf,
DECLARE_EVENT_CLASS(key_handle,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr),
- TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr),
+ u8 key_index, enum nl80211_key_type type, const u8 *mac_addr),
+ TP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr),
TP_STRUCT__entry(
WIPHY_ENTRY
WDEV_ENTRY
MAC_ENTRY(mac_addr)
__field(int, link_id)
__field(u8, key_index)
- __field(bool, pairwise)
+ __field(u8, type)
),
TP_fast_assign(
WIPHY_ASSIGN;
@@ -573,38 +573,40 @@ DECLARE_EVENT_CLASS(key_handle,
MAC_ASSIGN(mac_addr, mac_addr);
__entry->link_id = link_id;
__entry->key_index = key_index;
- __entry->pairwise = pairwise;
+ __entry->type = type;
),
TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, "
- "key_index: %u, pairwise: %s, mac addr: %pM",
+ "key_index: %u, pairwise: %s, type: %d, mac addr: %pM",
WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id,
- __entry->key_index, BOOL_TO_STR(__entry->pairwise),
- __entry->mac_addr)
+ __entry->key_index,
+ BOOL_TO_STR(__entry->type == NL80211_KEYTYPE_PAIRWISE),
+ __entry->type, __entry->mac_addr)
);
DEFINE_EVENT(key_handle, rdev_get_key,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr),
- TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr)
+ u8 key_index, enum nl80211_key_type type, const u8 *mac_addr),
+ TP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr)
);
DEFINE_EVENT(key_handle, rdev_del_key,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr),
- TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr)
+ u8 key_index, enum nl80211_key_type type, const u8 *mac_addr),
+ TP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr)
);
TRACE_EVENT(rdev_add_key,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
- u8 key_index, bool pairwise, const u8 *mac_addr, u8 mode),
- TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr, mode),
+ u8 key_index, enum nl80211_key_type type, const u8 *mac_addr,
+ u8 mode),
+ TP_ARGS(wiphy, wdev, link_id, key_index, type, mac_addr, mode),
TP_STRUCT__entry(
WIPHY_ENTRY
WDEV_ENTRY
MAC_ENTRY(mac_addr)
__field(int, link_id)
__field(u8, key_index)
- __field(bool, pairwise)
+ __field(u8, type)
__field(u8, mode)
),
TP_fast_assign(
@@ -613,15 +615,16 @@ TRACE_EVENT(rdev_add_key,
MAC_ASSIGN(mac_addr, mac_addr);
__entry->link_id = link_id;
__entry->key_index = key_index;
- __entry->pairwise = pairwise;
+ __entry->type = type;
__entry->mode = mode;
),
TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, "
- "key_index: %u, mode: %u, pairwise: %s, "
+ "key_index: %u, mode: %u, pairwise: %s, type: %d, "
"mac addr: %pM",
WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id,
__entry->key_index, __entry->mode,
- BOOL_TO_STR(__entry->pairwise), __entry->mac_addr)
+ BOOL_TO_STR(__entry->type == NL80211_KEYTYPE_PAIRWISE),
+ __entry->type, __entry->mac_addr)
);
TRACE_EVENT(rdev_set_default_key,
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 3e584d0ca3e26..dd166c352910f 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -258,8 +258,24 @@ static bool cfg80211_igtk_cipher_supported(struct wiphy *wiphy)
return false;
}
+bool cfg80211_cigtk_supported(struct wireless_dev *wdev,
+ struct genl_info *info)
+{
+ const struct wiphy_iftype_ext_capab *ext_capab =
+ cfg80211_get_iftype_ext_capa(wdev->wiphy, wdev->iftype);
+
+ if (ext_capab && ext_capab->cip_supported)
+ return true;
+
+ if (info)
+ GENL_SET_ERR_MSG(info,
+ "Control Integrity Protocol not supported");
+
+ return false;
+}
+
bool cfg80211_valid_key_idx(struct wireless_dev *wdev,
- int key_idx, bool pairwise,
+ int key_idx, enum nl80211_key_type type,
const u8 *mac_addr)
{
if (WARN_ON(!wdev))
@@ -272,13 +288,24 @@ bool cfg80211_valid_key_idx(struct wireless_dev *wdev,
* Can't differentiate ciphers here so allow 0..3.
* Pairwise keys must be for a station (MAC address given).
*/
- if (pairwise) {
+ if (type == NL80211_KEYTYPE_PAIRWISE) {
if (!mac_addr)
return false;
return key_idx < 4;
}
+ /* Check the wdev/iftype supports CIGTK */
+ if (type == NL80211_KEYTYPE_CIGTK) {
+ if (!cfg80211_cigtk_supported(wdev, NULL))
+ return false;
+
+ if (key_idx >= 2)
+ return false;
+
+ /* fallthrough for mac_addr checks */
+ }
+
/*
* For group keys, mac_addr==NULL means setting a group key
* for TX, which is only supported on some interface types,
@@ -343,9 +370,12 @@ bool cfg80211_valid_key_idx(struct wireless_dev *wdev,
int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
struct key_params *params, int key_idx,
- bool pairwise, const u8 *mac_addr)
+ enum nl80211_key_type type,
+ const u8 *mac_addr)
{
- if (!cfg80211_valid_key_idx(wdev, key_idx, pairwise, mac_addr))
+ bool pairwise = type == NL80211_KEYTYPE_PAIRWISE;
+
+ if (!cfg80211_valid_key_idx(wdev, key_idx, type, mac_addr))
return -EINVAL;
switch (params->cipher) {
@@ -1172,7 +1202,7 @@ void cfg80211_upload_connect_keys(struct wireless_dev *wdev)
for (i = 0; i < 4; i++) {
if (!wdev->connect_keys->params[i].cipher)
continue;
- if (rdev_add_key(rdev, wdev, -1, i, false, NULL,
+ if (rdev_add_key(rdev, wdev, -1, i, NL80211_KEYTYPE_GROUP, NULL,
&wdev->connect_keys->params[i])) {
netdev_err(dev, "failed to set key %d\n", i);
continue;
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index d45bc08c0de49..ec2389f6b8b18 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -401,6 +401,8 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev,
int idx, struct key_params *params)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ enum nl80211_key_type key_type =
+ pairwise ? NL80211_KEYTYPE_PAIRWISE : NL80211_KEYTYPE_GROUP;
int err, i;
bool rejoin = false;
@@ -454,11 +456,11 @@ static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev,
rejoin = true;
}
- if (!cfg80211_valid_key_idx(wdev, idx, pairwise, addr))
+ if (!cfg80211_valid_key_idx(wdev, idx, key_type, addr))
err = -ENOENT;
else
- err = rdev_del_key(rdev, wdev, -1, idx, pairwise,
- addr);
+ err = rdev_del_key(rdev, wdev, -1, idx,
+ key_type, addr);
}
wdev->wext.connect.privacy = false;
/*
|
| 3/2 | 2026/08/01 20:02 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 32246 output: 336 thoughts: 2707 Thoughts: **CIP Support in mac80211 and cfg80211: Fuzzing Target Identification** Alright, let's break this down. This patch is definitely adding significant new functionality for Control Integrity Protocol (CIP) support within the wireless stack. I see the addition of `NL80211_KEYTYPE_CIGTK`, and modifications to `cfg80211_ops` to accommodate the new CIP key type, which naturally alters the `add_key`, `get_key`, and `del_key` operations. I'm also noticing new netlink attributes (`NL80211_ATTR_ASSOC_CIP`, `NL80211_ATTR_CIP_CAPABILITIES`, `NL80211_STA_FLAG_CIP`) and modifications within `mac80211` itself to process CIP keys, including the introduction of `IEEE80211_KEY_FLAG_CIP`, and handling the `cigtk` array. A key indicator for fuzzing is the integration of CIP support into `mac80211_hwsim`. The patch explicitly enables `mac80211_hwsim` to test this feature. This means I have a readily available environment to validate and explore the implementation. The changes in `nl80211.c` to handle the new attributes and key types, and the adjustments in `mac80211` to parse `WLAN_EID_EXT_CIP_CAPA` are good indications of areas that warrant attention. So, given these functional changes, this patch is absolutely worth fuzzing. My primary focus points for fuzzing would be the netlink entry points, these are the exposed entry points. Specifically, I'm thinking about: * `nl80211_new_key` * `nl80211_del_key` * `nl80211_get_key` * `nl80211_set_station` * `nl80211_new_station` * `nl80211_associate` The kernel-internal entry points that would also be interesting include: * `ieee80211_key_link` * `ieee80211_gtk_rekey_add` * `ieee80211_put_cip_cap` * `cfg80211_cigtk_supported` * `cfg80211_valid_key_idx` * `cfg80211_validate_key_settings` In terms of configuration, I'll need to make sure I have `CONFIG_CFG80211`, `CONFIG_MAC80211` and `CONFIG_MAC80211_HWSIM` enabled, which are standard for wireless testing and fuzzing. The changes in `mac80211_hwsim_iftypes_ext_capa` to add `cip_supported = true` makes it perfect for local testing of this new functionality, so that will make validation a lot easier. All of this should be doable, and it looks like a good target. |
| 4/2 | 2026/08/01 20:02 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"MAC80211",
"CFG80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_new_key",
"nl80211_del_key",
"nl80211_get_key",
"nl80211_set_station",
"nl80211_new_station",
"nl80211_associate",
"ieee80211_key_link",
"ieee80211_gtk_rekey_add",
"ieee80211_put_cip_cap",
"cfg80211_cigtk_supported",
"cfg80211_valid_key_idx",
"cfg80211_validate_key_settings"
],
"Reasoning": "The patch introduces support for the Control Integrity Protocol (CIP) in cfg80211 and mac80211, including a new key type `NL80211_KEYTYPE_CIGTK` and new netlink attributes. It modifies key handling logic across the wireless stack and updates `mac80211_hwsim` to advertise CIP support, making it testable in virtualized environments. The changes are functional and reachable via standard nl80211 netlink commands.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"MAC80211",
"CFG80211",
"MAC80211_HWSIM"
],
"FocusSymbols": [
"nl80211_new_key",
"nl80211_del_key",
"nl80211_get_key",
"nl80211_set_station",
"nl80211_new_station",
"nl80211_associate",
"ieee80211_key_link",
"ieee80211_gtk_rekey_add",
"ieee80211_put_cip_cap",
"cfg80211_cigtk_supported",
"cfg80211_valid_key_idx",
"cfg80211_validate_key_settings"
],
"Reasoning": "The patch introduces support for the Control Integrity Protocol (CIP) in cfg80211 and mac80211, including a new key type `NL80211_KEYTYPE_CIGTK` and new netlink attributes. It modifies key handling logic across the wireless stack and updates `mac80211_hwsim` to advertise CIP support, making it testable in virtualized environments. The changes are functional and reachable via standard nl80211 netlink commands.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|