From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 3037D2F1FEF; Thu, 28 May 2026 20:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780001241; cv=none; b=SVhlWblBD+luRZchs4/8BqT9kp5CHDyUZEQfcjSGrT8tvGqrz2ZHUuWkjKNc0IC+cUOQJtnHMhdo0wQLHdkSa5Bt+k/W+i3OEfcNbzr4X+4Ayw4ZANcjYhoUGgXZbgnoLF8J+QRxqCrpx8XDbKh2B47eyG0Cs/3Vyj+1ARtOy7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780001241; c=relaxed/simple; bh=LSeEvYmCEt/IBm91JRxb6NR/UGr/NCTZ2Qk3oTtY8yw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XYXJEbmPhWRL+PVmY6t1rEzHom9aPB3ahm4ydbTzjIY8kZYeaLpBzr+ftH0Xn2VgWQ4GxVXll0Huv/7uJgcvbSq8M+pW9Vr4W4jo5Mlmh/oGQDekimaghKhKU0N3xtsqoS8U5Y6rfWm/g4sdFgNzLL/blzWvEdCKb9fSRg31dck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HgfkGdtf; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HgfkGdtf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D8161F000E9; Thu, 28 May 2026 20:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780001240; bh=oDSDITTE6Tw0zvOcl9op7q/H5Y3txdX08denqo8yN4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HgfkGdtfhfru1K67toiAAMKwZQ7LaoZuGz87/sEKqhdOJXhGFH5oHUbL0BrF0wXEg VH+1mBecERq8/Myzue0OI0rZ8LzFDAyYEIitbtBbCARstkP7OuMwDP1p02Xm2oEtAt ZcGZBxzvfMXSGLpTPXyJyZsx03/lZjTPPLM+dW3I= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John Walker , Johannes Berg Subject: [PATCH 6.6 056/186] wifi: cfg80211: advance loop vars in cfg80211_merge_profile() Date: Thu, 28 May 2026 21:48:56 +0200 Message-ID: <20260528194930.486423876@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194928.941004471@linuxfoundation.org> References: <20260528194928.941004471@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: John Walker commit 7666dbb1bacc4ba522b96740cba7283d243d16e1 upstream. cfg80211_merge_profile() reassembles a Multi-BSSID non-transmitted BSS profile that has been split across multiple consecutive MBSSID elements. Its while-loop calls cfg80211_get_profile_continuation(ie, ielen, mbssid_elem, sub_elem) but never advances mbssid_elem or sub_elem inside the body. Each iteration therefore searches for a continuation that follows the same fixed pair; the helper returns the same next_mbssid; and the same next_sub bytes are memcpy()'d into merged_ie at a growing offset until the buffer fills. Advance both mbssid_elem and sub_elem to the just-consumed continuation so the next call to cfg80211_get_profile_continuation() searches for a further continuation beyond it (or returns NULL when none exists). A specially-crafted malicious beacon can take advantage of this bug to cause the kernel to spend an excessive amount of time in cfg80211_merge_profile (up to as much as 2ms per beacon received), which could theoretically be abused in some way. Cc: stable@vger.kernel.org Fixes: fe806e4992c9 ("cfg80211: support profile split between elements") Signed-off-by: John Walker Link: https://patch.msgid.link/20260507230720.64783-1-johnwalker0@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/wireless/scan.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2300,6 +2300,9 @@ size_t cfg80211_merge_profile(const u8 * memcpy(merged_ie + copied_len, next_sub->data, next_sub->datalen); copied_len += next_sub->datalen; + + mbssid_elem = next_mbssid; + sub_elem = next_sub; } return copied_len;