Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2376302lqp; Sun, 24 Mar 2024 16:36:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8OyTUs/6IXS4SXUoOcXDvWbyDPwMYeHXf3Oak26/4IPwPK2Q7m1M8NmmGcikZcTknOWbzVp+xXqB30QlPEOvhpkrhXgb5772/SZHa2w== X-Google-Smtp-Source: AGHT+IFE3doSkaGy+pwtSrJtB6oSzhJGiEIYHAMUk3U/oS7FTMv6mnm0JpWVIlhiYRD3/rVAQbEn X-Received: by 2002:a05:6a20:daa0:b0:1a3:6a4f:d229 with SMTP id iy32-20020a056a20daa000b001a36a4fd229mr7328679pzb.25.1711323391880; Sun, 24 Mar 2024 16:36:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711323391; cv=pass; d=google.com; s=arc-20160816; b=Io/jY6plIwiw57eYro09BeehYMI4an/IPnX+OLjpqe6ttpOlf4fLdIYi7LBe2QlIYq Nns85g4jobV/5yImDbo/YH6q/r2QiXgq6EDaz38oSKvzljcPykzujHO10LxXKV0f33On gGlunzM9jlPeoDOEW7u3qTgJqGae25EAxxbOUMFerCoWX7UPhNuN8sb7suchh6EOKGj0 CBfTlujSrA6HHRKO0epjeBcNEcYMl9c7/nGEWaKRUXSQmXGC5FaAzwNDzEnZVXlRc6lH 7/6Qjs10WKCsxUqIWZ1A0Fi8GiXMooXNeu9Pxb4B8kqBPkiiPoEQ2s02hSySDhXRQOTN Tu5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=M7ZjRabj7OUuUeLbw8YW2SoGoxz7QtAFjITBsGjZFzo=; fh=P7SdR0BiXeXbfoPmYv588Dhwuyf3LaK2TMPEvRmTm9w=; b=uuJY7LMloCNFAfD8I8CTRA/d89bYl6aYJc7wsifatfFZI3zoI6JWN3H1hmMc3nGeM+ 1kQo3RICoqjKOXWfgTwLLcuRiwEdr4b0NP0yfY6r0xRye5o518JAaH676mfbbBYZMa9/ 1N7jo4qiWSaoPk3GbykAyu8mzUPvrfFnoXMQxb/ectvJWHcUKY8u3F5R8GVF67ge0J57 NLL7sTgFeEhyfoPzV+If0TXQxEw2XAC/83jffA16hta82YsCNdC+6s/YhWx4hD5qBjH5 T6Vxu2G/bhF/JJ7OZ0azJHNzWoBTK0/MjIRK9ImUZJrXk8gz9wK2z7Vf7nrv+H29o526 bGrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MNi9Duwq; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-113113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c9-20020a62e809000000b006e6c14cc86bsi4031865pfi.298.2024.03.24.16.36.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MNi9Duwq; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-113113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 25B0CB231A1 for ; Sun, 24 Mar 2024 23:24:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E465615A489; Sun, 24 Mar 2024 22:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MNi9Duwq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E674415958B; Sun, 24 Mar 2024 22:38:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319921; cv=none; b=QJfBwRezDC1SrRnxoONPgOhIg3J2cSlc2EgtwxTpFw6bdAC2dfFwhzJE8xHyzXWrqWqGirS6Y+EUM9EimqjbzltTNVBrEbXGETemUMEeGtLsTHABxF4A1Wr3tSAggJUd6ZE+cBvRBG9ugC8M0wwgZ0GblAQUWNXctcYcJe1MoLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319921; c=relaxed/simple; bh=DrXP0gs68dleLeX1kuokUh6LqmywretmDJba3cfde2w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qGtqGrhKaBPBQgactq52GCvGP4yJk7ZoutTty0dI6ykGd2bVAWXftiPjco+lJle1LUAbKXEdd4Q8qBldwsUbgPsSd8LDJfYq5l2uGC4Z/WKDT/2CLMVhV0rFz+Q4Ldae9X6t3DfIOFe0ZSAuXNc8za7r2d2n0UDGaOz1Ly0sPGQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=fail (0-bit key) header.d=kernel.org header.i=@kernel.org header.b=MNi9Duwq reason="key not found in DNS"; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A72FC43399; Sun, 24 Mar 2024 22:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319920; bh=DrXP0gs68dleLeX1kuokUh6LqmywretmDJba3cfde2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MNi9DuwqzQXb9Q8+sd33F7xjwxxha+BhOqzEfGKp6/HGPR3rk5gxW48deIbKRDJqn v/9vH+YOYaeRTnIV7OHg5DCIp4XF2g6CPHlKNZ5KgosqhV/DJoFqp+O2Vsu3f8EzGq TP/2LDVhMAe69hY5fHfLz+W42t/9//VT2eVLkXET+nxmmg3JwR6dpH1VESxOGCR3qZ v9nlN5w6sxWRyGpsiP9fqsiueioao5grA+bc5ESS39PfsBIauYQ5LdyOVyr1rHYhYR qwocEZH3cSmPsEdRZdp+Lanxnq6TKzReSIMdqM+bFQdxgXFBdBzZkuJJhGZo3SnlIo 863VUQmgq1FgQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Benjamin Berg , Johannes Berg , Miri Korenblit , Sasha Levin Subject: [PATCH 6.8 226/715] wifi: cfg80211: set correct param change count in ML element Date: Sun, 24 Mar 2024 18:26:45 -0400 Message-ID: <20240324223455.1342824-227-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Benjamin Berg [ Upstream commit f8599d634094b1257054a8d0815785d658cbdb74 ] The ML element generation code to create a BSS entry from a per-STA profile was not overwriting the BSS parameter change count. This meant that the incorrect parameter change count would be reported within the multi-link element. Fix this by returning the BSS parameter change count from the function and placing it into the ML element. The returned tbtt info was never used, so just drop that to simplify the code. Fixes: 5f478adf1f99 ("wifi: cfg80211: generate an ML element for per-STA profiles") Signed-off-by: Benjamin Berg Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://msgid.link/20240216135047.f2a507634692.I06b122c7a319a38b4e970f5e0bd3d3ef9cac4cbe@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/scan.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 7c9dc52ed783e..f138f88be9048 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2602,9 +2602,9 @@ cfg80211_defrag_mle(const struct element *mle, const u8 *ie, size_t ielen, } static u8 -cfg80211_tbtt_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id, - const struct ieee80211_neighbor_ap_info **ap_info, - const u8 **tbtt_info) +cfg80211_rnr_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id, + const struct ieee80211_neighbor_ap_info **ap_info, + u8 *param_ch_count) { const struct ieee80211_neighbor_ap_info *info; const struct element *rnr; @@ -2661,7 +2661,9 @@ cfg80211_tbtt_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id, if (mld_id == mld_params->mld_id && link_id == lid) { *ap_info = info; - *tbtt_info = pos; + *param_ch_count = + le16_get_bits(mld_params->params, + IEEE80211_RNR_MLD_PARAMS_BSS_CHANGE_COUNT); return use_for; } @@ -2871,8 +2873,8 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, enum nl80211_band band; u32 freq; const u8 *profile; - const u8 *tbtt_info; ssize_t profile_len; + u8 param_ch_count; u8 link_id, use_for; if (!ieee80211_mle_basic_sta_prof_size_ok((u8 *)mle->sta_prof[i], @@ -2915,10 +2917,11 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, profile_len -= 2; /* Find in RNR to look up channel information */ - use_for = cfg80211_tbtt_info_for_mld_ap(tx_data->ie, - tx_data->ielen, - mld_id, link_id, - &ap_info, &tbtt_info); + use_for = cfg80211_rnr_info_for_mld_ap(tx_data->ie, + tx_data->ielen, + mld_id, link_id, + &ap_info, + ¶m_ch_count); if (!use_for) continue; @@ -2961,7 +2964,8 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, continue; /* Copy the Basic Multi-Link element including the common - * information, and then fix up the link ID. + * information, and then fix up the link ID and BSS param + * change count. * Note that the ML element length has been verified and we * also checked that it contains the link ID. */ @@ -2972,6 +2976,8 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, sizeof(*ml_elem) + ml_common_len); new_ie[data.ielen + sizeof(*ml_elem) + 1 + ETH_ALEN] = link_id; + new_ie[data.ielen + sizeof(*ml_elem) + 1 + ETH_ALEN + 1] = + param_ch_count; data.ielen += sizeof(*ml_elem) + ml_common_len; -- 2.43.0