From mboxrd@z Thu Jan 1 00:00:00 1970 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 B589C1991D2; Tue, 15 Jul 2025 13:20:35 +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=1752585635; cv=none; b=huwpQ/ASELJoo8PdkT3OwBYZGvm4yiG0bxGWuPpuA2Ax3sxA2NMoPiggVK6lj97fGkQdeO1/aXpbG5Xo4Q+xo/YD/SVt7bVslViQlMrgh5CU019uDE9yOmms/a05JnqDiqzTMPs0Sqkt04EJEVWWfe/OqYOruSh2Uk0hClSm8j0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752585635; c=relaxed/simple; bh=+oEWqwAe6PbZOfPklL2YDtBDD40OWX3+FquU54xyzVw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WyOrxEig5Bb+1dwVgiW/vDtURp4IzEG22KbgIw8RtiuYKWSH7rrK7c3elNNDyB8/rRV3Sqr62jFMm2RnHNRbnG6ZaaaW5gfGeSRwfxM/oA4Hxmwv5gfXG4XGSy6qtDsn1D52FpP+r/0bi3aaDksja/I+gCN1zys19EwFJyvVpdY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=m3zyyDLx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="m3zyyDLx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48AF7C4CEE3; Tue, 15 Jul 2025 13:20:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752585635; bh=+oEWqwAe6PbZOfPklL2YDtBDD40OWX3+FquU54xyzVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3zyyDLxy+/8nxSf/K8iNbCbkULa0pUqii5zdGobcgNjxQdgdzIuKSiShAjAnO5bV hUUYO9h5HqC5c9ba2QzaE3UHxQNKisWrh2X11oy0HGqBHlP+7Y8x0k0Xbxk8qUZYv1 Nb8ZUij4hPMkCtRVJDjStSJzA1RtmhWsUFO0DQdQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michael-CY Lee , Johannes Berg , Sasha Levin Subject: [PATCH 6.12 113/163] wifi: mac80211: fix non-transmitted BSSID profile search Date: Tue, 15 Jul 2025 15:13:01 +0200 Message-ID: <20250715130813.386188487@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250715130808.777350091@linuxfoundation.org> References: <20250715130808.777350091@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg [ Upstream commit e1e6ebf490e55fee1ae573aa443c1d4aea5e4a40 ] When the non-transmitted BSSID profile is found, immediately return from the search to not return the wrong profile_len when the profile is found in a multiple BSSID element that isn't the last one in the frame. Fixes: 5023b14cf4df ("mac80211: support profile split between elements") Reported-by: Michael-CY Lee Link: https://patch.msgid.link/20250630154501.f26cd45a0ecd.I28e0525d06e8a99e555707301bca29265cf20dc8@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/parse.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/mac80211/parse.c b/net/mac80211/parse.c index 6da39c864f45b..922ea9a6e2412 100644 --- a/net/mac80211/parse.c +++ b/net/mac80211/parse.c @@ -758,7 +758,6 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, { const struct element *elem, *sub; size_t profile_len = 0; - bool found = false; if (!bss || !bss->transmitted_bss) return profile_len; @@ -809,15 +808,14 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, index[2], new_bssid); if (ether_addr_equal(new_bssid, bss->bssid)) { - found = true; elems->bssid_index_len = index[1]; elems->bssid_index = (void *)&index[2]; - break; + return profile_len; } } } - return found ? profile_len : 0; + return 0; } static void -- 2.39.5