From patchwork Thu Mar 28 18:16:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1917534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=c2xFuQ0u; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=ApH60DIA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V5Bbp4HyKz1yYR for ; Fri, 29 Mar 2024 05:17:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oQSzZ8BzQdNvB8pBU4vfOzbvARqvpEvO83zA0iA50IM=; b=c2xFuQ0uBcRvaP SfFFUalvc3IGjoUevnSqUa/mUkOJZmzFcdX0DRxRanNruBeWPsKfu3vPh2nGqEul5nu6Ec1jx4Vv4 Bg7xt+R+i/STUVCczTwZcT032DmgCO9XLaihfzrTjra/W0l8FafFzwgRKuiMOiDH6HMLBooh4wMXn oKkP5FGzF62pwD0aVYxd6I5sTY/bqbfkIxCg8M983WGwTCnPiDgvRB0rr0zuN+jQgnDrdBcXWvCmK iTlDBqE4wri7os3dYPSI1xYugLSjHFtB18XHLbt8lUUkeH9vOBKfyntLB7elkz43A/sjvwi6TUQy4 A/38amQiQIVkCxtnO6aw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpuJj-0000000F72q-2ktS; Thu, 28 Mar 2024 18:17:35 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpuJe-0000000F6zh-0E4F for hostap@lists.infradead.org; Thu, 28 Mar 2024 18:17:31 +0000 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42SIB1Fr011673 for ; Thu, 28 Mar 2024 18:17:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=mE762DKZQ2asuXypkBQVMnAZXTxZ3GTjVfXFURj8zUk=; b=Ap H60DIAR+x7wdI58HHSEGJ8qGu8LdYxd8l/Zhuem9QSvp4Ii8/4UY0L+XFIihYFs5 tVjT+f+YmGzRg+CFgKjm8Xue/nRzHxeeFy/027s/LbcHnEbT4B2/ZhlpBhpPcR90 ixd9JA9bm+FXSx5AvhhMjp8LV5nw5/d+qlunLXLLYT+hSOsyl1j/u5e7trKwVBGH Ic41EnT1g75K6VV7nf5KPMzwSplmj7dTzEU5X9JggAOMVCXMoJPsVgnvWy72zWwD YzuGUNwmlhg3RBDWnz9n5SEXGC/5r3i5Fym0A1rZG511Vp43DnWokpA+5hDDfCOX 9FGBg2aFzglRoa8FKgEw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x5580squ2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 28 Mar 2024 18:17:29 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42SIHSqi011327 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 28 Mar 2024 18:17:28 GMT Received: from hu-adisi-blr.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 28 Mar 2024 11:17:26 -0700 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 06/22] hostapd: MLO: reset auth state machine's ML info Date: Thu, 28 Mar 2024 23:46:36 +0530 Message-ID: <20240328181652.2956122-7-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240328181652.2956122-1-quic_adisi@quicinc.com> References: <20240328181652.2956122-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: DdVmJTEmlVWV2emNzlTVmoT17d95IHx3 X-Proofpoint-ORIG-GUID: DdVmJTEmlVWV2emNzlTVmoT17d95IHx3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-28_17,2024-03-28_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 spamscore=0 bulkscore=0 mlxscore=0 suspectscore=0 clxscore=1015 malwarescore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403280128 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_111730_262730_DDEF12A6 X-CRM114-Status: GOOD ( 17.01 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently auth state machine ML info is set only when the it is created newly. However, if the association is tried again, the state machine will exist already and hence the ML info will not be refres [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently auth state machine ML info is set only when the it is created newly. However, if the association is tried again, the state machine will exist already and hence the ML info will not be refreshed. This leads to an issue where if in the subsequent association request, the MLD info is different than old info then validation of it will fail. Fix this issue by refreshing the auth state machine's ML info every time association request is handled. Signed-off-by: Aditya Kumar Singh --- src/ap/ieee802_11.c | 32 ++++++++++++++++++-------------- src/ap/wpa_auth.c | 1 + 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index b20300bab813..98398ccdd693 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -4032,15 +4032,15 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta, if (hapd->conf->wpa && wpa_ie) { enum wpa_validate_result res; +#ifdef CONFIG_IEEE80211BE + struct mld_info *info = &sta->mld_info; + bool init = false; +#endif /* CONFIG_IEEE80211BE */ wpa_ie -= 2; wpa_ie_len += 2; if (!sta->wpa_sm) { -#ifdef CONFIG_IEEE80211BE - struct mld_info *info = &sta->mld_info; -#endif /* CONFIG_IEEE80211BE */ - sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, sta->addr, p2p_dev_addr); @@ -4050,19 +4050,23 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta, "Failed to initialize RSN state machine"); return WLAN_STATUS_UNSPECIFIED_FAILURE; } - #ifdef CONFIG_IEEE80211BE - if (ap_sta_is_mld(hapd, sta)) { - wpa_printf(MSG_DEBUG, - "MLD: Set ML info in RSN Authenticator"); - wpa_auth_set_ml_info(sta->wpa_sm, - hapd->mld->mld_addr, - sta->mld_assoc_link_id, - info); - } -#endif /* CONFIG_IEEE80211BE */ + init = true; } + if (ap_sta_is_mld(hapd, sta)) { + wpa_printf(MSG_DEBUG, + "MLD: %s ML info in RSN Authenticator", + init ? "Set" : "Reset"); + wpa_auth_set_ml_info(sta->wpa_sm, + hapd->mld->mld_addr, + sta->mld_assoc_link_id, + info); + } +#else + } +#endif /* CONFIG_IEEE80211BE */ + wpa_auth_set_auth_alg(sta->wpa_sm, sta->auth_alg); res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm, hapd->iface->freq, diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c index 01a10b23ce6c..0d15c42099dc 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c @@ -6820,6 +6820,7 @@ void wpa_auth_set_ml_info(struct wpa_state_machine *sm, const u8 *mld_addr, return; os_memset(sm->mld_links, 0, sizeof(sm->mld_links)); + sm->n_mld_affiliated_links = 0; wpa_auth_logger(sm->wpa_auth, wpa_auth_get_spa(sm), LOGGER_DEBUG, "MLD: Initialization");