From: Kavita Kavita Date: Mon, 4 May 2026 12:36:24 +0000 (+0530) Subject: wifi: mac80211: set assoc_encrypted for EPP associations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2ae5b19ac56afb00ca40b4a1768d7fe182f18c8;p=thirdparty%2Flinux.git wifi: mac80211: set assoc_encrypted for EPP associations Populate the assoc_encrypted field in cfg80211_rx_assoc_resp_data for mac80211-based drivers to indicate that the entire (re)association exchange was encrypted. When epp_peer is set, mac80211 enforces that unprotected (Re)Association Request/Response frames are dropped. This ensures that by the time the (Re)Association Response is processed, the entire exchange was transmitted encrypted over the air. Add support to populate assoc_encrypted based on epp_peer flag. Signed-off-by: Kavita Kavita Link: https://patch.msgid.link/20260504123624.529218-3-kavita.kavita@oss.qualcomm.com Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 00b4beff0e43..a1246af09dc5 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -6652,6 +6652,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, .type = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_TYPE, }; struct ieee802_11_elems *elems; + struct sta_info *sta; int ac; const u8 *elem_start; unsigned int elem_len; @@ -6847,6 +6848,14 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, resp.ap_mld_addr = ap_mld_addr; } + /* + * If epp_peer set, unprotected (Re)Association Request/Response frames + * are dropped, which ensures that the (re)association exchange is + * encrypted over the air. + */ + sta = sta_info_get_bss(sdata, sdata->vif.cfg.ap_addr); + resp.assoc_encrypted = sta && sta->sta.epp_peer; + ieee80211_destroy_assoc_data(sdata, status_code == WLAN_STATUS_SUCCESS ? ASSOC_SUCCESS :